Exemplo n.º 1
0
def digger(data_type, count):
    rto = raintableoperator()
    dbo = dboperator()
    fo = fileoperator()
    unknow_list = []
    if data_type == "md5":
        while 1:
            unknow_list = dbo.get_unknown_md5_list(count)
            if len(unknow_list) > 0:
                print(" ")
                print("md5 digger:get " + str(len(unknow_list)) + " hash to dig")
                print("md5 digger:hash list is: " + str(unknow_list))
                weak_en_list, weak_pl_list = rto.ask_raintable(unknow_list, "md5")
                strong_en_list = set(unknow_list) - set(weak_en_list)
                dbo.refresh_md5table(weak_en_list, weak_pl_list, strong_en_list)
            else:
                time.sleep(10)
                fo.write_log("md5 digger is waitting for work")
                print(" ")
                print("md5 digger:get " + str(len(unknow_list)) + " hash to dig")
                print("md5 digger:hash list is: " + str(unknow_list))
                print("md5 digger:duang")
    elif data_type == "sha1":
        while 1:
            unknow_list = dbo.get_unknown_sha1_list(count)
            if len(unknow_list) > 0:
                print(" ")
                print("sha1 digger:get " + str(len(unknow_list)) + " hash to dig")
                print("sha1 digger:hash list is: " + str(unknow_list))
                weak_en_list, weak_pl_list = rto.ask_raintable(unknow_list, "sha1")
                strong_en_list = set(unknow_list) - set(weak_en_list)
                dbo.refresh_sha1table(weak_en_list, weak_pl_list, strong_en_list)
            else:
                time.sleep(10)
                fo.write_log("sha1 digger is waitting for work")
                print(" ")
                print("sha1 digger:get " + str(len(unknow_list)) + " hash to dig")
                print("sha1 digger:hash list is: " + str(unknow_list))
                print("sha1 digger:duang")
    else:
        fo.write_log("you input an unknow data_type in digger(data_type,count)")
Exemplo n.º 2
0

def print_help():
    print("help :")
    print("      hashpump.py -h")
    print("      hashpump.py topn filename")
    print("      hashpump.py custom filename")


def append_knowledge(data_list, note):
    dbo = dboperator()
    dbo.append_knowledge(data_list, note)


if __name__ == "__main__":
    fo = fileoperator()
    if len(sys.argv) == 1 or len(sys.argv) == 2:
        print_help()
    elif len(sys.argv) == 3:
        if sys.argv[1] == "topn":
            temp_data_list = fo.read_list_from_file(sys.argv[2])
            append_knowledge(temp_data_list, TOP_N)
        elif sys.argv[1] == "custom":
            temp_data_list = fo.read_list_from_file(sys.argv[2])
            append_knowledge(temp_data_list, USER_CUSTOM)
        elif sys.argv[1] == "l8":
            temp_data_list = fo.read_list_from_file(sys.argv[2])
            append_knowledge(temp_data_list, LESS_THAN_8)
        else:
            print_help()
    else: