def inputSearchUrls():
    print(('\n' + bcolors.HEADER))
    print('  #===================================#')
    print('  #                                   #')
    print('  # Find urls which might is vuln for #')
    print('  #          SQL injections           #')
    print('  #                                   #')
    print('  #===================================#')
    print(('\n' + bcolors.ENDC))
    print('  Basesearch could be: php?id=, php?cat=, e.g.\n')
    basesearch = input(('  Enter base search string: ' + bcolors.OKBLUE))
    searchprovider = input(((bcolors.ENDC + '  Bing or Google (b/g): ') + bcolors.OKBLUE))
    if (searchprovider.lower() not in ('b', 'g')):
        print((bcolors.WARNING + "  - Wrong input - only 'b' and 'g' allowed. Using 'b'"))
        searchprovider = 'b'
    maxperpage = input(((bcolors.ENDC + '  Results per page: ') + bcolors.OKBLUE))
    if (not maxperpage.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 20'))
        maxperpage = 20
    maxpages = input(((bcolors.ENDC + '  Number of pages: ') + bcolors.OKBLUE))
    if (not maxpages.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 10'))
        maxpages = 10
    startpage = input(((bcolors.ENDC + '  Start pages: ') + bcolors.OKBLUE))
    if (not startpage.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 0'))
        startpage = 0
    if (int(startpage) > 0):
        startpage = (int(startpage) - 1)
    timeout = input(((bcolors.ENDC + '  Enter pause between requests: ') + bcolors.OKBLUE))
    if (not timeout.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 6'))
        timeout = 6
    savesearch = input(((bcolors.ENDC + '  Save search (y/N): ') + bcolors.OKBLUE))
    if (savesearch.lower() not in ('', 'y', 'n')):
        print((bcolors.WARNING + "  - Wrong input - only 'y' and 'n' allowed. Using 'n'"))
        savesearch = 'n'
    if (savesearch.lower() == 'y'):
        filename = input(((bcolors.ENDC + '  Filename for search: ') + bcolors.OKBLUE))
        if (not os.path.isfile(filename)):
            os.mknod(filename)
        else:
            appendtofile = input(((bcolors.ENDC + '  File exists, append (Y/n): ') + bcolors.OKBLUE))
            if (appendtofile == 'n'):
                print((bcolors.WARNING + '  - User disallowed appending to resultfile'))
                print((bcolors.WARNING + '  - Please try again with another filename'))
                print((bcolors.WARNING + '  - Exiting'))
                sys.exit()
    else:
        filename = ''
        filename = 'tmpurllist'
    count = str(maxperpage)
    startpage = int(startpage)
    pages = (int(maxpages) + startpage)
    sleeptime = int(timeout)
    string = str(basesearch)
    stringurl = urllib.parse.quote_plus(string)
    print((bcolors.ENDC + '\n  [*]:: Searching'))
    print(((((bcolors.HEADER + bcolors.BOLD) + '\n') + '  [+]  Results') + bcolors.ENDC))
    searchUrlForString(searchprovider, count, startpage, pages, sleeptime, string, stringurl, savesearch, filename)
def inputSearchUrls():
    print(('\n' + bcolors.HEADER))
    print('  #===================================#')
    print('  #                                   #')
    print('  # Find urls which might is vuln for #')
    print('  #          SQL injections           #')
    print('  #                                   #')
    print('  #===================================#')
    print(('\n' + bcolors.ENDC))
    print('  Basesearch could be: php?id=, php?cat=, e.g.\n')
    basesearch = input(('  Enter base search string: ' + bcolors.OKBLUE))
    searchprovider = input(((bcolors.ENDC + '  Bing or Google (b/g): ') + bcolors.OKBLUE))
    if (searchprovider.lower() not in ('b', 'g')):
        print((bcolors.WARNING + "  - Wrong input - only 'b' and 'g' allowed. Using 'b'"))
        searchprovider = 'b'
    maxperpage = input(((bcolors.ENDC + '  Results per page: ') + bcolors.OKBLUE))
    if (not maxperpage.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 20'))
        maxperpage = 20
    maxpages = input(((bcolors.ENDC + '  Number of pages: ') + bcolors.OKBLUE))
    if (not maxpages.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 10'))
        maxpages = 10
    startpage = input(((bcolors.ENDC + '  Start pages: ') + bcolors.OKBLUE))
    if (not startpage.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 0'))
        startpage = 0
    if (int(startpage) > 0):
        startpage = (int(startpage) - 1)
    timeout = input(((bcolors.ENDC + '  Enter pause between requests: ') + bcolors.OKBLUE))
    if (not timeout.isdigit()):
        print((bcolors.WARNING + '  - Wrong input - only numeric values allowed. Using 6'))
        timeout = 6
    savesearch = input(((bcolors.ENDC + '  Save search (y/N): ') + bcolors.OKBLUE))
    if (savesearch.lower() not in (, 'y', 'n')):
        print((bcolors.WARNING + "  - Wrong input - only 'y' and 'n' allowed. Using 'n'"))
        savesearch = 'n'
    if (savesearch.lower() == 'y'):
        filename = input(((bcolors.ENDC + '  Filename for search: ') + bcolors.OKBLUE))
        if (not os.path.isfile(filename)):
            os.mknod(filename)
        else:
            appendtofile = input(((bcolors.ENDC + '  File exists, append (Y/n): ') + bcolors.OKBLUE))
            if (appendtofile == 'n'):
                print((bcolors.WARNING + '  - User disallowed appending to resultfile'))
                print((bcolors.WARNING + '  - Please try again with another filename'))
                print((bcolors.WARNING + '  - Exiting'))
                sys.exit()
    else:
        filename = 
        filename = 'tmpurllist'
    count = str(maxperpage)
    startpage = int(startpage)
    pages = (int(maxpages) + startpage)
    sleeptime = int(timeout)
    string = str(basesearch)
    stringurl = urllib.parse.quote_plus(string)
    print((bcolors.ENDC + '\n  [*]:: Searching'))
    print(((((bcolors.HEADER + bcolors.BOLD) + '\n') + '  [+]  Results') + bcolors.ENDC))
    searchUrlForString(searchprovider, count, startpage, pages, sleeptime, string, stringurl, savesearch, filename)