예제 #1
0
 def scan_path(self):
     path_payload = [
         self.url + formatPath(i.strip())
         for i in readFile(self.cachePath_txt)
     ]
     pathScanProcess = MyThreadPool(self.scan, path_payload,
                                    self.maxconnections)
     pathScanProcess.start()
예제 #2
0
 def scan_file_plus(self):
     file_payload = [
         self.url + formatPath(i.strip())
         for i in readFile(self.wordsList_plus)
     ]
     fileScanProcess = MyThreadPool(self.scan, file_payload,
                                    self.maxconnections)
     fileScanProcess.start()
예제 #3
0
def getWeb(ip_port_list=None,targetFile=None,resultFile=None):
    if targetFile:
        ip_port_list = readFile(targetFile)
    if resultFile == None:
        resultFile = '{}result/web_{}.txt'.format(base_root,time.time())

    getWebThread = MyThreadPool(isWeb,ip_port_list)
    getWebThread.start()
    writeFile(resultFile,'{}'.format(getWebThread.result))
예제 #4
0
def getCmsPrint(target_url, json_path=None, updata=False):
    if updata:
        updataCmsPrintJson(json_path=json_path)
    database_json = readJsonFile(json_path)
    database_list = database_json['RECORDS']
    getCmsPrint_pool = MyThreadPool(getCMS_Name,
                                    database_list,
                                    other_args=target_url)
    getCmsPrint_pool.start()
    print(getCmsPrint_pool.result)
예제 #5
0
def weakPwdCrack_Svn(ip, user_list=None, pwd_list=None, resultFile=None):
    if resultFile == None:
        resultFile = '{}result/{}_{}.txt'.format(base_root, ip, time.time())

    if user_list == None:
        user_list = readFile(
            '{}payload/dict/user_database.txt'.format(base_root))

    if pwd_list == None:
        pwd_list = readFile(
            '{}payload/dict/passwd_top10.txt'.format(base_root))

    #生成在多线程里使用的关键函数
    def connectSvn_forThread(passwd, otherArgs):
        ip = otherArgs['ip']
        user = otherArgs['user']
        passwd = passwd.strip()
        print('crack user:[{}]/pwd:[{}]'.format(user, passwd))
        (flag, userAndpwd) = connect_svn(ip, user, password=passwd)
        if flag:
            print('[FOUND] user:[{}]/pwd:[{}],result out is [{}]'.format(
                user, passwd, userAndpwd))
            time.sleep(1.5)  # 多线程写入文件时,可能存在条件竞争,添加睡眠时间尽可能防止其出现
            writeFile(resultFile,
                      '[user:[{}]/pwd:[{}]\r\n'.format(user, passwd))
            time.sleep(1.5)  # 多线程写入文件时,可能存在条件竞争,添加睡眠时间尽可能防止其出现

    #爆破和用户名相似的密码
    for user in user_list:
        user = user.strip()
        userNameAlikePwd = getUserNameAlikePwd(user)
        otherArgs = {'ip': ip, 'user': user}
        crackFtpThread = MyThreadPool(connectSvn_forThread,
                                      userNameAlikePwd,
                                      other_args=otherArgs)
        crackFtpThread.start()

    # 爆破字典里面的密码
    for user in user_list:
        user = user.strip()
        otherArgs = {'ip': ip, 'user': user}
        crackFtpThread = MyThreadPool(connectSvn_forThread,
                                      pwd_list,
                                      other_args=otherArgs)
        crackFtpThread.start()