Fake web server reply

In this section, you will learn how to create a fake web server signature. This is the application layer code. This section's code has no relation to the previous code. In order to get the server signature or banner grabbing, I am going to use the ID Serve tool.

Let's see the fake_webserver.py code:

  • Use the following modules in the program. The logger1 module is used to create a log file. You will see the code of logger1 later:
   from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer   import logger1
  • Look at the following piece of code carefully. The fakewebserver  class inherits the BaseHTTPRequestHandler class. The send_response method is overriding the method of the BaseHTTPRequestHandler class because we are ...

Get Python Penetration Testing Essentials now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.