I have a problem in metasploit lab. When I get to the point I have to use hashdump command it fails just like the link.
opened 04:24AM - 13 Jul 21 UTC
bug
<!--
Please fill out each section below, otherwise, your issue will be closed… . This info allows Metasploit maintainers to diagnose (and fix!) your issue as quickly as possible.
Useful Links:
- Wiki: https://github.com/rapid7/metasploit-framework/wiki
- Reporting a Bug: https://github.com/rapid7/metasploit-framework/wiki/Reporting-a-Bug
Before opening a new issue, please search existing issues: https://github.com/rapid7/metasploit-framework/issues
-->
## Steps to reproduce
How'd you do it?
```
msf6 exploit(multi/handler) > sessions -i 3
[*] Starting interaction with 3...
meterpreter > hashdump
Administrator:5xx:xxxxxxxxxxxxxxxxxxxxxxxxxxxx:3663763487632974862349853259632:::
**[-] Error running command hashdump: NoMethodError undefined method `id' for nil:NilClass**
meterpreter >
```
This section should also tell us any relevant information about the
environment; for example, if an exploit that used to work is failing,
tell us the victim operating system and service versions.
## Were you following a specific guide/tutorial or reading documentation?
If yes link the guide/tutorial or documentation you were following here, otherwise you may omit this section.
## Expected behavior
What should happen?
Hashdump should show the hashes..
## Current behavior
What happens instead?
Error observed.
### Metasploit version
msf6 exploit(multi/handler) > version
Framework: 6.0.52-dev
Console : 6.0.52-dev
msf6 exploit(multi/handler) >
Debug errors:
</details>
## Framework Logs
The following framework logs were recorded before the issue occurred:
<details>
<summary>Collapse</summary>
```
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:157:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:555:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:51:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1543:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:555:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:504:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:162:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[07/13/2021 00:19:54] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (3)
[07/13/2021 00:19:54] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (3)
[07/13/2021 00:19:54] [d(0)] core: HistoryManager.pop_context name: :meterpreter
[07/13/2021 00:22:37] [d(0)] core: HistoryManager.push_context name: :meterpreter
[07/13/2021 00:22:41] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (4)
[07/13/2021 00:22:41] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (4)
[07/13/2021 00:22:41] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (4)
[07/13/2021 00:22:41] [e(0)] meterpreter: Error running command hashdump: NoMethodError undefined method `id' for nil:NilClass
[07/13/2021 00:22:41] [d(0)] meterpreter: Call stack:
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb:63:in `report_creds'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb:43:in `block in cmd_hashdump'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb:40:in `each'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb:40:in `cmd_hashdump'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:555:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:101:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:504:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:157:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:555:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:51:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1543:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:555:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:504:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:498:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:162:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[07/13/2021 00:22:45] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (4)
[07/13/2021 00:22:45] [w(0)] core: Warning: trying to report a session_event for a session with no db_record (4)
[07/13/2021 00:22:45] [d(0)] core: HistoryManager.pop_context name: :meterpreter
```
</details>
Did anyone experienced something similar?
jaa
July 27, 2021, 1:09pm
2
Welcome @T3igger84 to the community.
Never came across this. But check this,
Verify you have the privilege to dump the hash from the target machine. Check the status by using getuid
and sysinfo
commands from meterpreter. Most probably, if you don’t have the sufficient/system privileges, the hashdump might fail.
Try to use hashdump
after executing use priv
and getsystem
commands. This works on older systems and might fail on newer ones. ( getsystem elevates the privilege level to root.)
Also It would be better if you can put the output of the above commands , screenshots here.
Here are some, I did like every time. Maybe I should go to older version of Kali and metasploit.
jaa
July 27, 2021, 4:40pm
4
Hi @T3igger84 , i just tried to replicate the issue with the same metasploit lab, worked fine and was able to run hashdump without any issues.
The framework/console version i’m running was 6.0.49-dev
. Then i updated it to the latest version 6.0.53-dev
. Still no issues. Able to dump the hashes.
Don’t know, but migrating the service to another in meterpreter could help?? or perform a full upgrade sudo apt update -y && apt upgrade -y && apt dist-upgrade
and then try again.
1 Like
Hi jaa. I tried the full update, it didn’t work and I tried to migrate before and it didn’t work. I went back to kali 2020.4 new vm in virtualbox and it worked. I managed to hashdump and I finished the box finally. Thanks for the help.
2 Likes
Update your Kali. Might need to give your VM more memory.
Recommended by Kali:
Kali settings for vitual PC:
→ Should be a minimun of 2gb of Ram
I run 8gb RAM with 100gb space and 3 cores. No issues.