Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Error while running command db_autopwn

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Exclamation Error while running command db_autopwn

    I'll start off by saying I've spent a great deal of time searching and reading solutions with no avail.....

    I've been working my way through the Metasploit Unleashed course and have been doing perfectly fine until recently. While working with Nessus through Msf I've been consistently recreating the following error during the db_autopwn -x -e command:


    Code:
    msf > db_autopwn -x -e
    [-] Error while running command db_autopwn: undefined local variable or method `data' for #<#<Module:0xb4577a4c>::Metasploit3:0xb48cbb08>
    
    Call stack:
    (eval):21:in `initialize'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:894:in `new'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:894:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:230:in `call'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:230:in `each_module_list'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:203:in `each'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:203:in `each_module_list'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:121:in `each_module'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:893:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:892:in `each'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:892:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:331:in `send'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:331:in `run_command'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:293:in `run_single'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `each'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `run_single'
    /opt/metasploit3/msf3/lib/rex/ui/text/shell.rb:143:in `run'
    /opt/metasploit3/msf3/msfconsole:130

    I've tried using both mysql and sqlite3 (I skipped postgresql) while importing reports, but I receive identical errors when using both database types.

    I'm running metasploit v3.7.0-dev [core:3.7 api:1.0] with svn r12451 updated today (2011.04.27).

    I apologize if this results in a very basic fix, but as I said I am somewhat new and trying to work my way through everything at a pace that will truly allow me to build a solid foundation.... Any help is much appreciated.

  2. #2
    Senior Member voidnecron's Avatar
    Join Date
    May 2010
    Posts
    132

    Default Re: Error while running command db_autopwn

    Begin with what you have done prior to the 'db_autopwn' command.
    And what was the last time you ran msfupdate?
    "The difference between RAID1 and RAID0 is that the zero stands for how many files you're gonna have after a harddisk failure."

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    I'll include a snippet of commands prior to the error (I'm leaving out the Nessus through Msf commands as this is an issue with db_autopwn and clearly my report has been imported successfully)....

    Code:
    root@bt:~# msfconsole
    
    #    # ###### #####   ##    ####  #####  #       ####  # #####
    ##  ## #        #    #  #  #      #    # #      #    # #   #
    # ## # #####    #   #    #  ####  #    # #      #    # #   #
    #    # #        #   ######      # #####  #      #    # #   #
    #    # #        #   #    # #    # #      #      #    # #   #
    #    # ######   #   #    #  ####  #      ######  ####  #   #
    
    
           =[ metasploit v3.7.0-dev [core:3.7 api:1.0]
    + -- --=[ 681 exploits - 356 auxiliary
    + -- --=[ 217 payloads - 27 encoders - 8 nops
           =[ svn r12451 updated today (2011.04.27)
    
    msf > db_driver mysql[*] Using database driver mysql
    msf > db_connect root:toor@127.0.0.1/autopwn
    msf > load db_tracker[*] Successfully loaded plugin: db_tracker
    msf > db_import /root/nessus_report_Victim.nessus[*] Importing 'Nessus XML (v2)' data[*] Importing host 192.168.1.148[*] Successfully imported /root/nessus_report_Victim.nessus
    msf > db_hosts
    
    Hosts
    =====
    
    address        mac                name             os_name            os_flavor  os_sp  purpose  info  comments
    -------        ---                ----             -------            ---------  -----  -------  ----  --------
    192.168.1.148  00:0C:29:XX:XX:XX  sean-913f8f8ad0  Microsoft Windows  XP         SP2    device
    
    msf > db_services
    
    Services
    ========
    
    host           port  proto  name             state  info
    ----           ----  -----  ----             -----  ----
    192.168.1.148  21    tcp    sean-913f8f8ad0  open
    192.168.1.148  25    tcp    sean-913f8f8ad0  open
    192.168.1.148  80    tcp    sean-913f8f8ad0  open
    192.168.1.148  123   udp    sean-913f8f8ad0  open
    192.168.1.148  135   tcp    sean-913f8f8ad0  open
    ......
    
    msf > db_vulns[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 name=NSS- refs=[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 port=1434 proto=udp name=NSS-10674 refs=[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 port=1433 proto=tcp name=NSS-34311 refs=CVE-2008-0085,CVE-2008-0086,CVE-2008-0106,CVE-2008-0107,BID-30082,BID-30083,BID-30118,BID-30119,OSVDB-46770,OSVDB-46771,OSVDB-46772,OSVDB-46773,MSFT-MS08-040,CWE-189[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 port=1433 proto=tcp name=NSS-35635 refs=CVE-2008-5416,BID-32710,OSVDB-50589,MSFT-MS09-004,CWE-119,MSF-Microsoft SQL Server sp_replwritetovarbin Memory Corruption[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 port=1433 proto=tcp name=NSS-10144 refs=[*] Time: Wed Apr 27 06:41:29 UTC 2011 Vuln: host=192.168.1.148 port=1025 proto=tcp name=NSS-22319 refs=
    ...........
    
    msf > db_autopwn -x -e
    [-] Error while running command db_autopwn: undefined local variable or method `data' for #<#<Module:0xb4577a4c>::Metasploit3:0xb48cbb08>
    
    Call stack:
    (eval):21:in `initialize'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:894:in `new'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:894:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:230:in `call'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:230:in `each_module_list'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:203:in `each'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:203:in `each_module_list'
    /opt/metasploit3/msf3/lib/msf/core/module_manager.rb:121:in `each_module'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:893:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:892:in `each'
    /opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:892:in `cmd_db_autopwn'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:331:in `send'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:331:in `run_command'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:293:in `run_single'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `each'
    /opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `run_single'
    /opt/metasploit3/msf3/lib/rex/ui/text/shell.rb:143:in `run'
    /opt/metasploit3/msf3/msfconsole:130
    msf >
    As I mentioned prior, I last updated today.

    I should also mention I am running everything through VM and my target is the recommended XP build that the course asks you to create.

    (Truncated services and vulns due to char restrictions)

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    Same issue after updating to r12460.

  5. #5
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    I've confirmed that the issue still persists despite using revisions from today, yesterday, 8 days ago, and 48 days ago. I've gone ahead and opened a ticket with the dev.Metasploit ticket system, as well.

    In the meantime, if anyone has any further suggestions or observations, feel free to include them. Anything relevant I will update on the dev ticket, too.

    Should I hear back with a response or a fix, I'll be sure to include it on this thread for future searches.

  6. #6
    Senior Member voidnecron's Avatar
    Join Date
    May 2010
    Posts
    132

    Default Re: Error while running command db_autopwn

    What happens if you create a new db and delete the current autopwn?
    "The difference between RAID1 and RAID0 is that the zero stands for how many files you're gonna have after a harddisk failure."

  7. #7
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    I've tried that along with running a different report through Nessus and then importing that. Both result in the same error.

  8. #8
    Senior Member iproute's Avatar
    Join Date
    Jan 2010
    Location
    Midwest, USA
    Posts
    192

    Default Re: Error while running command db_autopwn

    Have you tried just using an nmap scan instead of nessus? Run an autopwn against just open ports maybe and filter it with regular expressions (-m if i recall). Seems to me if you've attempted with new MSF update, also with new database, that using the nessus scan to base the autopwn is the only remaining commonality(meaning using nessus as your scanning technique at all. I see you imported a new scan as well.) Also if you find that using an nmap scan is successful with autopwn, let the MSF devs know, so it's more isolated for them.
    Last edited by iproute; 04-28-2011 at 06:03 PM.

  9. #9
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    Fantastic suggestion, iproute. I'll give it a shot and post back when I have a moment!

    I sent them an attachment of the report fed by Nessus so if it is a Nessus issue, hopefully they're going to modify as needed.

  10. #10
    Junior Member
    Join Date
    Jan 2010
    Posts
    41

    Default Re: Error while running command db_autopwn

    Same error upon running Fasttrack (nmap)....

    Code:
    msf > db_driver sqlite3[*] Using database driver sqlite3
    msf > db_destroy pentest[*] Deleting pentest...
    [-] The specified database does not exist
    msf > db_create pentest
    [-]
    [-] Warning: The db_create command is deprecated, use db_connect instead.
    [-]          The database and schema will be created automatically by
    [-]          db_connect. If db_connect fails to create the database, create
    [-]          it manually with your DBMS's administration tools.
    [-][*] Creating a new database instance...[*] Successfully connected to the database[*] File: pentest
    msf > db_nmap 192.168.1.148[*] Nmap: Starting Nmap 5.35DC1 ( http://nmap.org ) at 2011-04-28 15:51 EDT[*] Nmap: Nmap scan report for sean-913f8f8ad0 (192.168.1.148)[*] Nmap: Host is up (0.000060s latency).[*] Nmap: Not shown: 991 closed ports[*] Nmap: PORT     STATE SERVICE[*] Nmap: 21/tcp   open  ftp[*] Nmap: 25/tcp   open  smtp[*] Nmap: 80/tcp   open  http[*] Nmap: 135/tcp  open  msrpc[*] Nmap: 139/tcp  open  netbios-ssn[*] Nmap: 443/tcp  open  https[*] Nmap: 445/tcp  open  microsoft-ds[*] Nmap: 1025/tcp open  NFS-or-IIS[*] Nmap: 1433/tcp open  ms-sql-s[*] Nmap: MAC Address: 00:0C:29:17:B1:21 (VMware)[*] Nmap: Nmap done: 1 IP address (1 host up) scanned in 1.44 seconds
    msf > db_autopwn -p -t -e -b
    [-] Error while running command db_autopwn: undefined local variable or method `data' for #<#<Module:0xb43dd40c>::Metasploit3:0xb3ad28f8>
    
    Call stack:
    /pentest/exploits/framework3/lib/msf/core/module.rb:32:in `type'
    /pentest/exploits/framework3/lib/msf/core/module.rb:36:in `fullname'
    /pentest/exploits/framework3/lib/msf/core/module.rb:86:in `inspect'
    /pentest/exploits/framework3/lib/rex/ui/text/dispatcher_shell.rb:300:in `to_str'
    /pentest/exploits/framework3/lib/rex/ui/text/dispatcher_shell.rb:300:in `to_s'
    /pentest/exploits/framework3/lib/rex/ui/text/dispatcher_shell.rb:300:in `run_single'
    /pentest/exploits/framework3/lib/rex/ui/text/dispatcher_shell.rb:287:in `each'
    /pentest/exploits/framework3/lib/rex/ui/text/dispatcher_shell.rb:287:in `run_single'
    /pentest/exploits/framework3/lib/rex/ui/text/shell.rb:143:in `run'
    /pentest/exploits/framework3/msfconsole:130
    msf > sleep 5
    msf > jobs -K
    Stopping all jobs...
    msf >
    msf >
    msf >
    msf >
    msf > sessions -l
    
    Active sessions
    ===============
    
    No active sessions.

Page 1 of 2 12 LastLast

Similar Threads

  1. db_autopwn error
    By Teiknethal in forum Beginners Forum
    Replies: 10
    Last Post: 06-28-2010, 09:22 AM
  2. meterpreter says: error running command..
    By 5ky0ne in forum Beginners Forum
    Replies: 1
    Last Post: 06-25-2010, 04:21 PM
  3. Replies: 8
    Last Post: 03-30-2009, 07:39 PM
  4. Running WMIC in Command Shell
    By BadKarmaPR in forum OLD BT4beta HowTo's
    Replies: 1
    Last Post: 03-05-2009, 03:54 PM
  5. Running programs from command
    By exmreo in forum OLD Newbie Area
    Replies: 4
    Last Post: 06-27-2007, 07:10 PM

Tags for this Thread

Posting Permissions

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