Results 1 to 11 of 11

Thread: Problem with metasploit

  1. #1
    Join Date
    2013-Mar
    Posts
    2

    Problem with metasploit

    Hello everybody !
    I have problem from metasploit or postgres's database.

    Code:
    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__376069549917598181__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__376069549917598181__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.

  2. #2
    Join Date
    2013-Mar
    Posts
    20
    Might have to start the service

    # postgresql start && service metasploit start

  3. #3
    Join Date
    2013-Mar
    Location
    Canada
    Posts
    30
    Quote Originally Posted by Malachai View Post
    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.

  4. #4
    Join Date
    2013-Mar
    Posts
    2
    [*] Usage: db_connect <user***>@<hostort>/<database>[*] OR: db_connect -y [path/to/database.yml]

    msf > db_connect msf3:[email protected]/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

  5. #5
    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

  6. #6
    Join Date
    2013-Mar
    Posts
    2
    Quote Originally Posted by n1tr0g3n View Post
    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

  7. #7
    Running this on the Raspberry_pi and the service metasploit start is an unrecognized service. Any Tips?

  8. #8
    Join Date
    2013-Mar
    Posts
    2
    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

  9. #9
    Join Date
    2013-Mar
    Posts
    20
    Hopefully the withthe update they just released today it will fix the problem.

  10. #10
    Join Date
    2013-Mar
    Posts
    6
    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!

  11. #11
    Join Date
    2013-Mar
    Posts
    2
    Thank you very much !
    I wrote an article on hackademics.fr.

Similar Threads

  1. Problem with Metasploit
    By dbzdivik in forum TroubleShooting Archive
    Replies: 12
    Last Post: 2013-07-08, 13:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •