Пример #1
0
def iphistory(target):
    for t in target:
        site = t.name.replace('http://', '').replace('https://', '')
        try:
            web0 = site.split('/')[-1]
            print(' [!] Making the request...')
            html = requests.get('https://viewdns.info/iphistory/?domain=' +
                                web0).text
            print(' [*] Parsing raw-data...')
            soup = BeautifulSoup(html, 'lxml')
            print(soup)
            print(' [!] Setting parameters...')
            table = soup.findAll('table', attrs={'border': '1'})[0]
            print(' [!] Finding IP history instances...')
            trs = table.findAll('tr')
            trs.pop(0)

            print('\n [+] Following instances were found...')

            for tr in trs:
                td = tr.findAll('td')
                info = {
                    'ip': td[0].text,
                    'owner': td[2].text.rstrip(),
                    'last': td[3].text
                }
                print(
                    color.green(' [+] Instance : ') + color.blue(info['ip']) +
                    color.white(' => ' + info['owner']) +
                    color.blue(' - (' + info['last'] + ')'))
        except:
            print(color.red(' [-] No instances of IP History found...'))
            pass
Пример #2
0
def revdns(target):
    for t in target:
        site = t.name.replace('http://', '').replace('https://', '')
        print('[!] Looking Up for Reverse DNS Info...')
        print(' [~] Result: \n')
        text = requests.get('http://api.hackertarget.com/reversedns/?q=' +
                            site)
        result = text.text.split(' ')
        if 'error' not in result and 'no' != result[0]:
            #res = result.splitlines()
            #for r in result:
            print(
                color.blue(' [+] Received : ') + color.yellow(result[0]) +
                color.white(' => ') +
                color.blue('(' + result[1].strip() + ')'))

            #p = 'tmp/logs/'+web+'-logs/'+web+'-reverse-dns.lst'
            #open(p,'w+')
            #print(B+' [!] Saving links...')

            # for m in links:
            #     print(m)
            #     m = m + '\n'
            #     ile = open(p,"a")
            #     ile.write(m)
            #     ile.close()
            # pa = os.getcwd()
            # print(G+' [+] Links saved under '+pa+'/'+p+'!')
            # print('')

        else:
            print(color.red(' [-] No result found!'))
Пример #3
0
def build_banner(banner):
    size = len(banner) * 2 + 4
    padding = "".join("=" for i in range(size))
    letters = "| "
    for letter in banner:
        letters = letters + color.yellow(letter.upper()) + " "
    letters = letters + color.blue(" |")
    print("\n")
    print(color.blue(padding))
    print(color.blue(letters))
    print(color.blue(padding))
    print("\n")
Пример #4
0
def creditcards(target):
    from core.build_menu import buildmenu
    for host in target:
        host.lvl2 = inspect.stack()[0][3]
        host.lvl3 = ''
        credit0x00(host)
    try:
        input(
            color.blue(' [#] Press') + color.red(' Enter ') +
            color.blue('to continue... \n'))
        buildmenu(target, target[0].main_menu, 'Main Menu', '')
    except EOFError as e:
        buildmenu(target, target[0].main_menu, 'Main Menu', '')
    return
Пример #5
0
 def google_it(dork):
     clear_cookie()
     try:
         for title in gsearch(dork):
             print(color.blue(' [!] Profile Found :> ' +
                              color.white(title)))
     except Exception as e:
         pass
Пример #6
0
def check0x00(content, url):

    for pattern in patterns:
        print(color.blue(' [!] Finding ') + pattern + ' ...')
        time.sleep(0.005)
        if search(pattern, content):
            print(color.green(' [!] Possible error at ') + color.yellow(url))
            print(color.green(" [+] Found : \"%s\" at %s" % (pattern, url)))
            found = 0x01
