Skip to content

Commit 86e6b1d

Browse files
authored
Merge pull request #203 from NullArray/dev-beta
Version 2.2.3
2 parents c7c815c + 41017bb commit 86e6b1d

File tree

9 files changed

+326
-59
lines changed

9 files changed

+326
-59
lines changed

.github/.translations/README-de.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# AutoSploit
2+
3+
Wie der Name vielleicht sagt, versucht Autosploit automatisiert Remote Hosts zu nutzen. Ziele können automatisch über Shodan, Censys oder Zoomeye gesammelt werden. Es wurden aber außerdem Optionen hinzugefügt, welche es erlauben, eigene Ziele oder Host-Listen hinzuzufügen. Die verfügbaren Metasploit-Module wurden ausgewählt, um die Ausführung von Remote-Code zu erleichtern und um zu versuchen, Reverse TCP Shells und/oder Meterpreter-Sessions zu erhalten.
4+
5+
**Sicherheitserwägung für den Betrieb**
6+
7+
Das Empfangen von Verbindungen über deine lokale Maschine ist vielleicht nicht die beste Idee für einen OPSEC-Standpunkt. Ziehe es stattdessen in Betracht, dieses Tool auf einem VPS auszuführen, welches alle benötigten Abhängigkeiten installiert hat.
8+
9+
Die neue Version von AutoSploit verfügt über ein Feature, welches dir erlaubt, eine Proxy zu setzen, bevor du dich verbindest, und einen benutzerdefinierten User-Agent zu verwenden.
10+
11+
# Hilfreiche Links
12+
13+
- [Nutzung](https://github.com/NullArray/AutoSploit#usage)
14+
- [Installation](https://github.com/NullArray/AutoSploit#Installation)
15+
- [Abhängigkeiten](https://github.com/NullArray/AutoSploit#dependencies)
16+
- [Benutzerhandbuch](https://github.com/NullArray/AutoSploit/wiki)
17+
- [Nutzungsmöglichkeiten](https://github.com/NullArray/AutoSploit/wiki/Usage#usage-options)
18+
- [Screenshots](https://github.com/NullArray/AutoSploit/wiki/Examples-and-images)
19+
- [Bugs/Ideen melden](https://github.com/NullArray/AutoSploit/wiki/Bugs-and-ideas#bugs)
20+
- [Entwicklungsleitfäden](https://github.com/NullArray/AutoSploit/wiki/Development-information#development-of-autosploit)
21+
- [Shoutouts](https://github.com/NullArray/AutoSploit#acknowledgements)
22+
- [Entwicklung](https://github.com/NullArray/AutoSploit#active-development)
23+
- [Discord-Server](https://discord.gg/9BeeZQk)
24+
- [README-Übersetzungen](https://github.com/NullArray/AutoSploit#translations)
25+
26+
# Installation
27+
28+
AutoSploit zu installieren ist sehr einfach. Du kannst den neuesten, Release [hier](https://github.com/NullArray/AutoSploit/releases/tag/2.0) finden. Du kannst außerdem den Master-Branch als [zip](https://github.com/NullArray/AutSploit/zipball/master), als [tarball](https://github.com/NullArray/AutSploit/tarball/master) oder mit einer der folgenden Methoden herunterladen.
29+
30+
###### Cloning
31+
32+
```bash
33+
sudo -s << EOF
34+
git clone https://github.com/NullArray/Autosploit.git
35+
cd AutoSploit
36+
chmod +x install.sh
37+
./install.sh
38+
python2 autosploit.py
39+
EOF
40+
```
41+
42+
###### Docker
43+
44+
```bash
45+
sudo -s << EOF
46+
git clone https://github.com/NullArray/AutoSploit.git
47+
cd AutoSploit
48+
chmod +x install.sh
49+
./installsh
50+
cd AutoSploit/Docker
51+
docker network create -d bridge haknet
52+
docker run --network haknet --name msfdb -e POSTGRES_PASSWORD=s3cr3t -d postgres
53+
docker build -t autosploit .
54+
docker run -it --network haknet -p 80:80 -p 443:443 -p 4444:4444 autosploit
55+
EOF
56+
```
57+
58+
Auf jedem Linux-System sollte folgendes funktionierern;
59+
60+
```bash
61+
git clone https://github.com/NullArray/AutoSploit
62+
cd AutoSploit
63+
chmod +x install.sh
64+
./install.sh
65+
```
66+
67+
Falls du AutoSploit auf einem System mit macOS ausführen willst, musst du das Programm trotz der Kompatibilität mit macOS in einer virtuellen Maschine ausführen, sodass es erfolgreich ausgeführt werden kann. Um dies zu tun, sind folgende Schritte nötig;
68+
69+
```bash
70+
sudo -s << '_EOF'
71+
pip2 install virtualenv --user
72+
git clone https://github.com/NullArray/AutoSploit.git
73+
virtualenv <PFAD-ZU-DEINER-ENV>
74+
source <PFAD-ZU-DEINER-ENV>/bin/activate
75+
cd <PFAD-ZU-AUTOSPLOIT>
76+
pip2 install -r requirements.txt
77+
chmod +x install.sh
78+
./install.sh
79+
python autosploit.py
80+
_EOF
81+
```
82+
83+
84+
Mehr Informationen über die Nutzung von Docker können [hier](https://github.com/NullArray/AutoSploit/tree/master/Docker) gefunden werden.
85+
86+
## Nutzung
87+
88+
Das Programm mit `python autosploit.py` auszuführen, wird eine AutoSploit Terminal Session öffnen. Die Optionen für diese sind im Folgenden aufgelistet.
89+
```
90+
1. Usage And Legal
91+
2. Gather Hosts
92+
3. Custom Hosts
93+
4. Add Single Host
94+
5. View Gathered Hosts
95+
6. Exploit Gathered Hosts
96+
99. Quit
97+
```
98+
99+
Beim Auswählen der Option `2` wirst du aufgefordert, eine Plattform-spezifischen Suchanfrage einzugeben. Gib zum Beispiel `IIS` oder `Apache` ein und wähle eine Suchmaschine aus. Danach werden die gesammelten Hosts gespeichert, um sie in der `Exploit` Komponente nutzen zu können.
100+
101+
Seit Version 2.0 von AutoSploit, kann dieses ebenfalls mit einer Anzahl von Command Line Argumenten/Flags gestartet werden. Gib `python autosploit.py -h` ein, um alle für dich verfügbaren Optionen anzuzeigen. Zur Referenz sind die Optionen nachfolgend ebenfalls aufgelistet *(auf Englisch)*.
102+
103+
```
104+
usage: python autosploit.py -[c|z|s|a] -[q] QUERY
105+
[-C] WORKSPACE LHOST LPORT [-e] [--whitewash] PATH
106+
[--ruby-exec] [--msf-path] PATH [-E] EXPLOIT-FILE-PATH
107+
[--rand-agent] [--proxy] PROTO://IP:PORT [-P] AGENT
108+
109+
optional arguments:
110+
-h, --help show this help message and exit
111+
112+
search engines:
113+
possible search engines to use
114+
115+
-c, --censys use censys.io as the search engine to gather hosts
116+
-z, --zoomeye use zoomeye.org as the search engine to gather hosts
117+
-s, --shodan use shodan.io as the search engine to gather hosts
118+
-a, --all search all available search engines to gather hosts
119+
120+
requests:
121+
arguments to edit your requests
122+
123+
--proxy PROTO://IP:PORT
124+
run behind a proxy while performing the searches
125+
--random-agent use a random HTTP User-Agent header
126+
-P USER-AGENT, --personal-agent USER-AGENT
127+
pass a personal User-Agent to use for HTTP requests
128+
-q QUERY, --query QUERY
129+
pass your search query
130+
131+
exploits:
132+
arguments to edit your exploits
133+
134+
-E PATH, --exploit-file PATH
135+
provide a text file to convert into JSON and save for
136+
later use
137+
-C WORKSPACE LHOST LPORT, --config WORKSPACE LHOST LPORT
138+
set the configuration for MSF (IE -C default 127.0.0.1
139+
8080)
140+
-e, --exploit start exploiting the already gathered hosts
141+
142+
misc arguments:
143+
arguments that don't fit anywhere else
144+
145+
--ruby-exec if you need to run the Ruby executable with MSF use
146+
this
147+
--msf-path MSF-PATH pass the path to your framework if it is not in your
148+
ENV PATH
149+
--whitelist PATH only exploit hosts listed in the whitelist file
150+
```
151+
152+
Falls du AutoSploit auf einem System mit macOS ausführen willst, musst du das Programm trotz der Kompatibilität mit macOS in einer virtuellen Maschine ausführen, sodass es erfolgreich ausgeführt werden kann. Um dies zu tun, sind folgende Schritte nötig;
153+
154+
```bash
155+
sudo -s << '_EOF'
156+
pip2 install virtualenv --user
157+
git clone https://github.com/NullArray/AutoSploit.git
158+
virtualenv <PFAD-ZU-DEINER-ENV>
159+
source <PFAD-ZU-DEINER-ENV>/bin/activate
160+
cd <PFAD-ZU-AUTOSPLOIT>
161+
pip2 install -r requirements.txt
162+
chmod +x install.sh
163+
./install.sh
164+
python autosploit.py
165+
_EOF
166+
```
167+
168+
## Abhängigkeiten
169+
_Bitte beachte_: Alle Abhängigkeiten sollten über die obige Installationsmethode installiert werden. Für den Fall, dass die Installation nicht möglich ist:
170+
171+
AutoSploit benötigt die folgenden Python 2.7 Module:
172+
173+
```
174+
requests
175+
psutil
176+
```
177+
178+
Wenn dir auffällt, dass du diese nicht installiert hast, kannst du sie über Pip installieren, wie nachfolgend gezeigt.
179+
180+
```bash
181+
pip install requests psutil
182+
```
183+
184+
oder
185+
186+
```bash
187+
pip install -r requirements.txt
188+
```
189+
190+
Da das Programm Funktionalität des Metasploit-Frameworkes nutzt, musst du dieses ebenfalls installiert haben. Hole es dir über Rapid7, indem du [hier](https://www.rapid7.com/products/metasploit/) klickst.
191+
192+
## Danksagung
193+
194+
Ein besonderer Dank gilt [Ekultek](https://github.com/Ekultek) ohne dessen Beiträge die Version 2.0 dieses Projekts wohl weitaus weniger spektakulär wäre.
195+
196+
Ebenfalls danke an [Khast3x](https://github.com/khast3x) für das Einrichten der Docker-Unterstützung.
197+
198+
### Aktive Entwicklung
199+
200+
Falls du gerne zur Entwicklung dieses Projekts beitragen möchtest, bitte lies zuerst [CONTRIBUTING.md](https://github.com/NullArray/AutoSploit/blob/master/CONTRIBUTING.md), da diese unsere Leitfäden für Contributions enthält.
201+
202+
Bitte lies außerdem [die Contribution-Standards](https://github.com/NullArray/AutoSploit/wiki/Development-information#contribution-standards), bevor du eine Pull Request erstellst.
203+
204+
Falls du Hilfe damit brauchst, den Code zu verstehen, oder einfach mit anderen Mitgliedern der AutoSploit-Community chatten möchtest, kannst du gerne unserem [Discord-Server](https://discord.gg/9BeeZQk) joinen.
205+
206+
### Anmerkung
207+
208+
Falls du einem Bug begegnest, bitte fühle dich frei, [ein Ticket zu öffnen](https://github.com/NullArray/AutoSploit/issues).
209+
210+
Danke im Voraus.
211+
212+
## Übersetzungen
213+
214+
- [FR](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-fr.md)
215+
- [ZH](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-zh.md)
216+
- [DE](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-de.md)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,4 @@ Thanks in advance.
213213

214214
- [FR](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-fr.md)
215215
- [ZH](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-zh.md)
216+
- [DE](https://github.com/NullArray/AutoSploit/blob/master/.github/.translations/README-de.md)

autosploit/main.py

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,47 @@ def main():
5353
misc_info("checking for disabled services")
5454
# according to ps aux, postgre and apache2 are the names of the services on Linux systems
5555
service_names = ("postgres", "apache2")
56-
if "darwin" in platform_running.lower():
57-
service_names = ("postgres", "apachectl")
58-
59-
for service in list(service_names):
60-
while not check_services(service):
61-
choice = prompt(
62-
"it appears that service {} is not enabled, would you like us to enable it for you[y/N]".format(
63-
service.title()
64-
)
65-
)
66-
if choice.lower().startswith("y"):
67-
try:
68-
if "darwin" in platform_running.lower():
69-
cmdline("{} darwin".format(START_SERVICES_PATH))
70-
elif "linux" in platform_running.lower():
71-
cmdline("{} linux".format(START_SERVICES_PATH))
72-
else:
73-
close("your platform is not supported by AutoSploit at this time", status=2)
74-
75-
# moving this back because it was funky to see it each run
76-
info("services started successfully")
77-
# this tends to show up when trying to start the services
78-
# I'm not entirely sure why, but this fixes it
79-
except psutil.NoSuchProcess:
80-
pass
81-
else:
82-
process_start_command = "`sudo service {} start`"
56+
try:
57+
for service in list(service_names):
58+
while not check_services(service):
8359
if "darwin" in platform_running.lower():
84-
process_start_command = "`brew services start {}`"
85-
close(
86-
"service {} is required to be started for autosploit to run successfully (you can do it manually "
87-
"by using the command {}), exiting".format(
88-
service.title(), process_start_command.format(service)
60+
info(
61+
"seems you're on macOS, skipping service checks "
62+
"(make sure that Apache2 and PostgreSQL are running)"
63+
)
64+
break
65+
choice = prompt(
66+
"it appears that service {} is not enabled, would you like us to enable it for you[y/N]".format(
67+
service.title()
8968
)
9069
)
70+
if choice.lower().startswith("y"):
71+
try:
72+
if "darwin" in platform_running.lower():
73+
cmdline("{} darwin".format(START_SERVICES_PATH))
74+
elif "linux" in platform_running.lower():
75+
cmdline("{} linux".format(START_SERVICES_PATH))
76+
else:
77+
close("your platform is not supported by AutoSploit at this time", status=2)
78+
79+
# moving this back because it was funky to see it each run
80+
info("services started successfully")
81+
# this tends to show up when trying to start the services
82+
# I'm not entirely sure why, but this fixes it
83+
except psutil.NoSuchProcess:
84+
pass
85+
else:
86+
process_start_command = "`sudo service {} start`"
87+
if "darwin" in platform_running.lower():
88+
process_start_command = "`brew services start {}`"
89+
close(
90+
"service {} is required to be started for autosploit to run successfully (you can do it manually "
91+
"by using the command {}), exiting".format(
92+
service.title(), process_start_command.format(service)
93+
)
94+
)
95+
except Exception:
96+
pass
9197

9298
if len(sys.argv) > 1:
9399
info("attempting to load API keys")
@@ -107,7 +113,7 @@ def main():
107113
else:
108114
warning(
109115
"no arguments have been parsed, defaulting to terminal session. "
110-
"press 99 to quit and help to get help"
116+
"press 99 to quit and type `help` to view the help menus"
111117
)
112118
misc_info("checking if there are multiple exploit files")
113119
loaded_exploits = load_exploits(EXPLOIT_FILES_PATH)
@@ -121,11 +127,12 @@ def main():
121127
print(
122128
"\033[31m[!] AutoSploit has hit an unhandled exception: '{}', "
123129
"in order for the developers to troubleshoot and repair the "
124-
"issue AutoSploit will need to gather your OS information, metasploit version, "
130+
"issue AutoSploit will need to gather your OS information, "
125131
"current arguments, the error message, and a traceback. "
126132
"None of this information can be used to identify you in any way\033[0m".format(str(e))
127133
)
128134
error_traceback = ''.join(traceback.format_tb(sys.exc_info()[2]))
129-
error_file = save_error_to_file(str(error_traceback))
135+
error_class = str(e.__class__).split(" ")[1].split(".")[1].strip(">").strip("'")
136+
error_file = save_error_to_file(str(error_traceback), str(e), error_class)
130137
request_issue_creation(error_file, hide_sensitive(), str(e))
131138

lib/banner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import random
33

4-
VERSION = "2.2.1"
4+
VERSION = "2.2.3"
55

66

77
def banner_1(line_sep="#--", space=" " * 30):

lib/creation/issue_creator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,6 @@ def request_issue_creation(path, arguments, error_message):
164164
else:
165165
lib.output.error(
166166
"someone has already created this issue here: {}".format(find_url(identifier))
167-
)
167+
)
168+
else:
169+
lib.output.info("the issue has been logged to a file in path: '{}'".format(path))

lib/exploitation/exploiter.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@ def whitelist_wash(hosts, whitelist_file):
1616
"""
1717
remove IPs from hosts list that do not appear in WHITELIST_FILE
1818
"""
19-
whitelist_hosts = [x.strip() for x in open(whitelist_file).readlines() if x.strip()]
20-
lib.output.info('Found {} entries in whitelist.txt, scrubbing'.format(str(len(whitelist_hosts))))
21-
washed_hosts = []
22-
# return supplied hosts if whitelist file is empty
23-
if len(whitelist_hosts) == 0:
24-
return hosts
25-
else:
26-
for host in hosts:
27-
if host.strip() in whitelist_hosts:
28-
washed_hosts.append(host)
19+
try:
20+
whitelist_hosts = [x.strip() for x in open(whitelist_file).readlines() if x.strip()]
21+
lib.output.info('Found {} entries in whitelist.txt, scrubbing'.format(str(len(whitelist_hosts))))
22+
washed_hosts = []
23+
# return supplied hosts if whitelist file is empty
24+
if len(whitelist_hosts) == 0:
25+
return hosts
26+
else:
27+
for host in hosts:
28+
if host.strip() in whitelist_hosts:
29+
washed_hosts.append(host)
2930

30-
return washed_hosts
31+
return washed_hosts
32+
except Exception:
33+
lib.output.warning("unable to whitewash host list, does the file exist?")
34+
return hosts
3135

3236

3337
class AutoSploitExploiter(object):
@@ -112,8 +116,6 @@ def start_exploit(self, sep="*" * 10):
112116
use_ruby = "ruby" if self.ruby_exec else ""
113117
msf_path = self.msf_path if self.msf_path is not None else "msfconsole"
114118

115-
116-
117119
# What's the point of having a workspace if you overwrite it every fucking time..
118120
rc_script_template = (
119121
"workspace -a {workspace}\n"

0 commit comments

Comments
 (0)