PDA

View Full Version : Problem with metasploit



Yarflam
2013-03-14, 15:41
Hello everybody !
I have problem from metasploit or postgres's database.



msf > db_connect root@metasploit
NOTICE: CREATE TABLE will create implicit sequence "hosts_id_seq" for serial column "hosts.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "hosts_pkey" for table "hosts"
NOTICE: CREATE TABLE will create implicit sequence "clients_id_seq" for serial column "clients.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "clients_pkey" for table "clients"
NOTICE: CREATE TABLE will create implicit sequence "services_id_seq" for serial column "services.id"
[...]
msf > help
[-] Error while running command help: PG::Error: ERROR: column "module_name" of relation "events" does not exist
LINE 1: ...ts" ("created_at", "critical", "host_id", "info", "module_na...
^
: INSERT INTO "events" ("created_at", "critical", "host_id", "info", "module_name", "module_rhost", "name", "seen", "updated_at", "username", "workspace_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id"

Call stack:
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `prepare'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `prepare_statement'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1158:in `exec_cache'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `block in exec_query'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `exec_query'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:66:in `insert'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/persistence.rb:367:in `create'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/timestamp.rb:58:in `create'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/callbacks.rb:268:in `block in create'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:403:in `_run__2384102886660463401__create__37606954991759 8181__callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/callbacks.rb:268:in `create'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/persistence.rb:348:in `create_or_update'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:425:in `_run__2384102886660463401__save__3760695499175981 81__callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/callbacks.rb:264:in `create_or_update'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/persistence.rb:84:in `save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/validations.rb:50:in `save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:208:in `transaction'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:259:in `block in save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/transactions.rb:258:in `save'
/opt/metasploit/apps/pro/ui/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/persistence.rb:45:in `create'
/opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:1907:in `block in report_event'
/opt/metasploit/apps/pro/msf3/lib/msf/core/patches/active_record.rb:22:in `with_connection'
/opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:1898:in `report_event'
/opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:222:in `report_event'
/opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:271:in `on_ui_command'
/opt/metasploit/apps/pro/msf3/lib/msf/core/event_dispatcher.rb:183:in `block in method_missing'
/opt/metasploit/apps/pro/msf3/lib/msf/core/event_dispatcher.rb:181:in `each'
/opt/metasploit/apps/pro/msf3/lib/msf/core/event_dispatcher.rb:181:in `method_missing'
/opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:541:in `block in on_startup'
/opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:388:in `call'
/opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:388:in `block in run_single'
/opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
/opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
/opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
/opt/metasploit/apps/pro/msf3/msfconsole:168:in `<main>'


I don't found correct answer from the google.
Do you know that ? It's only on Kali linux ?

Thank you very much.

ps: I'm french.

Malachai
2013-03-14, 20:27
Might have to start the service

# postgresql start && service metasploit start

SharkBait
2013-03-14, 21:26
Might have to start the service

# postgresql start && service metasploit start

+1 Also, I had to update both postgresql and metasploit then run msfupdate before anything would work for me.

WOOP
2013-03-14, 23:07
Usage: db_connect <user:pass>@<host:port>/<database>
OR: db_connect -y [path/to/database.yml]

msf > db_connect msf3:MYPASSWORD@127.0.0.1/msf3
msf > db_status
postgresql connected to msf3

To get your password (randomly generated), just lookup for a file named database.yml (/opt/metasploit/apps/pro/ui/config/database.yml)

Example
production:
adapter: "postgresql"
database: "msf3"
username: "msf3"
password: "YOURPASSWORD"
port: 5432
host: "localhost"
pool: 256
timeout: 5

n1tr0g3n
2013-03-16, 03:44
Try this...

To start Metasploit's services immediately, open a terminal window and enter

service postgresql start && service metasploit start


To start Metasploit's services on each boot time (but not immediately), open a terminal window and type

update-rc.d postgresql enable && update-rc.d metasploit enable

LoophCrack
2013-03-16, 14:30
Try this...

To start Metasploit's services immediately, open a terminal window and enter

service postgresql start && service metasploit start


To start Metasploit's services on each boot time (but not immediately), open a terminal window and type

update-rc.d postgresql enable && update-rc.d metasploit enable

Followed this for the first time and it worked! +1

himynamesronnie
2013-03-18, 23:57
Running this on the Raspberry_pi and the service metasploit start is an unrecognized service. Any Tips?

B0bD0l3
2013-03-19, 01:04
hmm LoophCrack all that, is mentioned in the Kali Docs, you may wish to have a quick look, if you want, but it may save some time before having to look around on the forums

P.S shout out to n1tr0 if its the same n1tr0 from THS :)

Malachai
2013-03-19, 23:35
Hopefully the withthe update they just released today it will fix the problem.

tiger1
2013-03-27, 20:18
When I try "update-rc.d postgresql enable", I get this error message: "using dependency based boot sequencing". Same thing when trying to set metasploit service to auto-start. I am kind of new to Linux and live-usb boots - does this message mean I don't have persistence properly set up? Any guidance is greatly appreciated!

Yarflam
2013-05-02, 08:03
Thank you very much !
I wrote an article on hackademics.fr (http://hackademics.fr/showthread.php?2946-Installer-Metasploit-sous-Kali).