# Metasploit lab eJPT problem

**URL:** <https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851>\
**Category:** Cyber Security\
**Tags:** security, lab, metasploit\
**Created:** [July 27, 2021, 11:53am UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851 "2021-07-27T11:53:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![T3igger84](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@T3igger84](https://legacy-community.ine.com/u/T3igger84)\
**Post date:** [July 27, 2021, 11:53am UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/1 "2021-07-27T11:53:59Z")

</div>

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.

> <https://github.com/rapid7/metasploit-framework/issues/15422>
>
> \<!--
> 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?

---

<div class="post-metadata">

**Author:** ![jaa](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jaa](https://legacy-community.ine.com/u/jaa)\
**Post date:** [July 27, 2021, 1:09pm UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/2 "2021-07-27T13:09:12Z")

</div>

Welcome @T3igger84 to the community.  
Never came across this. But check this,

1. 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.
2. 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.

---

<div class="post-metadata">

**Author:** ![T3igger84](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@T3igger84](https://legacy-community.ine.com/u/T3igger84)\
**Post date:** [July 27, 2021, 3:25pm UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/3 "2021-07-27T15:25:20Z")

</div>

![3](https://us1.discourse-cdn.com/flex015/uploads/ine/original/1X/9cd0b8cef0fd5d418ac3df06a1dcf102e9b0ad75.png)  
Here are some, I did like every time. Maybe I should go to older version of Kali and metasploit.

---

<div class="post-metadata">

**Author:** ![jaa](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jaa](https://legacy-community.ine.com/u/jaa)\
**Post date:** [July 27, 2021, 4:40pm UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/4 "2021-07-27T16:40:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![T3igger84](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@T3igger84](https://legacy-community.ine.com/u/T3igger84)\
**Post date:** [July 27, 2021, 7:24pm UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/5 "2021-07-27T19:24:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmason-joshua17sc](https://sea1.discourse-cdn.com/flex015/user_avatar/legacy-community.ine.com/jmason-joshua17sc/32/310_2.png) [@jmason-joshua17sc](https://legacy-community.ine.com/u/jmason-joshua17sc)\
**Post date:** [September 8, 2021, 8:43pm UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/6 "2021-09-08T20:43:14Z")

</div>

Update your Kali. Might need to give your VM more memory.

---

<div class="post-metadata">

**Author:** ![0xnonamefox21](https://sea1.discourse-cdn.com/flex015/user_avatar/legacy-community.ine.com/0xnonamefox21/32/140_2.png) [@0xnonamefox21](https://legacy-community.ine.com/u/0xnonamefox21)\
**Post date:** [September 9, 2021, 3:41am UTC](https://legacy-community.ine.com/t/metasploit-lab-ejpt-problem/851/7 "2021-09-09T03:41:30Z")

</div>

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.
