コード例 #1
0
def forloop():
    count = 0
    while (count != arguments.depth):
        for var in dotvar:
            for bvar in befvar:
                for word in match.keys():
                    rewrite = bvar + (var * count) + word
                    fullrewrite = re.sub(arguments.string, rewrite,
                                         arguments.url)
                    req = request()
                    req.query(fullrewrite)
                    catchdata = re.findall(str(match[word]), req.raw)
                    if (len(catchdata) != 0):
                        print(bcolors.OKGREEN + "\n[" + str(req.code) + "] " +
                              bcolors.ENDC + fullrewrite)
                        print(" Contents Found: " + str(len(catchdata)))
                    icount = 0
                    # Print match
                    for i in catchdata:
                        print(" " + bcolors.FAIL + str(i) + bcolors.ENDC)
                        icount = icount + 1
                        if (icount > 6):
                            print(" [...]")
                            break
        count = count + 1
コード例 #2
0
ファイル: dotdotslash.py プロジェクト: yassine106/dotdotslash
def forloop():
    if str(arguments.string) not in str(arguments.url):
        sys.exit("String: " + bcolors.WARNING + arguments.string +
                 bcolors.ENDC + " not found in url: " + bcolors.FAIL +
                 arguments.url + "\n")

    count = 0
    duplicate = []
    while (count != (arguments.depth + 1)):
        print("[+] Depth: " + str(count))
        for var in dotvar:
            for bvar in befvar:
                for word in match.keys():
                    rewrite = bvar + (var * count) + word
                    fullrewrite = re.sub(arguments.string, rewrite,
                                         arguments.url)

                    if fullrewrite not in duplicate:
                        req = request()
                        req.query(fullrewrite)
                        catchdata = re.findall(str(match[word]), req.raw)
                        if (len(catchdata) != 0):
                            #print(bcolors.OKGREEN + "\n[" + str(req.code) + "] " + bcolors.ENDC + fullrewrite)
                            print(codecollors(req.code) + fullrewrite)
                            print(" Contents Found: " + str(len(catchdata)))
                        else:
                            if arguments.verbose:
                                print(codecollors(req.code) + fullrewrite)

                        icount = 0
                        # Print match
                        for i in catchdata:
                            print(" " + bcolors.FAIL + str(i) + bcolors.ENDC)
                            icount = icount + 1
                            if (icount > 6):
                                print(" [...]")
                                break
                            if arguments.verbose:
                                time.sleep(0)
                    duplicate.append(fullrewrite)
        count += 1