forked from IntegralDefense/cloudphishlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudphish.py
More file actions
executable file
·35 lines (27 loc) · 1.47 KB
/
cloudphish.py
File metadata and controls
executable file
·35 lines (27 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python3
import os
import sys
import argparse
import logging
from cloudphishlib import cloudphish, load_config
logging.basicConfig(level=logging.WARNING,
format='%(asctime)s - %(name)s - [%(levelname)s] %(message)s')
logger = logging.getLogger(__name__)
if __name__ == "__main__":
config = load_config()
profiles = config.sections()
parser = argparse.ArgumentParser(description="simple user interface to cloudphish")
parser.add_argument('-e', '--environment', dest='environment', choices=profiles, default='default', help='select the ace cloudphish node you want to work with.')
parser.add_argument('-s', '--submit', dest='url', help="submit a url/check on a url")
parser.add_argument('-r', '--reprocess', action='store_true', help="make cloudphish reprocess a url")
parser.add_argument('-a', '--alert', action='store_true', help="ACE alert if cloudphish finds a detection, and an alert hasn't already been generated")
parser.add_argument('-c', '--clear', dest='clear_url', help="clear the cloudphish cache for a url")
parser.add_argument('-g', '--get', dest='sha256_content', help="get the cached content")
args = parser.parse_args()
cp = cloudphish(profile=args.environment)
if args.url:
print(cp.submit(args.url, reprocess=args.reprocess, alert=args.alert, text=True))
elif args.sha256_content:
print(cp.get(args.sha256_content))
elif args.clear_url:
print(cp.clear(args.clear_url))