Jump to content
twopac

Free Socks Scanner Python

Recommended Posts

Posted

Am cumparat acum cateva zile de la cineva acest scanner si in 2 zile de scanat cu el tot astept sa prind si eu 1 socks. ;))) Poate nu stiu eu sa-l folosesc ;)) rog pe cei care il testeaza sa posteze un feedback .

python scanner.py start_ip-end_ip

import sys
import os
import socket
import urllib
from random import randint

def get_ports():
port=[]
for i in range(0,65536):
if(i!=80 and i!=1080):
port.append(i)
return port

ports = get_ports()
get_host = "https://www.google.com"
socket.setdefaulttimeout(3)

def getGeo(ip):
return urllib.urlopen('http://ipinfo.io/'+ip+'/country').read()


def get_ips(start_ip, stop_ip):
ips = []
tmp = []

for i in start_ip.split('.'):
tmp.append("%02X" % long(i))

start_dec = long(''.join(tmp), 16)
tmp = []

for i in stop_ip.split('.'):
tmp.append("%02X" % long(i))

stop_dec = long(''.join(tmp), 16)

while(start_dec < stop_dec + 1):
bytes = []
bytes.append(str(int(start_dec / 16777216)))
rem = start_dec % 16777216
bytes.append(str(int(rem / 65536)))
rem = rem % 65536
bytes.append(str(int(rem / 256)))
rem = rem % 256
bytes.append(str(rem))
ips.append(".".join(bytes))
start_dec += 1

return ips

def scan(ip):
vuln = open('vuln.txt', 'a')
for port in ports:
try:
s = socket.socket(socket.AF_INET,
socket.SOCK_STREAM)
s.connect((ip, port))
print "Am gasit unu!\n"
vuln.write(ip + ":" + str(port)+'|'+getGeo(ip)+'\n')
vuln.flush()

s.send("GET " + get_host + " HTTP/1.0\r\n")
s.send("\r\n")

while 1:
data = s.recv(1024)
if not data:
break

print data

s.close()
except socket.error:
print 'Scanez..'
if len(sys.argv) < 2:
print sys.argv[0] + "IP: start-end"
sys.exit(1)
else:
if len(sys.argv) == 3:
get_host = sys.argv[2]

if sys.argv[1].find('-') > 0:
start_ip, stop_ip = sys.argv[1].split("-")
ips = get_ips(start_ip, stop_ip)

while len(ips) > 0:
i = randint(0, len(ips) - 1)
aip = str(ips[i])
del ips[i]
scan(aip)
else:
scan(sys.argv[1])

Posted

E un port scanner mai degrab decat un socks scanner.

Nu are threading + faptul ca scaneaza 60 000 de port-uri aiurea, il face mai incet decat munca manuala al unui chinez.

In termeni mai usor, face un ip in 5-6 minute. O clasa A are 255^3 ip-uri.

Posted

Asta ziceam si eu @Elohim ca nu are threading poate ma ajuti tu cu ceva de gen ca stiu ca esti serios(iti platesc nu vreau moka). ''Scanner'' asta daca il pot numi asa e facut de cineva de aici de pe forum .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...