mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-16 10:02:53 -07:00
Added support for single IP or range file.
This commit is contained in:
parent
1b2a22facf
commit
02fb3f8978
1 changed files with 42 additions and 18 deletions
|
@ -22,22 +22,24 @@ from odict import OrderedDict
|
||||||
import errno
|
import errno
|
||||||
import optparse
|
import optparse
|
||||||
from RunFingerPackets import *
|
from RunFingerPackets import *
|
||||||
__version__ = "1.5"
|
__version__ = "1.6"
|
||||||
|
|
||||||
parser = optparse.OptionParser(usage='python %prog -i 10.10.10.224\nor:\npython %prog -i 10.10.10.0/24', version=__version__, prog=sys.argv[0])
|
parser = optparse.OptionParser(usage='python %prog -i 10.10.10.224\nor:\npython %prog -i 10.10.10.0/24', version=__version__, prog=sys.argv[0])
|
||||||
|
|
||||||
parser.add_option('-i','--ip', action="store", help="Target IP address or class C", dest="TARGET", metavar="10.10.10.224", default=None)
|
parser.add_option('-i','--ip', action="store", help="Target IP address or class C", dest="TARGET", metavar="10.10.10.224", default=None)
|
||||||
|
parser.add_option('-f','--filename', action="store", help="target file", dest="Filename", metavar="ips.txt", default=None)
|
||||||
#Way better to have grepable output by default...
|
#Way better to have grepable output by default...
|
||||||
#parser.add_option('-g','--grep', action="store_true", dest="grep_output", default=False, help="Output in grepable format")
|
#parser.add_option('-g','--grep', action="store_true", dest="grep_output", default=False, help="Output in grepable format")
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
if options.TARGET is None:
|
if options.TARGET == None and options.Filename == None:
|
||||||
print("\n-i Mandatory option is missing, please provide a target or target range.\n")
|
print("\n-i Mandatory option is missing, please provide a target or target range.\n")
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
Timeout = 1
|
Timeout = 1
|
||||||
Host = options.TARGET
|
Host = options.TARGET
|
||||||
|
Filename = options.Filename
|
||||||
SMB1 = "Enabled"
|
SMB1 = "Enabled"
|
||||||
SMB2signing = "False"
|
SMB2signing = "False"
|
||||||
|
|
||||||
|
@ -386,20 +388,42 @@ def IsRDPOn(Host):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def RunFinger(Host):
|
def RunFinger(Host):
|
||||||
m = re.search("/", str(Host))
|
if Filename != None:
|
||||||
if m:
|
with open(Filename) as fp:
|
||||||
net,_,mask = Host.partition('/')
|
Line = fp.read().splitlines()
|
||||||
mask = int(mask)
|
for Ln in Line:
|
||||||
net = atod(net)
|
m = re.search("/", str(Ln))
|
||||||
threads = []
|
if m:
|
||||||
Pool = multiprocessing.Pool(processes=250)
|
net,_,mask = Ln.partition('/')
|
||||||
func = ShowSmallResults
|
mask = int(mask)
|
||||||
for host in (dtoa(net+n) for n in range(0, 1<<32-mask)):
|
net = atod(net)
|
||||||
proc = Pool.apply_async(func, ((host),))
|
threads = []
|
||||||
threads.append(proc)
|
Pool = multiprocessing.Pool(processes=250)
|
||||||
for proc in threads:
|
func = ShowSmallResults
|
||||||
proc.get()
|
for host in (dtoa(net+n) for n in range(0, 1<<32-mask)):
|
||||||
else:
|
proc = Pool.apply_async(func, ((host),))
|
||||||
ShowSmallResults(Host)
|
threads.append(proc)
|
||||||
|
for proc in threads:
|
||||||
|
proc.get()
|
||||||
|
else:
|
||||||
|
ShowSmallResults(Ln)
|
||||||
|
|
||||||
|
if Filename == None:
|
||||||
|
m = re.search("/", str(Host))
|
||||||
|
if m:
|
||||||
|
net,_,mask = Host.partition('/')
|
||||||
|
mask = int(mask)
|
||||||
|
net = atod(net)
|
||||||
|
threads = []
|
||||||
|
Pool = multiprocessing.Pool(processes=250)
|
||||||
|
func = ShowSmallResults
|
||||||
|
for host in (dtoa(net+n) for n in range(0, 1<<32-mask)):
|
||||||
|
proc = Pool.apply_async(func, ((host),))
|
||||||
|
threads.append(proc)
|
||||||
|
for proc in threads:
|
||||||
|
proc.get()
|
||||||
|
else:
|
||||||
|
ShowSmallResults(Host)
|
||||||
|
|
||||||
|
|
||||||
RunFinger(Host)
|
RunFinger(Host)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue