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