BannerGrab – Simple banner grabbing

I am in the process of learning Python (slowly). Aside from the stuff I’ve already posted, one of my first projects was a simple way of banner grabbing. This script works for banner grabbing against applications such as FTP, VNC etc.


This isn’t finished yet but I thought I would put it up here anyway.


#!/usr/bin/env python

# Imports
import socket

# Bit of glitter..
print("\n===================== Welcome to BannerGrab =====================\n=================== ====================\n")

# Define the target (user input)
target_host = raw_input("- Enter target host: ")
target_port = input("- Enter target port: ")

# Initiate the connection
sock = socket.socket()
ans = sock.recv(1024)

# Close the connection

# Print the results
print("\n============================= Banner ============================\n\n" + ans)

Still working on it so more changes to come, seems to be having issues with banner grabbing over ports 80 & 443. I think I may have to use the urllib module to accomplish this..


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s