Follow us on Twitter!
Become the change you seek in the world. - Gandhi
Saturday, April 19, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 26
Members Online: 1

Registered Members: 82835
Newest Member: phanton2043
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

portscanner in python help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-07-05 15:09
My code doesnt work lol, I think i'm forgetting somethign :S
Code
#!/python24
import socket
# gathering info
host = raw_input( "What is the IP? " )
port0 = raw_input( "What is the starting port? " )
port1 = raw_input( "What is the finishing port? " )
output = raw_input( "What shall the output file be called? " )
# checking ports
port = port0
while port <= port1:
# creating the socket
   s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
   s.connect((host, port))
   s.send()
   data = s.recv(1) # read only one byte
   if (data > 0):
          z.open( output + ".txt", "a" )
          z.wrtie( port + "open" )
          z.close()
          s.close()
          port = port + "1"
   else :
          z.open( output + ".txt", "a" )
          z.write( port + "closed" )
          z.close()
          s.close()
          port = port + "1"
   





Author

RE: portscanner in python help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-07-05 16:43
Fixed it the correct code is available at the open source section in programming