initial release of Zeus - Advanced dork scanner

This commit is contained in:
ekultek 2017-09-07 12:54:16 -05:00
commit 5432fdd15b
26 changed files with 6071 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
log/*
geckodriver.log
*.pyc

11
.idea/AGDSE.iml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

View file

@ -0,0 +1,21 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="requests" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E701" />
</list>
</option>
</inspection_tool>
</profile>
</component>

4
.idea/misc.xml Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.13 (/usr/bin/python2.7)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../zeus-scanner/.idea/AGDSE.iml" filepath="$PROJECT_DIR$/../zeus-scanner/.idea/AGDSE.iml" />
</modules>
</component>
</project>

575
.idea/workspace.xml Normal file
View file

@ -0,0 +1,575 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="fa0f5eb7-e97e-4132-8d93-44a82bacbb76" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="settings.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/settings.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
<caret line="30" column="32" lean-forward="false" selection-start-line="30" selection-start-column="32" selection-end-line="30" selection-end-column="32" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="zeus.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/zeus.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1656">
<caret line="92" column="0" lean-forward="false" selection-start-line="92" selection-start-column="0" selection-end-line="92" selection-end-column="0" />
<folding>
<element signature="e#23#34#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="265">
<caret line="39" column="0" lean-forward="false" selection-start-line="39" selection-start-column="0" selection-end-line="39" selection-end-column="0" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="LICENSE.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/LICENSE.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="18">
<caret line="1" column="48" lean-forward="false" selection-start-line="1" selection-start-column="48" selection-end-line="1" selection-end-column="48" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="requirements.txt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/requirements.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="unzip_gecko.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/bin/unzip_gecko.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-350">
<caret line="40" column="67" lean-forward="false" selection-start-line="40" selection-start-column="67" selection-end-line="40" selection-end-column="67" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="executed" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/bin/executed">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="5" lean-forward="true" selection-start-line="0" selection-start-column="5" selection-end-line="0" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>bypass Goo</find>
<find>bypass Google API</find>
<find>obtain</find>
<find>set_</find>
<find>adjusting user-agent</find>
<find>create_dir</find>
<find>NmapHook</find>
<find>saving found</find>
<find>print opts</find>
<find>print</find>
<find>ip</find>
<find>verbose</find>
<find>false</find>
<find>null</find>
<find>--</find>
<find>False</find>
<find>None</find>
<find>:</find>
<find>,</find>
<find>adding</find>
<find>try:</find>
<find>proxy</find>
<find>RANDOM_USER_AGENT</find>
<find>TRUE</find>
<find>setup</find>
</findStrings>
<replaceStrings>
<replace>False</replace>
<replace>None</replace>
<replace />
</replaceStrings>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/var/request/request_errors/__init__.py" />
<option value="$PROJECT_DIR$/lib/errors/__init__.py" />
<option value="$PROJECT_DIR$/var/request/connect.py" />
<option value="$PROJECT_DIR$/var/request/test_connect.py" />
<option value="$PROJECT_DIR$/lib/_logging/__init__.py" />
<option value="$PROJECT_DIR$/main.py" />
<option value="$PROJECT_DIR$/log/zeus-log-5.log" />
<option value="$PROJECT_DIR$/geckodriver.log" />
<option value="$PROJECT_DIR$/tests/__init__.py" />
<option value="$PROJECT_DIR$/tests/test.py" />
<option value="$PROJECT_DIR$/etc/agents.txt" />
<option value="$PROJECT_DIR$/lib/find_os/__init__.py" />
<option value="$PROJECT_DIR$/lib/scan/__init__.py" />
<option value="$PROJECT_DIR$/lib/sqli/__init__.py" />
<option value="$PROJECT_DIR$/dorks.txt" />
<option value="$PROJECT_DIR$/bin/unzip_gecko.sh" />
<option value="$PROJECT_DIR$/etc/payloads.xml" />
<option value="$PROJECT_DIR$/lib/attacks/sqli/sqli_check.py" />
<option value="$PROJECT_DIR$/lib/attacks/sqli/__init__.py" />
<option value="$PROJECT_DIR$/thirdparty/__init__.py" />
<option value="$PROJECT_DIR$/thirdparty/console/__init__.py" />
<option value="$PROJECT_DIR$/requirements.txt" />
<option value="$PROJECT_DIR$/log/used-hashes/hashes.log" />
<option value="$PROJECT_DIR$/lib/attacks/sqlmap_scan/sqlmap_opts_dict.py" />
<option value="$PROJECT_DIR$/lib/attacks/sqlmap_scan/sqlmap_opts.py" />
<option value="$PROJECT_DIR$/lib/errors.py" />
<option value="$PROJECT_DIR$/var/google_search/search.py" />
<option value="$PROJECT_DIR$/log/zeus-log-7.log" />
<option value="$PROJECT_DIR$/data.txt" />
<option value="$PROJECT_DIR$/log/url-log/url-log-1.log" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/zeus.py" />
<option value="$PROJECT_DIR$/lib/attacks/nmap_scan/__init__.py" />
<option value="$PROJECT_DIR$/lib/attacks/sqlmap_scan/__init__.py" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/LICENSE.md" />
<option value="$PROJECT_DIR$/lib/settings.py" />
<option value="$PROJECT_DIR$/lib/settings.py" />
<option value="$PROJECT_DIR$/bin/unzip_gecko.py" />
<option value="$PROJECT_DIR$/bin/executed" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="64" />
<option name="y" value="-11" />
<option name="width" value="1303" />
<option name="height" value="780" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
<item name="bin" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="attacks" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="attacks" type="462c0819:PsiDirectoryNode" />
<item name="nmap_scan" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zeus-scanner" type="b2602c69:ProjectViewProjectNode" />
<item name="zeus-scanner" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="attacks" type="462c0819:PsiDirectoryNode" />
<item name="sqlmap_scan" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/bin" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/lib/attacks" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="fa0f5eb7-e97e-4132-8d93-44a82bacbb76" name="Default" comment="" />
<created>1503863551848</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1503863551848</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="64" y="-11" width="1303" height="780" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24980783" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34131736" sideWeight="0.5057648" order="0" side_tool="true" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934132" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.34131736" sideWeight="0.49423522" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
<window_info id="Data View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Thumbnails" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934132" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="3" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/nmap-log/scan-results-1379.log" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/scan-results-1.log" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/scan-results-2.json" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/scan-results-3.json" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/scan-results-208.80.154.224.json" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/scan-results-162.242.198.235.json" />
<entry file="file://$PROJECT_DIR$/log/zeus-log-3.log" />
<entry file="file://$PROJECT_DIR$/log/zeus-log-18.log" />
<entry file="file://$PROJECT_DIR$/log/zeus-log-17.log" />
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-5.log" />
<entry file="file://$PROJECT_DIR$/var/google_search/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dorks.txt" />
<entry file="file://$PROJECT_DIR$/bin/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bin/geckodriver-v0.18.0-linux32.tar.gz">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/etc/payloads.xml" />
<entry file="file://$PROJECT_DIR$/lib/attacks/sqli/sqli_check.py" />
<entry file="file://$PROJECT_DIR$/lib/attacks/sqli/__init__.py" />
<entry file="file://$PROJECT_DIR$/geckodriver.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/thirdparty/__init__.py" />
<entry file="file://$PROJECT_DIR$/thirdparty/console/__init__.py" />
<entry file="file://$PROJECT_DIR$/log/zeus-log-36.log" />
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-13.log" />
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-6.log" />
<entry file="file://$PROJECT_DIR$/log/zeus-log-5.log" />
<entry file="file://$PROJECT_DIR$/log/used-hashes/hashes.log" />
<entry file="file://$PROJECT_DIR$/lib/attacks/sqlmap_scan/sqlmap_opts_dict.py" />
<entry file="file://$PROJECT_DIR$/lib/attacks/sqlmap_scan/sqlmap_opts.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="16" column="65" lean-forward="true" selection-start-line="16" selection-start-column="65" selection-end-line="16" selection-end-column="65" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/scanner-log/nmap_scan-results-74.208.236.115.json" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/nmap_scan-results-192.185.183.48.json" />
<entry file="file://$PROJECT_DIR$/log/scanner-log/nmap_scan-results-63.135.117.87.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-2.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-3.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-4.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/data.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="26" lean-forward="false" selection-start-line="4" selection-start-column="26" selection-end-line="4" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/zeus-log-7.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="0" lean-forward="true" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/zeus-log-1.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="0" lean-forward="true" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/zeus-log-2.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-495">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/url-log/url-log-1.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/errors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="6" column="42" lean-forward="false" selection-start-line="6" selection-start-column="42" selection-end-line="6" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/var/google_search/search.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1602">
<caret line="89" column="49" lean-forward="false" selection-start-line="89" selection-start-column="49" selection-end-line="89" selection-end-column="49" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/attacks/nmap_scan/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="108" column="19" lean-forward="false" selection-start-line="108" selection-start-column="19" selection-end-line="108" selection-end-column="19" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/attacks/sqlmap_scan/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="124" column="80" lean-forward="false" selection-start-line="124" selection-start-column="80" selection-end-line="124" selection-end-column="80" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/requirements.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="265">
<caret line="39" column="0" lean-forward="false" selection-start-line="39" selection-start-column="0" selection-end-line="39" selection-end-column="0" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/LICENSE.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="18">
<caret line="1" column="48" lean-forward="false" selection-start-line="1" selection-start-column="48" selection-end-line="1" selection-end-column="48" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/settings.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
<caret line="30" column="32" lean-forward="false" selection-start-line="30" selection-start-column="32" selection-end-line="30" selection-end-column="32" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bin/unzip_gecko.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bin/unzip_gecko.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-350">
<caret line="40" column="67" lean-forward="false" selection-start-line="40" selection-start-column="67" selection-end-line="40" selection-end-column="67" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/zeus.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1656">
<caret line="92" column="0" lean-forward="false" selection-start-line="92" selection-start-column="0" selection-end-line="92" selection-end-column="0" />
<folding>
<element signature="e#23#34#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bin/executed">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="5" lean-forward="true" selection-start-line="0" selection-start-column="5" selection-end-line="0" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

15
LICENSE.md Normal file
View file

@ -0,0 +1,15 @@
Zeus-Scanner Advanced Dork Scanning Tool
Copyright (C) 2017 Thomas Perkins (Ekultek)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

39
README.md Normal file
View file

@ -0,0 +1,39 @@
# Zeus-Scanner
### What is Zeus?
Zeus is a advanced dork searching tool that is capable of bypassing search engine API calls, search engine captchas, and IP address blocking from sending many requests to the search engine itself. Zeus can use three different search engines to do the search (_default is Google_). Zeus has a powerful built in engine, automates a hidden web browser to pull the search URL, and can run sqlmap and nmap scans on the URL's.
### Screenshots
Running without a mandatory options, or running the `--help` flag will output Zeus's help menu:
![zeus-help](https://user-images.githubusercontent.com/14183473/30176257-63391c62-93c7-11e7-94d7-68fde7818381.png)
A basic dork scan with the `-d` flag, from the given dork will launch an automated browser and pull the Google page results:
![zeus-dork-scan](https://user-images.githubusercontent.com/14183473/30176252-618b191a-93c7-11e7-84d2-572c12994c4d.png)
Calling the `-s` flag will prompt for you to start the sqlmap API server `python sqlmapapi.py -s` from sqlmap, it will then connect to the API and perform a sqlmap scan on the found URL's.
![zeus-sqlmap-api](https://user-images.githubusercontent.com/14183473/30176259-6657b304-93c7-11e7-81f8-0ed09a6c0268.png)
### Requirements
There are a few requirements for this:
- If you want to run sqlmap through the URL's you will need sqlmap somewhere on your system.
- If you want to run a port scan using nmap on the URL's IP addresses. You will need nmap on your system.
- Gecko web driver is required and will be installed the first time you run. It will be added to your `/usr/bin` so that it can be run in your ENV PATH.
- You must be `sudo` for the first time running this so that you can add the driver to your PATH
- `selenium-webdriver` package is required to automate the web browser and bypass API calls.
- `requests` package is required to connect to the URL, and the sqlmap API
- `python-nmap` package is required to run nmap on the URL's IP addresses
- `whichcraft` package is required to check if nmap and sqlmap are on your system if you want to use them
- `pyvirtualdisplay` package is required to hide the browser display while finding the search URL
### Installing
To install Zeus you simply need to do the following:
- **_(optional but highly advised)_** add sqlmap and nmap to your environment PATH by moving them to `/usr/bin` or by adding them to the PATH via terminal
- Run `pip install requirements.txt`
- For your first run, run `sudo python zeus.py`
This will install all the package requirements along with the gecko web driver

0
bin/__init__.py Normal file
View file

1
bin/executed Normal file
View file

@ -0,0 +1 @@
FALSE

Binary file not shown.

Binary file not shown.

84
bin/unzip_gecko.py Normal file
View file

@ -0,0 +1,84 @@
import os
import platform
import tarfile
import whichcraft
import lib.settings
def check_if_run(file_check="{}/bin/executed"):
"""
check if the application has been run before by reading the executed file
"""
with open(file_check.format(os.getcwd())) as exc:
if "FALSE" in exc.read():
return True
return False
def untar_gecko(filename="{}/bin/geckodriver-v0.18.0-linux{}.tar.gz", verbose=False):
"""
untar the correct gecko driver for your computer architecture
"""
arch_info = {"64bit": "64", "32bit": "32"}
file_arch = arch_info[platform.architecture()[0]]
tar = tarfile.open(filename.format(os.getcwd(), file_arch), "r:gz")
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"extracting the correct driver for your architecture...", level=10
))
try:
tar.extractall("/usr/bin")
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"driver extracted into /usr/bin (you may change this, but ensure that it "
"is in your PATH)...", level=10
))
except Exception as e:
if "[Errno 13] Permission denied: '/usr/bin/geckodriver'" in str(e):
lib.settings.logger.exception(lib.settings.set_color(
"first run must be ran as root (sudo python zeus.py)...", level=50
))
else:
lib.settings.logger.exception(lib.settings.set_color(
"ran into exception '{}', logged to current log file...".format(e), level=50
))
exit(-1)
tar.close()
def ensure_placed(item="geckodriver", verbose=False):
"""
use whichcraft to ensure that the driver has been placed in your PATH variable
"""
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"ensuring that the driver exists in your system path...", level=10
))
if not whichcraft.which(item):
lib.settings.logger.fatal(lib.settings.set_color(
"the executable '{}' does not appear to be in your /usr/bin PATH. "
"please untar the correct geckodriver (if not already done) and move "
"it to /usr/bin.".format(item), level=50
))
exit(-1)
else:
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"driver exists, continuing...", level=10
))
return True
def main(rewrite="{}/bin/executed", verbose=False):
"""
main method
"""
if check_if_run():
untar_gecko(verbose=verbose)
if ensure_placed(verbose=verbose):
with open(rewrite.format(os.getcwd()), "w") as rw:
rw.write("TRUE")
else:
pass

4195
etc/agents.txt Normal file

File diff suppressed because it is too large Load diff

0
lib/__init__.py Normal file
View file

0
lib/attacks/__init__.py Normal file
View file

View file

@ -0,0 +1,135 @@
import os
import nmap
import json
import time
import socket
from lib.settings import (
logger,
set_color,
create_dir,
find_application
)
class NmapHook(object):
"""
Nmap API hook, uses python, must have nmap on your system
"""
NM = nmap.PortScanner()
def __init__(self, ip, verbose=False, pretty=True,
dirname="{}/log/scanner-log".format(os.getcwd()), filename="nmap_scan-results-{}.json",
ports=None):
self.ip = ip
self.verbose = verbose
self.pretty = pretty
self.dir = dirname
self.file = filename
self.ports = ports
def _get_all_info(self):
"""
get all the information from the scan
"""
scanned_data = self.NM.scan(self.ip, ports=self.ports)
if self.pretty:
scanned_data = json.dumps(scanned_data, indent=4, sort_keys=True)
return scanned_data
def send_to_file(self):
"""
send all the information to a JSON file for further use
"""
create_dir(self.dir)
full_nmap_path = "{}/{}".format(self.dir, self.file.format(self.ip))
with open(full_nmap_path, "a+") as log:
log.write(self._get_all_info())
return full_nmap_path
def show_open_ports(self, sep="-" * 30):
"""
outputs the current scan information
"""
logger.info(set_color("data found for IP '{}'...".format(self.ip)))
for host in self.NM.all_hosts():
if host:
print(
"{}\nScanned: {} ({})\nHost state: {}".format(
sep, self.ip, self.NM[self.ip].hostname(),
self.NM[self.ip].state()
)
)
else:
logger.warning(set_color(
"nothing found skipping...", level=30
))
for proto in self.NM[host].all_protocols():
print(
"Protocol: {}".format(proto)
)
oports = self.NM[host][proto].keys()
oports.sort()
for port in oports:
print(
"Port: {}\tStatus: {}".format(
port, self.NM[host][proto][port]["state"]
)
)
print(sep)
def find_nmap(item_name="nmap", given_search_path=None, verbose=False):
"""
find nmap on the users system if they do not specify a path for it or it is not in their PATH
"""
return find_application(item_name, given_search_path=given_search_path, verbose=verbose)
def perform_port_scan(url, ports=None, scanner=NmapHook, verbose=False, full_path=None, **kwargs):
"""
main function that will initalize the port scanning
"""
url = url.strip()
logger.info(set_color(
"attempting to find IP address for hostname '{}'...".format(url)
))
found_ip_address = socket.gethostbyname(url)
logger.info(set_color(
"found IP address for given URL -> '{}'...".format(found_ip_address)
))
if verbose:
logger.debug(set_color(
"checking for nmap on your system...", level=10
))
nmap_exists = find_nmap(verbose=verbose)
if nmap_exists:
if verbose:
logger.debug(set_color(
"nmap has been found under '{}'...".format(nmap_exists), level=10
))
logger.info(set_color(
"starting port scan on IP address '{}'...".format(found_ip_address)
))
try:
data = scanner(found_ip_address, ports=ports)
logger.warning(set_color(
"sleeping for 15 seconds to given nmap time to complete...", level=30
))
time.sleep(15)
data.show_open_ports()
file_path = data.send_to_file()
logger.info(set_color(
"port scan completed, saved to JSON file under '{}'...".format(file_path)
))
except Exception as e:
logger.exception(set_color(
"ran into exception '{}', cannot continue quitting...".format(e), level=50
))
pass
else:
logger.fatal(set_color(
"nmap was not found on your system, please install it...", level=50
))

View file

@ -0,0 +1,181 @@
import re
import json
import time
import urllib2
import subprocess
import requests
import lib.settings
import lib.errors
class SqlmapHook(object):
"""
Sqlmap API hook, will process API requests, and output API data
"""
def __init__(self, to_scan, port=None, api_con="http://127.0.0.1:{}", default_port=8775):
self.to_scan = to_scan
if port is None:
self.port = default_port
else:
self.port = port
self.headers = {"Content-Type": "application/json"}
self.connection = api_con.format(self.port)
self.commands = {
"init": "/task/new",
"id": "/admin/0/list",
"start": "/scan/{}/start",
"status": "/scan/{}/status",
"log": "/scan/{}/log"
}
def init_new_scan(self):
"""
create a new API scan
"""
new_scan_url = "{}{}".format(self.connection, self.commands["init"])
return requests.get(new_scan_url, params=self.headers)
def get_scan_id(self):
"""
get the ID of the current API scan
"""
id_re = re.compile(r"[a-fA-F0-9]{16}")
api_id_url = "{}{}".format(self.connection, self.commands["id"])
req = requests.get(api_id_url)
to_check = str(json.loads(req.content)["tasks"]).lower()
return ''.join(id_re.findall(to_check))
def start_scan(self, api_id, opts=None):
"""
start the API scan
"""
start_scan_url = "{}{}".format(self.connection, self.commands["start"].format(api_id))
data_dict = {"url": self.to_scan}
if opts is not None:
for i in range(0, len(opts)):
data_dict[opts[i][0]] = opts[i][1]
post_data = json.dumps(data_dict)
req = urllib2.Request(start_scan_url, data=post_data, headers=self.headers)
return urllib2.urlopen(req)
def show_sqlmap_log(self, api_id):
"""
show the sqlmap log during the API scan
"""
running_status_url = "{}{}".format(self.connection, self.commands["status"].format(api_id))
running_log_url = "{}{}".format(self.connection, self.commands["log"].format(api_id))
status_req = requests.get(running_status_url)
status_json = json.loads(status_req.content)
current_status = status_json["status"]
if current_status != "running":
raise lib.errors.SqlmapFailedStart(
"sqlmap API failed to start the run, check the client and see what "
"the problem is and try again..."
)
already_displayed = set()
while current_status == "running":
current_status = json.loads(requests.get(running_status_url).content)["status"]
log_req = requests.get(running_log_url)
log_json = json.loads(log_req.content)
for i in range(0, len(log_json["log"])):
if log_json["log"][i]["message"] in already_displayed:
time.sleep(1)
pass
else:
print(
"sqlmap> [{} {}] {}".format(
log_json["log"][i]["time"],
log_json["log"][i]["level"],
log_json["log"][i]["message"]
)
)
already_displayed.add(log_json["log"][i]["message"])
time.sleep(0.2)
def find_sqlmap(given_search_path=None, to_find="sqlmapapi.py", verbose=False):
"""
find sqlmap on the users system
"""
return lib.settings.find_application(to_find, verbose=verbose, given_search_path=given_search_path)
def sqlmap_scan_main(url, port=None, verbose=None, auto_search=False, opts=None, given_path=None, full_path=None):
"""
the main function that will be called and initialize everything
"""
def ___dict_args():
"""
create argument tuples for the sqlmap arguments passed by the user
"""
retval = {}
for (arg, val) in opts:
retval[arg] = val
return retval
if auto_search:
lib.settings.logger.info(lib.settings.set_color(
"attempting to find sqlmap on your system..."
))
path = ''.join(find_sqlmap(verbose=verbose, given_search_path=given_path))
if path:
subprocess.check_output(["python", path, "-s"])
else:
lib.settings.prompt(
"start the sqlmap API server and press enter when ready..."
)
try:
sqlmap_scan = SqlmapHook(url, port=port)
lib.settings.logger.info(lib.settings.set_color(
"initializing new sqlmap scan with given URL '{}'...".format(url)
))
sqlmap_scan.init_new_scan()
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"scan initialized...", level=10
))
lib.settings.logger.info(lib.settings.set_color(
"gathering sqlmap API scan ID..."
))
api_id = sqlmap_scan.get_scan_id()
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"current sqlmap scan ID: '{}'...".format(api_id), level=10
))
lib.settings.logger.info(lib.settings.set_color(
"starting sqlmap scan..."
))
if opts is not None:
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"using arguments: '{}'...".format(___dict_args()), level=10
))
lib.settings.logger.info(lib.settings.set_color(
"adding arguments to sqlmap API..."
))
lib.settings.logger.warning(lib.settings.set_color(
"please keep in mind that this is the API, it might take a little "
"longer to do the full scan on the given URL... launching...", level=30
))
sqlmap_scan.start_scan(api_id, opts=opts)
print("-" * 20)
sqlmap_scan.show_sqlmap_log(api_id)
print("-" * 20)
except requests.exceptions.HTTPError as e:
lib.settings.logger.exception(lib.settings.set_color(
"ran into error '{}', seems you didn't start the server, check "
"the server port and try again...".format(e), level=50
))
pass
except Exception as e:
lib.settings.logger.exception(lib.settings.set_color(
"ran into error '{}', seems something went wrong, error has "
"been saved to current log file. Please make an issue to get "
"this addressed...".format(e), level=50
))
pass

View file

@ -0,0 +1,33 @@
SQLMAP_API_OPTIONS = {
"crawlDepth", "osShell", "getUsers", "getPasswordHashes", "excludeSysDbs", "ignoreTimeouts",
"regData", "prefix", "code", "googlePage", "skip", "query", "randomAgent", "osPwn", "authType",
"safeUrl", "requestFile", "predictOutput", "wizard", "stopFail", "forms",
"uChar", "pivotColumn", "dropSetCookie", "smart", "paramExclude", "risk",
"sqlFile", "rParam", "getCurrentUser", "notString", "getRoles", "getPrivileges",
"testParameter", "tbl", "charset", "trafficFile", "osSmb", "level",
"dnsDomain", "skipStatic", "secondOrder", "outputDir", "skipWaf", "timeout",
"firstChar", "torPort", "getComments", "binaryFields", "checkTor", "commonTables",
"direct", "tmpPath", "titles", "getSchema", "identifyWaf", "paramDel",
"safeReqFile", "regKey", "murphyRate", "limitStart", "crawlExclude", "flushSession",
"loadCookies", "csvDel" ",", "offline", "method", "tmpDir", "disablePrecon",
"osBof", "testSkip", "invalidLogical", "getCurrentDb", "hexConvert", "proxyFile",
"answers", "host", "dependencies", "cookie", "proxy", "regType",
"optimize", "limitStop", "search", "uFrom", "noCast", "testFilter",
"ignoreCode", "eta", "csrfToken", "threads", "logFile", "os",
"col", "rFile", "proxyCred", "verbose", "isDba", "updateAll",
"privEsc", "forceDns", "getAll", "invalidBignum", "regexp", "getDbs",
"freshQueries", "uCols", "smokeTest", "wFile", "udfInject", "invalidString",
"tor", "forceSSL", "beep", "noEscape", "configFile", "scope",
"authFile", "torType" "SOCKS5", "regVal", "dummy", "checkInternet", "safePost",
"skipUrlEncode", "referer", "liveTest", "purgeOutput", "retries", "extensiveFp",
"dumpTable", "getColumns", "batch", "headers", "authCred", "osCmd",
"suffix", "dbmsCred", "regDel", "shLib", "sitemapUrl", "timeSec",
"msfPath", "dumpAll", "getHostname", "sessionFile", "disableColoring", "getTables",
"safeFreq", "agent", "webRoot", "lastChar", "string", "dbms",
"dumpWhere", "tamper", "ignoreRedirects" "hpp", "runCase", "delay",
"evalCode", "cleanup", "csrfUrl", "getBanner", "profile", "regRead",
"bulkFile", "db", "excludeCol", "dumpFormat", "alert", "harFile",
"Connection", "user", "parseErrors", "getCount", "dFile", "data",
"regAdd", "ignoreProxy", "mobile", "googleDork", "saveConfig", "sqlShell",
"tech", "textOnly", "cookieDel", "commonColumns", "keepAlive"
}

10
lib/errors.py Normal file
View file

@ -0,0 +1,10 @@
class InvalidProxyType(Exception): pass
class ApiConnectionError(Exception): pass
class ApplicationNotFound(Exception): pass
class SqlmapFailedStart(Exception): pass

274
lib/settings.py Normal file
View file

@ -0,0 +1,274 @@
import os
import re
import sys
import time
import glob
import logging
import random
import difflib
import itertools
import multiprocessing
import whichcraft
import lib.errors
import bin.unzip_gecko
# clone link
CLONE = "https://github.com/ekultek/zeus-scanner.git"
# current version
VERSION = "1.0"
# colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
# version string formatting
if VERSION.count(".") == 1:
VERSION_STRING = "\033[92mv{}\033[0m(\033[{}m\033[1mstable\033[0m)".format(VERSION, VERSION_TYPE_COLORS["stable"])
elif VERSION.count(".") <= 2:
VERSION_STRING = "\033[92mv{}\033[0m(\033[{}m\033[1mdev\033[0m)".format(VERSION, VERSION_TYPE_COLORS["dev"])
else:
VERSION_STRING = "\033[92mv{}\033[0m(\033[{}m\033[1mrevision\033[0m)".format(VERSION, VERSION_TYPE_COLORS["other"])
# our saying, because everyone loves Google
SAYING = "Advanced Dork Scan..."
# sexy banner
BANNER = """\033[36m
__ __________ __
/ / \____ /____ __ __ ______ \ \
/ / ______ / // __ \| | \/ ___/ ______ \ \
\ \ /_____/ / /\ ___/| | /\___ \ /_____/ / /
\_\ /_______ \___ >____//____ > /_/
\/ \/ \/ {}
\t{}\n\t\t{}{}\033[0m""".format(VERSION_STRING, CLONE, " " * 5, SAYING)
# default user agent if another one isn't given
DEFAULT_USER_AGENT = "Zeus-Scanner(v{})::Python->v{}.{}".format(
VERSION, sys.version_info[0], sys.version_info[1]
)
# regex to find GET params in a URL, IE php?id=
URL_QUERY_REGEX = re.compile(r"(.*)[?|#](.*){1}\=(.*)")
# regex to recognize a URL
URL_REGEX = re.compile(r"((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)")
# log path for the URL's that are found
URL_LOG_PATH = "{}/log/url-log".format(os.getcwd())
# log path for port scans
PORT_SCAN_LOG_PATH = "{}/log/scanner-log".format(os.getcwd())
# the current log file being used
CURRENT_LOG_FILE_PATH = "{}/log".format(os.getcwd())
# search engines that the application can use
AUTHORIZED_SEARCH_ENGINES = {
"aol": "http://aol.com",
"bing": "http://bing.com",
"duckduckgo": "http://duckduckgo.com",
"google": "http://google.com"
}
# this has to be the first function so that I can use it in the logger settings below
def create_log_name(log_path="{}/log", filename="zeus-log-{}.log"):
"""
create the current log file name by figuring out how many files are there
"""
if not os.path.exists(log_path.format(os.getcwd())):
os.mkdir(log_path.format(os.getcwd()))
find_file_amount = len(os.listdir(log_path.format(os.getcwd())))
full_log_path = "{}/{}".format(log_path.format(os.getcwd()), filename.format(find_file_amount + 1))
return full_log_path
# console logger and file logger settings
logger = logging.getLogger("zeus-log")
logger.setLevel(logging.DEBUG)
file_handler = logging.FileHandler(
filename=create_log_name(), mode="a+"
)
file_handler.setLevel(logging.DEBUG)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)
file_format = logging.Formatter(
'%(asctime)s;%(name)s;%(levelname)s;%(message)s'
)
console_format = logging.Formatter(
"[%(asctime)s %(levelname)s] %(message)s", "%H:%M:%S"
)
file_handler.setFormatter(file_format)
console_handler.setFormatter(console_format)
logger.addHandler(console_handler)
logger.addHandler(file_handler)
def create_dir(dirpath):
"""
create a directory if it doesn't exist
"""
if not os.path.exists(dirpath):
os.mkdir(dirpath)
def set_color(org_string, level=None):
"""
set the console log color, this will kinda mess with the file log but whatever
"""
color_levels = {
10: "\033[36m{}\033[0m", # DEBUG
20: "\033[32m{}\033[0m", # INFO *default
30: "\033[33m{}\033[0m", # WARNING
40: "\033[31m{}\033[0m", # ERROR
50: "\033[7;31;31m{}\033[0m" # FATAL/CRITICAL/EXCEPTION
}
if level is None:
return color_levels[20].format(org_string)
else:
return color_levels[int(level)].format(org_string)
def get_proxy_type(proxy_string):
"""
get the type of proxy that is being used or output possible proxy types you're trying to use
"""
acceptable = ("http", "https", "socks5", "socks4")
prox_list = proxy_string.split("://")
if prox_list[0] not in acceptable:
raise lib.errors.InvalidProxyType(
"{} is not a valid proxy type, you might be looking for "
"{}..".format(prox_list[0], difflib.get_close_matches(prox_list[0], acceptable))
)
else:
return prox_list[0], prox_list[-1]
def proxy_string_to_dict(proxy_string):
"""
send the proxy string to a dict -> http://127.0.0.1:8080 -> {'http': '127.0.0.1:8080'}
"""
proxy_data = get_proxy_type(proxy_string)
retval = {proxy_data[0]: proxy_data[1]}
return retval
def start_up():
"""
start the program and display the time it was started
"""
print(
"\n\n[*] starting up at {}..\n\n".format(time.strftime("%H:%M:%S"))
)
def shutdown():
"""
shut down the program and the time it stopped
"""
print(
"\n\n[*] shutting down at {}..\n\n".format(time.strftime("%H:%M:%S"))
)
exit(0)
def setup(verbose=False):
"""
setup the application if it has not been setup yet
"""
if verbose:
logger.debug(set_color(
"checking if the application has been run before...", level=10
))
bin.unzip_gecko.main(verbose=verbose)
def get_latest_log_file(log_path):
"""
get the latest log file being used from the given path
"""
file_list = glob.glob(log_path + "/*")
latest = max(file_list, key=os.path.getctime)
return latest
def replace_http(url):
"""
replace the http in the url so we can get the IP address
"""
def __remove_queries(data):
"""
delete the queries from the URL
"""
return data.split("/")[0]
url_list = url.split("//")
new_url = url_list[1]
return __remove_queries(new_url)
def grab_random_agent(agent_path="{}/etc/agents.txt", verbose=False):
"""
grab a random user agent from the agent file
"""
if verbose:
logger.debug(set_color(
"grabbing random user-agent from '{}'...".format(agent_path.format(os.getcwd())), level=10
))
with open(agent_path.format(os.getcwd())) as agents:
return random.choice(agents.readlines())
def prompt(question, opts=None):
"""
ask a question
"""
if opts is not None:
options = '/'.join(opts)
return raw_input(
"[{} {}] {}[{}]: ".format(
time.strftime("%H:%M:%S"),
"PROMPT", question, options
)
)
else:
return raw_input(
"[{} {}] {} ".format(
time.strftime("%H:%M:%S"), "PROMPT", question
)
)
def worker(filename, item):
"""
worker for multiprocessing
"""
if item in filename or filename == item or filename is item:
return filename
def find_application(to_find, default_search_path="/", proc_num=25, given_search_path=None, verbose=False):
"""
find an application on the users system if it is not in their PATH or not path is given
"""
retval = set()
if whichcraft.which(to_find) is None:
logger.error(set_color(
"{} not in your PATH, what kind of hacker are you?! "
"defaulting to root search, this can take awhile...".format(to_find), level=40
))
if verbose:
logger.debug(set_color(
"starting {} processes to search for '{}' starting at '{}'...".format(
proc_num, to_find, default_search_path if given_search_path is None else given_search_path
), level=10
))
pool = multiprocessing.Pool(proc_num)
walker = os.walk(default_search_path)
file_data_gen = itertools.chain.from_iterable(
(os.path.join(root, f) for f in files)
for root, sub, files in walker
)
results = pool.map(worker, file_data_gen)
for data in results:
if data is not None:
retval.add(data)
if len(retval) == 0:
raise lib.errors.ApplicationNotFound(
"unable to find '{}' on your system, install it first...".format(to_find)
)
else:
return list(retval)
else:
return whichcraft.which(to_find)

6
requirements.txt Normal file
View file

@ -0,0 +1,6 @@
selenium==3.5.0
requests==2.12.2
python-nmap==0.6.1
whichcraft==0.4.1
pyvirtualdisplay==0.2.1

0
var/__init__.py Normal file
View file

View file

191
var/google_search/search.py Normal file
View file

@ -0,0 +1,191 @@
import os
import time
import urllib
import requests
from selenium import webdriver
from pyvirtualdisplay import Display
from selenium.webdriver.common.keys import Keys
from lib.settings import (
logger,
set_color,
proxy_string_to_dict,
DEFAULT_USER_AGENT,
URL_QUERY_REGEX,
URL_REGEX,
shutdown,
create_dir,
)
def get_urls(query, url, verbose=False, warning=True, **kwargs):
"""
Bypass Google captchas and Google API by using selenium-webdriver to gather
the Google URL. This will open a robot controlled browser window and attempt
to get a URL from Google that will be used for scraping afterwards.
Only downside to this method is that your IP and user agent will be visible
until the application pulls the URL.
"""
if verbose:
logger.debug(set_color(
"setting up the virtual display to hide the browser...", level=10
))
ff_display = Display(visible=0, size=(800, 600))
ff_display.start()
logger.info(set_color(
"firefox browser display will be hidden while it performs the query..."
))
if warning:
logger.warning(set_color(
"your web browser will be automated in order for Zeus to successfully "
"bypass captchas and API calls. this is done in order to grab the URL "
"from the search and parse the results. in return this will allow the "
"search engine to see your current IP address and your current user "
"agent. after the URL has been returned; your proxy and user agent "
"configuration will be implemented (if applicable) before the parsing "
"and vulnerability checking occurs...", level=30
))
if verbose:
logger.debug(set_color(
"running selenium-webdriver and launching browser..", level=10
))
browser = webdriver.Firefox()
logger.info(set_color("browser will open shortly.."))
browser.get(url)
if verbose:
logger.debug(set_color(
"searching search engine for the 'q' element (search button)..", level=10
))
search = browser.find_element_by_name('q')
logger.info(set_color(
"searching '{}' using query '{}'...".format(url, query)
))
search.send_keys(query)
search.send_keys(Keys.RETURN) # hit return after you enter search text
time.sleep(3)
if verbose:
logger.debug(set_color(
"obtaining URL from selenium..."
))
retval = browser.current_url
if verbose:
logger.debug(set_color(
"found current URL from selenium browser '{}'...".format(retval), level=10
))
logger.info(set_color(
"closing the browser and continuing process.."
))
browser.close()
ff_display.stop()
return retval
def parse_search_results(
query, url, verbose=False, dirname="{}/log/url-log", filename="url-log-{}.log", **kwargs):
"""
Parse a webpage from Google for URL's with a GET(query) parameter
"""
exclude = "google" or "webcache" or "youtube"
create_dir(dirname.format(os.getcwd()))
full_file_path = "{}/{}".format(
dirname.format(os.getcwd()), filename.format(len(os.listdir(dirname.format(
os.getcwd()
))) + 1)
)
if verbose:
logger.debug(set_color(
"checking for user-agent and proxy configuration...", level=10
))
try:
proxy_string = kwargs.get("proxy")
except:
pass
try:
user_agent = kwargs.get("agent")
except:
pass
if proxy_string is None:
proxy_string = None
else:
proxy_string = proxy_string_to_dict(proxy_string)
if user_agent is None:
user_agent = DEFAULT_USER_AGENT
else:
user_agent = user_agent
user_agent_info = "adjusting user-agent header to {}..."
if user_agent is not DEFAULT_USER_AGENT:
user_agent_info = user_agent_info.format(user_agent.strip())
else:
user_agent_info = user_agent_info.format("default user agent '{}'".format(DEFAULT_USER_AGENT))
proxy_string_info = "using {}..."
if proxy_string is not None:
proxy_string_info = proxy_string_info.format(proxy_string)
else:
proxy_string_info = "no proxy configuration detected..."
headers = {
"Connection": "close",
"user-agent": user_agent
}
logger.info(set_color(
"attempting to gather query URL..."
))
try:
query_url = get_urls(query, url, verbose=verbose)
except Exception as e:
if "WebDriverException" in str(e):
logger.exception(set_color(
"it seems that you exited the browser, please allow the browser "
"to complete it's run so that Zeus can bypass captchas and API "
"calls", level=50
))
else:
logger.exception(set_color(
"{} failed to gather the URL from search engine, caught exception '{}' "
"exception has been logged to current log file...".format(
os.path.basename(__file__), str(e).strip()), level=50)
)
shutdown()
logger.info(set_color(
"URL successfully gathered, searching for GET parameters..."
))
logger.info(set_color(proxy_string_info))
req = requests.get(query_url, proxies=proxy_string)
logger.info(set_color(user_agent_info))
req.headers.update(headers)
found_urls = URL_REGEX.findall(req.text)
retval = set()
for urls in list(found_urls):
for url in list(urls):
url = urllib.unquote(url)
if URL_QUERY_REGEX.match(url) and exclude not in url:
if type(url) is unicode:
url = str(url).encode("utf-8")
if verbose:
logger.debug(set_color(
"found '{}'...".format(url), level=10
))
retval.add(url.split("&amp;")[0])
logger.info(set_color(
"found a total of {} URL's with a GET parameter...".format(len(retval))
))
if len(retval) != 0:
logger.info(set_color(
"saving found URL's under '{}'...".format(full_file_path)
))
with open(full_file_path, "a+") as log:
for url in list(retval):
log.write(url + "\n")
else:
logger.critical(set_color(
"did not find any usable URL's with the given query '{}' "
"using search engine '{}'...".format(query, url), level=50
))
return list(retval) if len(retval) != 0 else None

285
zeus.py Normal file
View file

@ -0,0 +1,285 @@
#!/usr/bin/env python
import time
import optparse
import subprocess
import httplib as http_client
from var.google_search import search
from lib.attacks.sqlmap_scan.sqlmap_opts import SQLMAP_API_OPTIONS
from lib.attacks import (
nmap_scan,
sqlmap_scan
)
from lib.settings import (
setup,
BANNER,
start_up,
shutdown,
logger,
set_color,
get_latest_log_file,
grab_random_agent,
CURRENT_LOG_FILE_PATH,
AUTHORIZED_SEARCH_ENGINES,
URL_LOG_PATH,
replace_http,
)
if __name__ == "__main__":
parser = optparse.OptionParser(usage="zeus.py -[d|l] [OPTIONS]")
# mandatory options
mandatory = optparse.OptionGroup(parser, "Mandatory Options",
"These options have to be used in order for Zeus to run")
mandatory.add_option("-d", "--dork", dest="dorkToUse", metavar="DORK",
help="Specify a singular Google dork to use for queries")
mandatory.add_option("-l", "--dork-list", dest="dorkFileToUse", metavar="FILE-PATH",
help="Specify a file full of dorks to run through"),
mandatory.add_option("--show", dest="showSqlmapArguments", action="store_true",
help="Show the arguments that the sqlmap API understands")
# attack options
attacks = optparse.OptionGroup(parser, "Attack arguments",
"These arguments will give you the choice on how you want to check the websites")
attacks.add_option("-s", "--sqli", dest="runSqliScan", action="store_true",
help="Run a Sqlmap SQLi scan on the discovered URL's")
attacks.add_option("-p", "--port-nmap_scan", dest="runPortScan", action="store_true",
help="Run a Nmap port scan on the discovered URL's")
# search engine options
engines = optparse.OptionGroup(parser, "Search engine arguments",
"Arguments to change the search engine used (default is Google)")
engines.add_option("-D", "--search-engine-ddg", dest="useDDG", action="store_true",
help="Use DuckDuckGo as the search engine")
engines.add_option("-B", "--search-engine-bing", dest="useBing", action="store_true",
help="Use Bing as the search engine")
engines.add_option("-A", "--search-engine-aol", dest="useAOL", action="store_true",
help="Use AOL as the search engine")
# miscellaneous options
misc = optparse.OptionGroup(parser, "Misc Options",
"These options affect how the program will run")
misc.add_option("--verbose", dest="runInVerbose", action="store_true",
help="Run the application in verbose mode (more output)")
misc.add_option("--proxy", dest="proxyConfig", metavar="PROXY-STRING",
help="Use a proxy to do the scraping, will not auto configure "
"to the API's")
misc.add_option("--random-agent", dest="useRandomAgent", action="store_true",
help="Use a random user-agent from the etc/agents.txt file")
misc.add_option("--agent", dest="usePersonalAgent", metavar="USER-AGENT",
help="Use your own personal user-agent")
misc.add_option("--show-requests", dest="showRequestInfo", action="store_true",
help="Show your request information (more verbose output) this "
"will also show all requests made to the API's used")
misc.add_option("--sqlmap-args", dest="sqlmapArguments", metavar="SQLMAP-ARGS",
help="Pass the arguments to send to the sqlmap API within quotes & "
"separated by a comma. IE 'dbms mysql, verbose 3, level 5'")
misc.add_option("--auto-start", dest="autoStartSqlmap", action="store_true",
help="Attempt to automatically find sqlmap on your system")
misc.add_option("--search-here", dest="givenSearchPath", metavar="PATH-TO-START",
help="Start searching for sqlmap in this given path")
parser.add_option_group(mandatory)
parser.add_option_group(attacks)
parser.add_option_group(engines)
parser.add_option_group(misc)
opt, _ = parser.parse_args()
# run the setup on the program
setup(verbose=opt.runInVerbose)
print(BANNER)
start_up()
if opt.showSqlmapArguments:
logger.info(set_color(
"there are a total of {} arguments understood by sqlmap API, "
"they include:".format(len(SQLMAP_API_OPTIONS))
))
print("\n")
for arg in SQLMAP_API_OPTIONS:
print(
"[*] {}".format(arg)
)
shutdown()
def __find_running_opts():
"""
display the running options if verbose is used
"""
opts_being_used = []
for o, v in opt.__dict__.items():
if v is not None:
opts_being_used.append((o, v))
return dict(opts_being_used)
if opt.runInVerbose:
being_run = __find_running_opts()
logger.debug(set_color(
"running with options '{}'...".format(being_run), level=10
))
logger.info(set_color(
"log file being saved to '{}'...".format(get_latest_log_file(CURRENT_LOG_FILE_PATH))
))
if opt.showRequestInfo:
logger.debug(set_color(
"showing all HTTP requests because --show-requests flag was used...", level=10
))
http_client.HTTPConnection.debuglevel = 1
def __config_headers():
"""
configure the request headers, this will configure user agents and proxies
"""
if opt.proxyConfig is not None:
proxy = opt.proxyConfig
else:
proxy = None
if opt.usePersonalAgent is not None:
agent = opt.usePersonalAgent
elif opt.useRandomAgent:
agent = grab_random_agent(verbose=opt.runInVerbose)
else:
agent = None
return proxy, agent
def __config_search_engine(verbose=False):
"""
configure the search engine if a one different from google is given
"""
non_default_msg = "specified to use non-default search engine..."
if opt.useDDG:
if verbose:
logger.debug(set_color(
"using DuckDuckGo as the search engine...", level=10
))
logger.info(set_color(
non_default_msg
))
se = AUTHORIZED_SEARCH_ENGINES["duckduckgo"]
elif opt.useAOL:
if verbose:
logger.debug(set_color(
"using AOL as the search engine...", level=10
))
logger.info(set_color(
non_default_msg
))
se = AUTHORIZED_SEARCH_ENGINES["aol"]
else:
if verbose:
logger.debug(set_color(
"using default search engine (Google)...", level=10
))
logger.info(set_color(
"using default search engine..."
))
se = AUTHORIZED_SEARCH_ENGINES["google"]
return se
def __create_sqlmap_arguments():
"""
create the sqlmap arguments (a list of tuples) that will be passed to the API
"""
retval = []
if opt.sqlmapArguments is not None:
for line in opt.sqlmapArguments.split(","):
to_use = line.strip().split(" ")
option = (to_use[0], to_use[1])
if to_use[0] in SQLMAP_API_OPTIONS:
retval.append(option)
else:
logger.warning(set_color(
"option '{}' is not recognized by sqlmap API, skipping...".format(option[0]),
level=30
))
return retval
proxy_to_use, agent_to_use = __config_headers()
search_engine = __config_search_engine(verbose=opt.runInVerbose)
try:
if opt.dorkToUse is not None:
logger.info(set_color(
"starting dork scan with query '{}'...".format(opt.dorkToUse)
))
try:
search.parse_search_results(
opt.dorkToUse, search_engine, verbose=opt.runInVerbose, proxy=proxy_to_use,
agent=agent_to_use
)
except Exception as e:
logger.exception(set_color(
"ran into exception '{}'...".format(e), level=50
))
pass
urls_to_use = get_latest_log_file(URL_LOG_PATH)
with open(urls_to_use) as urls:
for url in urls.readlines():
if opt.runSqliScan:
sqlmap_scan.sqlmap_scan_main(url.strip(), verbose=opt.runInVerbose,
opts=__create_sqlmap_arguments(),
auto_search=opt.autoStartSqlmap,
given_path=opt.givenSearchPath)
elif opt.runPortScan:
url_to_use = replace_http(url.strip())
nmap_scan.perform_port_scan(url_to_use, verbose=opt.runInVerbose)
elif opt.dorkFileToUse is not None:
with open(opt.dorkFileToUse) as dorks:
for dork in dorks.readlines():
dork = dork.strip()
logger.info(set_color(
"starting dork scan with query '{}'...".format(dork)
))
try:
search.parse_search_results(
dork, search_engine, verbose=opt.runInVerbose, proxy=proxy_to_use,
agent=agent_to_use
)
except Exception as e:
logger.exception(set_color(
"ran into exception '{}'...".format(e), level=50
))
pass
urls_to_use = get_latest_log_file(URL_LOG_PATH)
with open(urls_to_use) as urls:
for url in urls.readlines():
if opt.runSqliScan:
sqlmap_scan.sqlmap_scan_main(url.strip(), verbose=opt.runInVerbose,
opts=__create_sqlmap_arguments(),
auto_search=opt.autoStartSqlmap,
given_path=opt.givenSearchPath)
elif opt.runPortScan:
url_to_use = replace_http(url.strip())
nmap_scan.perform_port_scan(url_to_use, verbose=opt.runInVerbose)
else:
logger.critical(set_color(
"failed to provide a mandatory argument, you will be redirected to the help menu...", level=50
))
time.sleep(2)
subprocess.call("python zeus.py --help", shell=True)
except KeyboardInterrupt:
logger.error(set_color(
"user aborted process...", level=40
))
except UnboundLocalError:
logger.warning(set_color(
"do not interrupt the browser when selenium is running, "
"it will cause Zeus to crash...", level=30
))
except Exception as e:
logger.exception(set_color(
"ran into exception '{}' exception has been saved to log file...".format(e)
))
shutdown()