Seriously? It's all in the .rc files. You can do everything you want to automate in there.
Metasploit: Automating the Metasploit Console
Printable View
Seriously? It's all in the .rc files. You can do everything you want to automate in there.
Metasploit: Automating the Metasploit Console
Oh thank you! Who knew it would be so obvious!
This is a much better explanation - the only thing missing is commenting out the ssl=true
Metasploit Framework - Setting Up a Database - Metasploit Redmine Interface
also with details on how to enable the mentioned options by default
Code:$ cat > ~/.msf3/msfconsole.rc
db_driver postgresql
db_connect msf:r4nd0m@127.0.0.1/msf
db_workspace -a MyProject
^D
i m doing like this:
./msfconsole
db_driver
db_create targets
db_nmap IP -p PORT
db_autopwn -t -s -e -p -b
This working fine for me ...
I finally got my Postgresql to work in Metsploit, what I did in the end was to fire up synaptic and remove 'framework 3' and then I downloaded the installer from the metasploit website, installed metasploit 3.4.1 from that, updated it and fired up msfconsle and hey presto working postgres.
I noticed from the metsploit website that the devs had fixed an issue with shipping a working gem postgresql Bug#1879.
Hope this helps any others who have been 'fighting' with this one.
Whenever i want to do something in linux, even if its something small, it costs me my whole day. This is also the case with creating a simple database for msf3.
Is this like a newbie-test ?
I cant get the driver to work. I do everything followed in the tutorial. I do:
Someone enlighten me.Code:db_connect postgres:postgres PASSWORD@127.0.0.1/msf3
Error while running command db_connect failed to connect to database: FATAL: Ident authentication failed for user "root".
The command is:
And postgreSQL must be turned on before you connect to it.Code:db_connect postgres:PASSWORD@127.0.0.1/metasploit
i just wanted to say thanks to the OP, this tutorial got my metasploit working. i was racking my brain for hours trying to get it to work. you're a champion
Thanx for the tut. ;)
I'm not an expert on databases, and I have not tried this myself. NeXpose integrates very nicely with Metasploit but the installer installs its own PostgreSQL database. If I remember correctly (from a previous install where I used sqlite3 with metasploit) that stops the original database from starting. Thus "/etc/init.d/postgresql-8.3 start" fails.
Can anyone please comment on that?
pluto I don't really know for sure but if you are talking about using NeXpose from msfconsole I think you can create your own database and use that too :)
just updated to R1 if you have this problem here is the fix...
edit /etc/postgresql/8.3/main/postgresql.confCode:2010-11-07 13:49:00 PST FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
also just a informational for the how-to you can also installCode:external_pid_file = '/tmp/8.3-main.pid'
unix_socket_directory = '/tmp/'
#ssl = true (dont forget that from the OP)
apt-get install pgadmin3
if your like me and dont like to deal with command line database managment
or you can alternately give posgres permissions everywhere either way.. this was just faster