Skip to content

Commit 71e05c5

Browse files
authored
Merge pull request #1162 from NullArray/dev-beta
Version 3.1.5
2 parents 5f5954a + 5d9446a commit 71e05c5

File tree

19 files changed

+576
-77
lines changed

19 files changed

+576
-77
lines changed

api_calls/honeyscore_hook.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import requests
2-
from bs4 import BeautifulSoup
32

43

54
class HoneyHook(object):

autosploit/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
EXPLOIT_FILES_PATH,
2525
START_SERVICES_PATH,
2626
save_error_to_file,
27+
stop_animation
2728
)
2829
from lib.jsonize import (
2930
load_exploits,
@@ -115,6 +116,10 @@ def main():
115116
terminal = AutoSploitTerminal(loaded_tokens, loaded_exploits)
116117
terminal.terminal_main_display(loaded_tokens)
117118
except Exception as e:
119+
global stop_animation
120+
121+
stop_animation = True
122+
118123
import traceback
119124

120125
print(
@@ -128,4 +133,3 @@ def main():
128133
error_class = str(e.__class__).split(" ")[1].split(".")[1].strip(">").strip("'")
129134
error_file = save_error_to_file(str(error_traceback), str(e), error_class)
130135
request_issue_creation(error_file, hide_sensitive(), str(e))
131-

dryrun_autosploit.sh renamed to drysploit.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/usr/bin/env bash
22

3+
#
4+
# this script dryruns autosploit. That's it, nothing special just a dry run
5+
#
6+
37

48
if [[ $# -lt 1 ]]; then
59
echo "Syntax:"
6-
echo -e "\t./dryrun_autosploit.sh <search_query> [whitelist]"
10+
echo -e "\t./drysploit.sh <search_query> [whitelist]"
711
exit 1
812
fi
913

10-
echo -e "[!] Make sure you are not on your localhost while running this script, press enter to continue";
11-
read
12-
1314
WHITELIST=$2
1415
SEARCH_QUERY=$1
1516
LPORT=4444

etc/json/default_fuzzers.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"exploits": [
3-
"auxiliary/fuzzers/dns/dns_fuzzer",
43
"auxiliary/fuzzers/ftp/client_ftp",
54
"auxiliary/fuzzers/ftp/ftp_pre_post",
65
"auxiliary/fuzzers/http/http_form_field",

etc/text_files/ethics.lst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
"My fear is that this has magnified the attack surface, and made it so that every exposed service on the internet will be scanned and probed on a near-constant basis by an entirely new set of attackers."
1212
"The release of tools like these exponentially expands the threat landscape by allowing a wider group of hackers to launch global attacks at will"
1313
"Good to know we’ve weaponized for the masses. Everyone can now be a script kiddie simply by plugging, playing and attacking."
14-
"The fact that something is really easy, does not make unauthorized computer access any less a crime. And tools like this leave a forensic footprint that is miles wide. Yes, you can compromise poorly protected systems very easily with this tool, but you can also end up in a lot of trouble."
14+
"The fact that something is really easy, does not make unauthorized computer access any less a crime. And tools like this leave a forensic footprint that is miles wide. Yes, you can compromise poorly protected systems very easily with this tool, but you can also end up in a lot of trouble."
15+
"I can't believe it's not skidware!"

etc/text_files/nmap_options.lst

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
-iL
2+
-iR
3+
--exclude
4+
--excludefile
5+
-sL
6+
-sn
7+
-Pn
8+
-PS
9+
-PA
10+
-PU
11+
-PY
12+
-PE
13+
-PP
14+
-PM
15+
-PO
16+
-n
17+
-R
18+
--dns-servers
19+
--system-dns
20+
--traceroute
21+
-sS
22+
-sT
23+
-sA
24+
-sW
25+
-sM
26+
-sU
27+
-sN
28+
-sF
29+
-sX
30+
--scanflags
31+
-sI
32+
-sY
33+
-sZ
34+
-sO
35+
-b
36+
-p
37+
--exclude-ports
38+
-F
39+
-r
40+
--top-ports
41+
--port-ratio
42+
-sV
43+
--version-intensity
44+
--version-light
45+
--version-all
46+
--version-trace
47+
-sC
48+
--script
49+
--script-args
50+
--script-args-file
51+
--script-trace
52+
--script-updatedb
53+
--script-help
54+
-O
55+
--osscan-limit
56+
--osscan-guess
57+
-T
58+
--min-hostgroup
59+
--max-hostgroup
60+
--min-parallelism
61+
--max-parallelism
62+
--min-rtt-timeout
63+
--max-rtt-timeout
64+
--initial-rtt-timeout
65+
--max-retries
66+
--host-timeout
67+
--scan-delay
68+
--max-scan-delay
69+
--min-rate
70+
--max-rate
71+
-f
72+
--mtu
73+
-D
74+
-S
75+
-e
76+
-g
77+
--source-port
78+
--proxies
79+
--data
80+
--data-string
81+
--data-length
82+
--ip-options
83+
--ttl
84+
--spoof-mac
85+
--badsum
86+
-oN
87+
-oX
88+
-oS
89+
-oG
90+
-oA
91+
-v
92+
-d
93+
--reason
94+
--open
95+
--packet-trace
96+
--iflist
97+
--append-output
98+
--resume
99+
--stylesheet
100+
--webxml
101+
--no-stylesheet
102+
-6
103+
-A
104+
--datadir
105+
--send-eth/--send-ip
106+
--privileged
107+
--unprivileged
108+
-V

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function install () {
8888
installOSX;
8989
;;
9090
*)
91-
echo "Unable to detect operating system that is compatible with AutoSploit...";
91+
echo "Unable to detect an operating system that is compatible with AutoSploit...";
9292
;;
9393
esac
9494
echo "";

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 = "3.1.2"
4+
VERSION = "3.1.5"
55

66

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

lib/cmdline/cmd.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ def optparser():
2525
"""
2626

2727
parser = argparse.ArgumentParser(
28-
usage="python autosploit.py -[c|z|s|a] -[q] QUERY\n"
29-
"{spacer}[-C] WORKSPACE LHOST LPORT [-e] [--whitewash] PATH\n"
30-
"{spacer}[--ruby-exec] [--msf-path] PATH [-E] EXPLOIT-FILE-PATH\n"
31-
"{spacer}[--rand-agent] [--proxy] PROTO://IP:PORT [-P] AGENT".format(
28+
usage="python autosploit.py -c[z|s|a] -q QUERY [-O|A]\n"
29+
"{spacer}[-C WORKSPACE LHOST LPORT] [-e] [--whitewash PATH] [-H]\n"
30+
"{spacer}[--ruby-exec] [--msf-path] PATH [-E EXPLOIT-FILE-PATH]\n"
31+
"{spacer}[--rand-agent] [--proxy PROTO://IP:PORT] [-P AGENT] [-D QUERY,QUERY,..]".format(
3232
spacer=" " * 28
3333
)
3434
)
@@ -42,8 +42,10 @@ def optparser():
4242
se.add_argument("-a", "--all", action="store_true", dest="searchAll",
4343
help="search all available search engines to gather hosts")
4444
save_results_args = se.add_mutually_exclusive_group(required=False)
45-
save_results_args.add_argument("-O", "--overwrite", action="store_true", dest="overwriteHosts",
46-
help="When specified, start from scratch by overwriting the host file with new search results.")
45+
save_results_args.add_argument(
46+
"-O", "--overwrite", action="store_true", dest="overwriteHosts",
47+
help="When specified, start from scratch by overwriting the host file with new search results."
48+
)
4749
save_results_args.add_argument("-A", "--append", action="store_true", dest="appendHosts",
4850
help="When specified, append discovered hosts to the host file.")
4951

@@ -65,7 +67,7 @@ def optparser():
6567
exploit.add_argument("-e", "--exploit", action="store_true", dest="startExploit",
6668
help="start exploiting the already gathered hosts")
6769
exploit.add_argument("-d", "--dry-run", action="store_true", dest="dryRun",
68-
help="Do not launch metasploit's exploits. Do everything else. msfconsole is never called.")
70+
help="msfconsole will never be called when this flag is passed")
6971
exploit.add_argument("-f", "--exploit-file-to-use", metavar="PATH", dest="exploitFile",
7072
help="Run AutoSploit with provided exploit JSON file.")
7173
exploit.add_argument("-H", "--is-honeypot", type=float, default=1000, dest="checkIfHoneypot", metavar="HONEY-SCORE",
@@ -79,7 +81,7 @@ def optparser():
7981
misc.add_argument("--ethics", action="store_true", dest="displayEthics",
8082
help=argparse.SUPPRESS) # easter egg!
8183
misc.add_argument("--whitelist", metavar="PATH", dest="whitelist",
82-
help="only exploit hosts listed in the whitelist file")
84+
help="only exploit hosts listed in the whitelist file")
8385
misc.add_argument("-D", "--download", nargs="+", metavar="SEARCH1 SEARCH2 ...", dest="downloadModules",
8486
help="download new exploit modules with a provided search flag")
8587
opts = parser.parse_args()

lib/creation/ip_generator.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import socket
2+
import itertools
3+
4+
from multiprocessing import Pool
5+
6+
7+
def generate_ip_range(selected_range):
8+
"""
9+
generate an IP address range from each provided node.
10+
for example `10.0.1-10.1-10` will return a generator
11+
object that has IP `10.0.1.1 - 10.0.10.10` in it
12+
"""
13+
octets = selected_range.split(".")
14+
chunks = [map(int, octet.split("-")) for octet in octets]
15+
ranges = [range(c[0], c[1] + 1) if len(c) == 2 else c for c in chunks]
16+
for address in itertools.product(*ranges):
17+
yield ".".join(map(str, address))
18+
19+
20+
def check_ip_alive(ip):
21+
"""
22+
efficiently check if an IP address is alive or not
23+
by using the socket.gethostbyaddr function
24+
"""
25+
def is_valid_ip(ip):
26+
try:
27+
socket.inet_aton(ip)
28+
return True
29+
except:
30+
return False
31+
32+
try:
33+
if not is_valid_ip(ip):
34+
return False
35+
else:
36+
return socket.gethostbyaddr(ip)
37+
except socket.herror:
38+
return False
39+
40+
41+
def check_ip_wrapper(generated_ips, limit=250):
42+
"""
43+
multiprocess the check_ip_alive function in order
44+
to proces a large amount of IP addresses quickly
45+
"""
46+
alive_ips = []
47+
ips_to_use = []
48+
i = 0
49+
proc_pool = Pool(processes=35)
50+
51+
for ip in generated_ips:
52+
ips_to_use.append(ip)
53+
i += 1
54+
if i == limit:
55+
break
56+
for ip in ips_to_use:
57+
try:
58+
result = proc_pool.apply_async(check_ip_alive, args=(ip,)).get()
59+
if not result:
60+
pass
61+
else:
62+
alive_ips.append(ip)
63+
except Exception:
64+
pass
65+
proc_pool.close()
66+
return alive_ips

0 commit comments

Comments
 (0)