Follow us on Twitter!
Don't judge the unknown - Grindordie
Friday, July 01, 2016
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 26
Guests Online: 24
Members Online: 2

Registered Members: 94347
Newest Member: Little8807
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