Beispiel #1
0
def linker(target, path, proto, folder, out):
    fullpath = str(folder) + "/" + str(out)
    fulllinks = str(folder) + "/links.txt"
    url = 0
    parsing = 0
    i = 0
    progress = 0
    percent = 0
    nb_lines = total_lines(folder, out)

    if os.path.exists(fullpath):
        print(status.ok(), "File found: " + fullpath)
        f = open(fullpath, 'r')
        if os.path.exists(fulllinks):
            os.remove(fulllinks)
        r = open(fulllinks, 'w+')
        print(status.st(), "Searching Urls")
        line = f.readline()
        while line:
            progress += 1
            sys.stdout.write("Found: " + colors.green() + str(url) +
                             colors.reset() + " Progress: " + colors.cyan() +
                             "%d" % percent + colors.reset() + "%")
            sys.stdout.flush()
            sys.stdout.write('\b' *
                             (7 + 11 + len(str(url)) + len(str(percent))))
            sys.stdout.flush()
            while i < len(line) - 1:
                if line[i] == '/' and line[i -
                                           1] == "\"" and line[i + 1] != '>':
                    while line[i] != "\"" and i < len(line) - 1:
                        r.write(line[i])
                        i += 1
                    r.write('\n')
                    url += 1
                if line[i] == '/' and line[i -
                                           1] == "'" and line[i + 1] != '>':
                    while line[i] != "'" and i < len(line) - 1:
                        r.write(line[i])
                        i += 1
                    r.write('\n')
                i += 1
            i = 0
            line = f.readline()
            percent = ((nb_lines / progress) * 100)
        f.close()
        r.close()
        print("Found: " + colors.green() + str(url) + colors.reset() +
              " Progress: " + colors.cyan() + "%d" % percent + colors.reset() +
              "% => '" + colors.purple() + fulllinks + colors.reset() + "'")
    else:
        print(status.ok(), "File not found: " + fullpath)
Beispiel #2
0
def custom(target):
    script = None
    extracted = None
    choice = input(status.iu() +
                   " Do you want to start custom nmap's scripts [Y|n]: ")

    if choice == 'Y':
        print(status.io(),
              "When you finished type 'exit' to stop 'NMAP' session")
        print(
            status.io(), "Default path of the nmap's scripts: '" +
            colors.purple() + "/usr/share/nmap/scripts" + colors.reset() + "'")
        while script != "exit":
            script = input(status.iu() + " FULL path of the nmap script: ")
            if script != "exit":
                print(status.st(), "Checking the script's file")
                if os.path.exists(script):
                    print(status.ok(), "Script's file found")
                    extracted = extract_script(script)
                    execute(target, extracted)
                else:
                    print(status.ko(), "Script's file no found")
Beispiel #3
0
def iu():
    iu = colors.reset() + "[" + colors.yellow() + " >> " + colors.reset() + "]"
    return (iu)
Beispiel #4
0
def info():
    no = colors.reset() + "[" + colors.white() + "INFO" + colors.reset() + "]"
    return (no)
Beispiel #5
0
def no():
    no = colors.reset() + "[" + colors.red() + " NO " + colors.reset() + "]"
    return (no)
Beispiel #6
0
def st():
    start = colors.reset() + "[" + colors.cyan() + "----" + colors.reset(
    ) + "]"
    return (start)
Beispiel #7
0
def ye():
    ye = colors.reset() + "[" + colors.yellow() + " -> " + colors.reset() + "]"
    return (ye)
Beispiel #8
0
def io():
    io = colors.reset() + "[" + colors.purple() + " ?? " + colors.reset() + "]"
    return (io)
Beispiel #9
0
def ok():
    ok = colors.reset() + "[" + colors.green() + " OK " + colors.reset() + "]"
    return (ok)
Beispiel #10
0
def ko():
    ko = colors.reset() + "[" + colors.red() + " KO " + colors.reset() + "]"
    return (ko)
Beispiel #11
0
def resume(posts, followers, following):
    print("%s %s: %s%s%s Posts | %s%s%s Followers | %s%s%s Following" %
          (status.info(), settings.USER, colors.cyan(), posts, colors.reset(),
           colors.cyan(), followers, colors.reset(), colors.cyan(), following,
           colors.reset()))
Beispiel #12
0
def input():
    iu = colors.reset() + "[" + colors.yellow() + " ~> " + colors.reset() + "]"
    return (iu)
Beispiel #13
0
def error():
    no = colors.reset() + "[" + colors.red() + " E: " + colors.reset() + "]"
    return (no)
Beispiel #14
0
def found():
    ye      = colors.reset() + "[" + colors.yellow() + " ## " + colors.reset() + "]"
    return (ye)