use ./msfconsole -r resourcefile.rc
and in your resource file you put in your metasploit commands
Hi to all, i'm creating a simple script to automate the launch of msfconsole and a session of db_autopwn but when it execute ./msfconsole the scipt stops with msf> promt... what can i do to send commands to msf> ?
Code:#!/bin/sh /bin/su - postgres -c "pg_ctl -D ~/metasploitdb start" sleep 3 cd /pentest/exploits/framework3 ./msfconsole db_connect postgres@127.0.0.1/postgres db_nmap ....... ............... ...
use ./msfconsole -r resourcefile.rc
and in your resource file you put in your metasploit commands
./msfconsole -r /usr/share/autoexploit/autopwnrc.rc
Thnaks!!
Other problem: in the script i ask to insert target's ip:
but in autopwnrc.rc when i set db_nmap $IP cant be read, is there any other command or way to do this?Code:/bin/su - postgres -c "pg_ctl -D ~/metasploitdb start" sleep 3 cd /pentest/exploits/framework3 echo -n "Inserisci l'IP del target: " read -e IP ./msfconsole -r /usr/share/autoexploit/autopwnrc.rc
Last edited by HaVaNa7; 03-16-2011 at 12:04 PM.
maybe try
and in your resource fileCode:/bin/su - postgres -c "pg_ctl -D ~/metasploitdb start" sleep 3 cd /pentest/exploits/framework3 echo -n "Inserisci l'IP del target: " read -e IP echo $IP > /root/ip-targets.txt ./msfconsole -r /usr/share/autoexploit/autopwnrc.rc
Code:db_nmap -iL /root/ip-targets.txt