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.

terminal

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

Code:

#!/usr/bin/env python

# Imports
import socket

# Bit of glitter..
print("\n===================== Welcome to BannerGrab =====================\n=================== http://www.chimera-security.com ====================\n")

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

# Initiate the connection
socket.setdefaulttimeout(10)
sock = socket.socket()
sock.connect((target_host,target_port))
ans = sock.recv(1024)

# Close the connection
sock.close()

# 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..

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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