March 2019
Beginner
490 pages
12h 40m
English
Banners expose information related to the name of the web server and the version that is running on the server. Some expose the backend technology (PHP, Java, Python) that's used and its version. With the socket module, we can get information related to the version server for a specific domain.
The simplest way to obtain the banner of a server is by using the socket module. We can send a get request and get the response through the recvfrom() method, which would return a tuple with the result.
You can find the following code in the socket_BannerGrabbing.py file:
#!/usr/bin/python3import socketimport resock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)sock.connect(("www.packtpub.com", 80))http_get ...Read now
Unlock full access