{"id":28471739,"url":"https://github.com/reverseclabs/peas","last_synced_at":"2026-03-04T19:02:31.103Z","repository":{"id":145299318,"uuid":"69665173","full_name":"ReversecLabs/peas","owner":"ReversecLabs","description":"PEAS is a Python 2 library and command line application for running commands on an ActiveSync server e.g. Microsoft Exchange.","archived":false,"fork":false,"pushed_at":"2023-01-16T08:33:14.000Z","size":131,"stargazers_count":178,"open_issues_count":5,"forks_count":55,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-07T11:08:39.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://labs.mwrinfosecurity.com/tools/peas-access-internal-fileshares-through-exchange-activesync/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReversecLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-30T12:30:57.000Z","updated_at":"2025-05-14T09:39:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"cef3aa33-108e-45e1-b2c5-b7e98c0609f2","html_url":"https://github.com/ReversecLabs/peas","commit_stats":null,"previous_names":["fsecurelabs/peas","reverseclabs/peas","withsecurelabs/peas"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ReversecLabs/peas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReversecLabs%2Fpeas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReversecLabs%2Fpeas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReversecLabs%2Fpeas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReversecLabs%2Fpeas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReversecLabs","download_url":"https://codeload.github.com/ReversecLabs/peas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReversecLabs%2Fpeas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046054,"owners_count":23405126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T11:08:43.793Z","updated_at":"2026-03-04T19:02:31.020Z","avatar_url":"https://github.com/ReversecLabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEAS\nPEAS is a Python 2 library and command line application for running commands on an ActiveSync server e.g. Microsoft Exchange. It is based on [research](https://labs.mwrinfosecurity.com/blog/accessing-internal-fileshares-through-exchange-activesync) into Exchange ActiveSync protocol by Adam Rutherford and David Chismon of MWR.\n\n## Prerequisites\n\n* `python` is Python 2, otherwise use `python2`\n* Python [Requests](http://docs.python-requests.org/) library\n\n## Significant source files\nPath | Functionality\n--- | ---\n`peas/__main__.py` | The command line application.\n`peas/peas.py` | The PEAS client class that exclusively defines the interface to PEAS.\n`peas/py_activesync_helper.py` | The helper functions that control the interface to pyActiveSync.\n`peas/pyActiveSync/client` | The pyActiveSync EAS command builders and parsers.\n\n## Optional installation\n`python setup.py install`\n\n# PEAS application\nPEAS can be run without installation from the parent `peas` directory (containing this readme). PEAS can also be run with the command `peas` after installation.\n\n## Running PEAS\n\n`python -m peas [options] \u003cserver\u003e`\n\n\n## Example usage\n### Check server\n`python -m peas 10.207.7.100`\n\n### Check credentials\n`python -m peas --check -u luke2 -p ChangeMe123 10.207.7.100`\n\n### Get emails\n`python -m peas --emails -u luke2 -p ChangeMe123 10.207.7.100`\n\n### Save emails to directory\n`python -m peas --emails -O emails -u luke2 -p ChangeMe123 10.207.7.100`\n\n### List file shares\n`python -m peas --list-unc='\\\\fictitious-dc' -u luke2 -p ChangeMe123 10.207.7.100`\n\n`python -m peas --list-unc='\\\\fictitious-dc\\guestshare' -u luke2 -p ChangeMe123 10.207.7.100`\n\n**Note:** Using an IP address or FQDN instead of a hostname in the UNC path may fail.\n\n### View file on file share\n`python -m peas --dl-unc='\\\\fictitious-dc\\guestshare\\fileonguestshare.txt' -u luke2 -p ChangeMe123 10.207.7.100`\n\n### Save file from file share\n`python -m peas --dl-unc='\\\\fictitious-dc\\guestshare\\fileonguestshare.txt' -o file.txt -u luke2 -p ChangeMe123 10.207.7.100`\n\n### Command line arguments\n\nRun `python -m peas --help` for the latest options.\n\n    Options:\n      -h, --help            show this help message and exit\n      -u USER               username\n      -p PASSWORD           password\n      --smb-user=USER       username to use for SMB operations\n      --smb-pass=PASSWORD   password to use for SMB operations\n      --verify-ssl          verify SSL certificates (important)\n      -o FILENAME           output to file\n      -O PATH               output directory (for specific commands only, not\n                            combined with -o)\n      -F repr,hex,b64,stdout,stderr,file\n                            output formatting and encoding options\n      --check               check if account can be accessed with given password\n      --emails              retrieve emails\n      --list-unc=UNC_PATH   list the files at a given UNC path\n      --dl-unc=UNC_PATH     download the file at a given UNC path\n      \n      \n## PEAS library\n\nPEAS can be imported as a library.\n\n### Example code\n\n    import peas\n\n    # Create an instance of the PEAS client.\n    client = peas.Peas()\n    \n    # Display the documentation for the PEAS client.\n    help(client)\n\n    # Disable certificate verification so self-signed certificates don't cause errors.\n    client.disable_certificate_verification()\n\n    # Set the credentials and server to connect to.\n    client.set_creds({\n        'server': '10.207.7.100',\n        'user': 'luke2',\n        'password': 'ChangeMe123',\n    })\n\n    # Check the credentials are accepted.\n    print(\"Auth result:\", client.check_auth())\n\n    # Retrieve a file share directory listing.\n    listing = client.get_unc_listing(r'\\\\fictitious-dc\\guestshare')\n    print(listing)\n\n    # Retrieve emails.\n    emails = client.extract_emails()\n    print(emails)\n\n## Extending\n\nTo extend the functionality of PEAS, there is a four step process:\n\n1. Create a builder and parser for the EAS command if it has not been implemented in `pyActiveSync/client`. Copying an existing source file for another command and then editing it has proved effective. The [Microsoft EAS documentation](https://msdn.microsoft.com/en-us/library/ee202197%28v=exchg.80%29.aspx) describes the structure of the XML that must be created and parsed from the response.\n\n2. Create a helper function in `py_activesync_helper.py` that connects to the EAS server over HTTPS, builds and runs the command to achieve the desired functionality. Again, copying an existing function such as `get_unc_listing` can be effective.\n\n3. Create a method in the `Peas` class that calls the helper function to achieve the desired functionality. This is where PEAS would decide which backend helper function to call if py-eas-client was also an option.\n\n4. Add command line support for the feature to the PEAS application by editing `peas/__main__.py`. A new option should be added that when set, calls the method created in the previous step.\n\n \n## Limitations \n \nPEAS has been tested on Kali 2.0 against Microsoft Exchange Server 2013 and 2016. The domain controller was Windows 2012 and the Exchange server was running on the same machine. Results with other configurations may vary.\n\npy-eas-client support is limited to retrieving emails and causes a dependency on Twisted. It was included when the library was being evaluated but it makes sense to remove it from PEAS now, as all functionality can be provided by pyActiveSync.\n\nThe licence may be restrictive due to the inclusion of pyActiveSync, which uses the GPLv2.\n\nThe requirement to know the hostname of the target machine for file share access may impede enumeration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freverseclabs%2Fpeas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freverseclabs%2Fpeas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freverseclabs%2Fpeas/lists"}