Пример #7
0
def build_db_menu(a_list, b_list, selection, target):
    from core.build_menu import buildmenu
    if selection == "None":
        build_banner("Access Data")
    else:
        build_banner(query_list[-1])
    while True:
        ctr = 0
        while ctr < len(a_list):
            if "Data" in selection.values():
                print(
                    color.green(' [' + str(ctr + 1) + '] ') +
                    color.blue(str(a_list[ctr])))
            elif b_list != "None":
                print(
                    color.green(' [' + str(ctr + 1) + '] ') +
                    color.blue(b_list[ctr]))
            else:
                print(
                    color.green(' [' + str(ctr + 1) + '] ') +
                    color.blue(a_list[ctr]))
            ctr += 1
        if selection != "None":
            print(higher_menu_exit_message)
        print(main_exit_message)
        cmd = input(input_cursor)
        if cmd.lower() == "m":
            found = True
            buildmenu(target, target[0].main_menu, 'Main Menu', '')
        elif cmd == "0":
            del query_list[-1]
            return cmd
        elif int(cmd) <= len(a_list):
            query_list.append(a_list[int(cmd) - 1])
            if selection == "None":
                return a_list[int(cmd) - 1]
            elif selection[a_list[int(cmd) - 1]] == "Data":
                query_db(query_list)
                del query_list[-1]
            else:
                return a_list[int(cmd) - 1]
        else:
            print(error_message)
Пример #8
0
def create_edit_menu(menu, passed_target):
    global description_boolean
    index = 0
    for index, order_header in enumerate(preferred_order):
        for each_menu in menu_objects:
            if (each_menu["header"].find(order_header) != -1):
                string_index = str(index + 1)
                menu[string_index] = each_menu

    # --------------------- Lower Menu -----------------------------
    menu[" "] = {"header" : False} 
    menu[the_all_off_button.upper()] = {"header" : "Turn off all options"}
    menu[the_all_on_button.upper()] = {"header" : "Turn on all options"}
    menu[description_button.upper()] = {"header" : "Description Toggle"}
    menu[exit_button.upper()] = {"header" : ">>> Exit"}
    cmd2num_associator(cmd_list, menu)


    ### --- Shortcut variable to avoid repeated typing of ~[0]["nmap"] --- ###
    # nmap_obj = default_target[0]["nmap"]
    nmap_obj = passed_target[0].cmd_options
    ##########################################################################


    # DYNAMIC TOGGLE UPDATING OF MENU ICONS using {cmd2num} as template to access {menu} values
    for key in cmd2num:
        node = menu[cmd2num[key]]
        header = color.blue(node["header_template"])
        # If target obj has a relevant param set to true, show in menu as on. Otherwise show as turned off
        if(key in nmap_obj and nmap_obj[key] == True):
            nmap_obj[key] = True
            node["header"] = color.yellow(node["on"]) + header
        elif(key in nmap_obj and nmap_obj[key] == True):
            nmap_obj[key] = False
            node["header"] = color.red(node["off"]) + header
        else:
            nmap_obj[key] = False
            node["header"] = color.red(node["off"]) + header

    # Display Menu on screen
    for menu_number in menu:
        each_menu = menu[menu_number]
        single_digit_buffer = ''
        if(menu_number.isdigit() and int(menu_number) < 10):
            single_digit_buffer = ' '
        else:
            single_digit_buffer = ''
        if(each_menu["header"] == False):
            print(' ')
        elif(description_boolean and "description" in each_menu):
            print(color.green(" [") +color.green(menu_number)+color.green("]"), single_digit_buffer, color.blue(each_menu["header"]), color.dark_grey(each_menu["description"]))
        else:
            print(color.green(" [") +color.green(menu_number)+color.green("]"), single_digit_buffer, color.blue(each_menu["header"]))
