Skip to main content

Python library and command line tool for removing/restoring emails in office365/Exchange using EWS API

Project description

PhishFry Remediation Library and Command Line Tool

PhishFry is a python library and command line tool for removing and restoring emails in exchange and office365. PhishFry supports shared mailboxes, group mailboxes and distribution lists. PhishFry removes/restores the entire conversation including any replies and forwards of the message.

Installation

Install with pip directly from github.

sudo pip install git+https://github.com/ace-ecosystem/phishfry.git

Add credentials for one or more exchange accounts with impersonation rights to the config.ini file.

Example config.ini file:
[account1]
user=admin@example1.com
pass=123456

[account2]
user=admin@example2.com
pass=123456

Command Line Tool

# display usage information
./phishfry.py -h

# Remove message with message_id=<message_id> from the test@example.com mailbox
./phishfry.py remove test@example.com "<message_id>"

# Restores message with message_id="<message_id>" to the test@example.com mailbox
./phishfry.py restore test@example.com "<message_id>"

Library

import phishfry

# Instantiate a phishfry account using admin email and password
account = phishfry.Account("admin@example1.com", "123456")

# remove a message
results = account.Remove("user@example1.com", "<message_id>")

# restore a message
results = account.Restore("user@example1.com", "<message_id>")

# using the results
for address in results:
	# print the email address for these results
	print(address)

	# get the remediation result for this address
	result = results[address]

	# print failure message if remediation action failed
	if not result.success:
		print(result.message)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phishfry-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

phishfry-1.0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file phishfry-1.0.1.tar.gz.

File metadata

  • Download URL: phishfry-1.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for phishfry-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8f3c44642490822537f4fe9d68e59517dccc7005368e2dfec2c9cb9a66bc348b
MD5 b947fcbcbd9bf63de8c3b98face13e5e
BLAKE2b-256 4a0139916ec92d0fd1a65ee232c5f39a42892e11ad466fcd33b09e8bd16ee96b

See more details on using hashes here.

File details

Details for the file phishfry-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: phishfry-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for phishfry-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d33677814648eb987e3ac5e2f517f0af8bc3bb75bd5487e82139d8842dab42b
MD5 8550419d2a088cf62b5a6bf6dafccb79
BLAKE2b-256 8d5ff90e04916b80be4ee77b05e344105e7d155032d066c9067d61ae935dd02c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page