Incredibly fast crawler designed for OSINT.
Sort imports (PEP8)
Fabian Affolter81023e3c51dc
diff --git a/.isort.cfg b/.isort.cfgnew file mode 100644index 0000000..79a6550--- /dev/null+++ b/.isort.cfg@@ -0,0 +1,2 @@+[settings]+multi_line_output=4diff --git a/core/config.py b/core/config.pyindex 68bc905..e257f0b 100644--- a/core/config.py+++ b/core/config.py@@ -1,2 +1,2 @@intels = ['github.com', 'facebook.com', 'instagram.com', 'youtube.com']-badTypes = ['png', 'jpg', 'jpeg', 'pdf', 'js', 'css', 'ico', 'bmp', 'svg', 'json', 'xml', 'xls', 'csv', 'docx']\ No newline at end of file+badTypes = ['png', 'jpg', 'jpeg', 'pdf', 'js', 'css', 'ico', 'bmp', 'svg', 'json', 'xml', 'xls', 'csv', 'docx']diff --git a/core/prompt.py b/core/prompt.pyindex 24151ed..84c3b09 100644--- a/core/prompt.py+++ b/core/prompt.py@@ -1,6 +1,7 @@import osimport tempfile+def prompt(default=None):editor = 'nano'with tempfile.NamedTemporaryFile(mode='r+') as tmpfile:@@ -16,4 +17,4 @@ def prompt(default=None):else:os.waitpid(child_pid, 0)tmpfile.seek(0)- return tmpfile.read().strip()\ No newline at end of file+ return tmpfile.read().strip()diff --git a/photon.py b/photon.pyindex 47d85f6..3d80c53 100644--- a/photon.py+++ b/photon.py@@ -3,19 +3,22 @@from __future__ import print_function+import argparseimport os+import randomimport sys-import tld+import threadingimport time-import randomimport warnings-import argparse-import threadingfrom math import log-from core.prompt import prompt-from re import search, findall+from re import findall, search+from requests import get, post+import tld+from core.config import badTypes, intels+from core.prompt import prompt+try:import concurrent.futuresfrom urllib.parse import urlparse # for Python 3@@ -24,7 +27,6 @@ except ImportError:from urlparse import urlparse # for Python 2python2, python3 = True, False-from core.config import intels, badTypestry:input = raw_inputdiff --git a/plugins/dnsdumpster.py b/plugins/dnsdumpster.pyindex 9fb1b40..6072475 100644--- a/plugins/dnsdumpster.py+++ b/plugins/dnsdumpster.py@@ -1,6 +1,8 @@import re+import requests+def dnsdumpster(domain, output_dir):response = requests.Session().get('https://dnsdumpster.com/').textcsrf_token = re.search(r"name='csrfmiddlewaretoken' value='(.*?)'", response).group(1)@@ -13,4 +15,4 @@ def dnsdumpster(domain, output_dir):image = requests.get('https://dnsdumpster.com/static/map/%s.png' % domain)if image.status_code == 200:with open('%s/%s.png' % (output_dir, domain), 'wb') as f:- f.write(image.content)\ No newline at end of file+ f.write(image.content)diff --git a/plugins/exporter.py b/plugins/exporter.pyindex c8a0d3d..dc7fb10 100644--- a/plugins/exporter.py+++ b/plugins/exporter.py@@ -1,5 +1,6 @@import json+def exporter(directory, method, datasets):if method.lower() == 'json':json_string = json.dumps(datasets, indent=4) # convert json_dict to a json styled stringdiff --git a/plugins/findSubdomains.py b/plugins/findSubdomains.pyindex 461d5d2..fa8ad08 100644--- a/plugins/findSubdomains.py+++ b/plugins/findSubdomains.py@@ -1,6 +1,8 @@from re import findall+from requests import get+def findSubdomains(domain):result = set()response = get('https://findsubdomains.com/subdomains-of/' + domain).text@@ -9,4 +11,4 @@ def findSubdomains(domain):matches = findall(r'rel="nofollow" href="([^/]*)" target="_blank"', part)for match in matches:result.add(match)- return list(result)\ No newline at end of file+ return list(result)diff --git a/plugins/wayback.py b/plugins/wayback.pyindex 17d6a79..3e46af9 100644--- a/plugins/wayback.py+++ b/plugins/wayback.py@@ -1,6 +1,8 @@import json+from requests import get+def timeMachine(host, mode):url = '''http://web.archive.org/cdx/search?url=%s&matchType=%s&collapse=urlkey&fl=original&filter=mimetype:text/html&filter=statuscode:200&output=json&from=20180101&to=20181231''' % (host, mode)response = get(url).text@@ -8,4 +10,4 @@ def timeMachine(host, mode):urls = []for item in parsed:urls.append(item[0])- return urls\ No newline at end of file+ return urls