Пример #9
0
def hashes(target):
    from core.build_menu import buildmenu
    for host in target:
        host.lvl2 = inspect.stack()[0][3]
        host.lvl3 = ''
    try:
        message = input('\n [#] Enter the string to hash:> ')
        print(color.green(' [+] Generating hashes...'))
        md5 = hashlib.md5()
        md5.update(message.encode('utf-8'))

        sha1 = hashlib.sha1()
        sha1.update(message.encode('utf-8'))

        sha224 = hashlib.sha224()
        sha224.update(message.encode('utf-8'))

        sha256 = hashlib.sha256()
        sha256.update(message.encode('utf-8'))

        sha384 = hashlib.sha384()
        sha384.update(message.encode('utf-8'))

        sha512 = hashlib.sha512()
        sha512.update(message.encode('utf-8'))

        print(color.green(" [+] MD5 Hash : ") + color.yellow(md5.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(md5.hexdigest()))
        print(
            color.green(" [+] SHA1 Hash : ") + color.yellow(sha1.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(sha1.hexdigest()))
        print(
            color.green(" [+] SHA224 Hash : ") +
            color.yellow(sha224.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(sha224.hexdigest()))
        print(
            color.green(" [+] SHA256 Hash : ") +
            color.yellow(sha256.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(sha256.hexdigest()))
        print(
            color.green(" [+] SHA384 Hash : ") +
            color.yellow(sha384.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(sha384.hexdigest()))
        print(
            color.green(" [+] SHA512 Hash : ") +
            color.yellow(sha512.hexdigest()))
        save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3,
                  host.name, str(sha512.hexdigest()))

    except EOFError as e:
        #os.system('clear')
        print(e)
    st = input(
        color.blue(' [#] Press') + color.red(' Enter ') +
        color.blue('to continue... '))
    buildmenu(target, target[0].main_menu, 'Main Menu', '')
Пример #10
0
def encodeall(info):
    from core.build_menu import buildmenu
    try:
        st = input(
            color.yellow(' [-] Enter a string to be encoded/decoded :> '))
        m64 = base64.b64encode(st.encode())
        data = m64.decode()
        print(
            color.green(' [+] Base64 Encoded String : ') + color.yellow(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        pass
    try:
        m32 = base64.b32encode(st.encode())
        data = m32.decode()
        print(
            color.green(' [+] Base32 Encoded String : ') + color.yellow(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        pass
    try:
        m16 = base64.b16encode(st.encode())
        data = m16.decode()
        print(
            color.green(' [+] Base16/Hex Encoded String : ') +
            color.yellow(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        print(color.red(" [-] Caught Exception : " + str(e)))
    try:
        m64d = base64.b64decode(st.encode())
        data = m64d.decode()
        print(color.red(' [+] Base64 Decoded String : ') + color.white(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        pass
    try:
        m32d = base64.b32decode(st.encode())
        data = m32d.decode()
        print(color.red(' [+] Base32 Decoded String : ') + color.white(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        pass
    try:
        m16d = base64.b16decode(st.encode())
        data = m16d.decode()
        print(
            color.red(' [+] Base16/Hex Decoded String : ') + color.white(data))
        #save_data(host.database, host.module, host.lvl1, host.lvl2, host.lvl3, host.name, str(data))
    except Exception as e:
        pass
    try:
        data = urllib.parse.quote(st, safe='')
        print(color.green(' [+] URL Encoded String : ') + color.yellow(data))
        data = urllib.parse.quote_plus(st, safe='')
        print(
            color.green(' [+] URL plus Encoded String : ') +
            color.yellow(data))
    except Exception as e:
        pass
    try:
        data = urllib.parse.unquote(st)
        print(color.green(' [+] URL Decoded String : ') + color.yellow(data))
        data = urllib.parse.unquote_plus(st)
        print(
            color.green(' [+] URL plus Decoded String : ') +
            color.yellow(data))
    except Exception as e:
        pass
    # more types of encoding still need added
    # encod = ''
    # stri = list(st)
    # for i in stri:
    #     encod = encod + escape(i)
    # print(color.green(' [+] Encoded String : ')+color.yellow(encod))
    # m = st.encode('base64', 'strict')
    # print(color.green(' [+] Encoded String : ')+color.yellow(m))
    # m = st.encode('hex', 'strict')
    # print(color.green(' [+] Encoded String : ')+color.yellow(m))
    # result = []
    # for char in st:
    #     result.append('\%o' % ord(char))
    # print(color.green(' [+] Octal Encoded String : ')+color.yellow(str(''.join(result))))
    # m = ''.join(format(ord(x),'b') for x in st)
    # print(color.green(' [+] Encoded String : ')+color.yellow(m))
    # m = st.encode('zlib','strict')
    # print(color.green(' [+] Encoded String : ')+color.yellow(m))
    st = input(
        color.blue(' [#] Press') + color.red(' Enter ') +
        color.blue('to continue... '))
    buildmenu(info, info.main_menu, 'Main Menu', '')