def __init__(self, logger=None): ''' Constructor ''' self.logger = logger try: self.nma = nmap.PortScanner( ) # instantiate nmap.PortScanner object self.params = '-A -Pn -sC -R -v -O -T4' # self.params='-sV -T4 -O ' #快捷扫描加强版 # self.params='-sS -sU -T4 -A -v' #深入扫描 except nmap.PortScannerError: # print('Nmap not found', sys.exc_info()[0]) self.logger and self.logger.info('Nmap not found:%s', sys.exc_info()[0]) except: # print('Unexpected error:', sys.exc_info()[0]) self.logger and self.logger.info('Unexpected error:%s', sys.exc_info()[0]) self.config = config.Config self.sqlTool = Sqldatatask.getObject() # self.sqlTool=SQLTool.getObject() self.portscan = portscantask.getObject() self.getlocationtool = getLocationTool.getObject()
def __init__(self, logger=None): ''' Constructor ''' self.logger = logger try: self.nma = nmap.PortScanner( ) # instantiate nmap.PortScanner object self.params = '-sS -T4 -A -Pn ' self.usual_ports = '10000,10001,1001,1011,10109,102,1025-1029,10307,10311,1033,10364-10365,10407,10409-10410,10412,10414-10415,10428,10431-10432,10447,10449-10450,106,1089-1091,109-111,11001,1110,113,1158,1170,119,1200,12135-12137,12316,12380,1234,1243,12645,12647-12648,13,135,137-139,13722,13724,13782-13783,143-144,1433-1434,1492,14000,1500,1521,1524,1541,1600,161,1720,1722,1723,1730,1755,177,179,18000,18245,1900,1911,1935,1962,1966,199,1998-2001,2000,2222,20000,2006-2007,2023,2049,20547,2100,2121,21-23,2404,25-26,27017,2717,3000-3001,31,3128,3151,32768,3306,3310,3389,33812,34962-34964,37,34567,37777,38000-38001,38011-38012,38014-38015,38200,38210,38301,38400,38589,38593,38600,38700,389,38971,39129,39278,3986,4000,42,427,443-445,44818,456,45678,4592,465,46666,47808,4800,4840,4843,4899,49152-49157,50000-50016,5000-5004,50018-50021,50025-50028,5007,5009,50110-50111,50123,502,5052,5048,5058,5060,5065,5101,513-515,5190,51960,53,5357,5413,5432,543-544,5450,548,55000-55003,554,55555,556,56001-56099,5601,5631,5666,5800,587,5900-5902,60000,6000-6002,61697,62900,62911,62924,62930,62938,62956-62957,62963,62981-62982,62985,62992,63012,63027-63036,63041,63075,63079,63082,63088,63094,631,636,6379,646,65000,65443,6646,666,67,6711,6776,69,7,7000-7002,7070,7547,771,777,79-82,8000-8001,8008-8009,8080-8082,8086-8090,8099,8101,8181,8400,8443,85,873,88,8800,8888-8889,9,900,9080,9083,9090-9091,9100,9200,9300,9600,99,990,993,995,9999-10000' # self.params='-A -sC -R -v -O -T4 -Pn ' # self.params='-sV -T4 -Pn -O ' #快捷扫描加强版 # self.params='-sS -sU -T4 -A -v ' #深入扫描 except nmap.PortScannerError: self.logger.error('Nmap not found:%s', sys.exc_info()[0]) except: self.logger.error('Unexpected error:%s', sys.exc_info()[0]) self.config = config.Config self.sqlTool = Sqldatatask.getObject( ) # init DBmanager, and connect database and thread number self.portscan = portscantask.getObject( ) #设置一些网络参数配置, 以及端口扫描的线程数,应该是决定nmap的速度 查看portScantask.log # init DBmanager and thread number self.getlocationtool = getLocationTool.getObject()
def __init__(self, isThread=1, deamon=True): TaskTool.__init__(self, isThread, deamon=deamon) self.set_deal_num(1) self.getlocationtool = getLocationTool.getObject() self.config = config.Config self.sqlTool = Sqldatatask.getObject()
def __init__(self,isThread=1,deamon=True): TaskTool.__init__(self,isThread,deamon=deamon) self.set_deal_num(1) self.getlocationtool=getLocationTool.getObject() self.config=config.Config self.sqlTool = Sqldatatask.getObject()
def __init__(self): ''' Constructor ''' try: self.nma = nmap.PortScanner() # instantiate nmap.PortScanner object self.params='-A -Pn -sC -R -v -O ' # self.params='-sV -T4 -O ' #快捷扫描加强版 # self.params='-sS -sU -T4 -A -v' #深入扫描 except nmap.PortScannerError: print('Nmap not found', sys.exc_info()[0]) except: print('Unexpected error:', sys.exc_info()[0]) self.config=config.Config self.sqlTool=Sqldatatask.getObject() # self.sqlTool=SQLTool.getObject() self.portscan=portscantask.getObject() self.getlocationtool=getLocationTool.getObject()
def __init__(self): # self.sqlTool=SQLTool.getObject() self.sqlTool = Sqldatatask.getObject() self.config = config.Config self.portscan = portscantask.getObject() self.getlocationtool = getLocationTool.getObject()
def __init__(self): # self.sqlTool=SQLTool.getObject() self.sqlTool=Sqldatatask.getObject() self.config=config.Config self.portscan=portscantask.getObject() self.getlocationtool=getLocationTool.getObject()
def __init__(self,isThread=1,deamon=True): TaskTool.__init__(self,isThread,deamon=deamon) # self.portscan=portscantool.Portscantool() self.set_deal_num(1) self.getlocationtool=getLocationTool.getObject()