示例#1
0
文件: scanopy.py 项目: Oseid/scanopy
 def run(self):
     self.done = False
     anim = ('[=      ]', '[ =     ]', '[  =    ]', '[   =   ]',
      '[    =  ]', '[     = ]', '[      =]', '[      =]',
      '[     = ]', '[    =  ]', '[   =   ]', '[  =    ]',
   '[ =     ]', '[=      ]')
     i = 0
     dot = "."
     while not self.done:
             if len(dot) ==4:
                 dot = "."
                 write("\b\b\b\b")
                 write("     ")
             write("\r"+anim[i % len(anim)]+self.prompt+dot)
             se(1.0/5)
             i+=1
             dot+="."
             if self.done:break
示例#2
0
文件: SpyIp.py 项目: bitPanG98/SpyIp
def main():
    parse.add_option('-t',
                     '-T',
                     '--TARGET',
                     '--target',
                     dest="target",
                     type="string")
    parse.add_option("-a",
                     "-A",
                     "--ALL",
                     '--all',
                     action='store_true',
                     dest="all",
                     default=False)
    parse.add_option("-f",
                     "-F",
                     "--FOUND-ME",
                     '--found-me',
                     action='store_true',
                     dest="fme",
                     default=False)
    parse.add_option("-n",
                     "-N",
                     "--NETWORK",
                     '--network',
                     action='store_true',
                     dest="network",
                     default=False)
    parse.add_option('-c',
                     '-C',
                     '--CHECK',
                     '--check',
                     dest="check",
                     type="string")
    parse.add_option("-e",
                     "-E",
                     "--EXAMPLES",
                     '--examples',
                     action='store_true',
                     dest="ex",
                     default=False)
    parse.add_option("-v",
                     "-V",
                     "--VERSION",
                     action='store_true',
                     dest="ve",
                     default=False)
    (options, args) = parse.parse_args()
    if options.target != None and not options.all:
        target = options.target
        try:
            test = open(target, 'r')
            res = True
        except:
            res = False
        if res == False:
            if target[:8] == "https://":
                host = target[8:]
            elif target[:7] == "http://":
                host = target[7:]
            else:
                host = target
            target = host

            def SpyIp(target):
                if check == True:
                    if ',' in target:
                        targets = target.split(',')
                        print("[@] Scanning [ {} ] Sites...".format(
                            str(len(targets))))
                        for i in targets:
                            try:
                                ip = socket.gethostbyname(i)
                                print("[*] TARGET> {}\n[*] IP> {}\n========".
                                      format(i, ip))
                            except socket.error:
                                print(
                                    "[*] TARGET> {}\n[!] IP> Cod404: Server Not Found !!!"
                                    .format(i))
                            except KeyboardInterrupt:
                                print(" ")
                                break
                    else:
                        print("[~] Connecting....{}\n".format(target))
                        try:
                            ip = socket.gethostbyname(target)
                            print(
                                "[*] TARGET> {}\n[*] IP> {}\n========".format(
                                    target, ip))
                        except socket.error:
                            print(
                                "[~] TARGET> {}\n[!] IP> Cod404: Server Not Found !!!"
                                .format(target))
                        except KeyboardInterrupt:
                            pass
                            exit(1)
                else:
                    print("[!] Please Check Your Internet Connection !!!")
                    exit(1)

            SpyIp(target)
        else:
            targets = open(target, 'r')
            for t in targets:
                t = t.strip()

                def checker():
                    try:
                        if t[:8] == "https://":
                            host = t[8:]
                        elif t[:7] == "http://":
                            host = t[7:]
                        else:
                            host = t

                        ip = socket.gethostbyname(host)
                        run = socket.create_connection((ip, 80), 2)
                        return True
                    except:
                        pass
                    return False

                if checker() == True:
                    if t[:8] == "https://":
                        host = t[8:]
                    elif t[:7] == "http://":
                        host = t[7:]
                    else:
                        host = t
                    try:
                        ip = socket.gethostbyname(host)
                        print("[*] TARGET> {}\n[*] IP> {}\n========".format(
                            t, ip))
                    except socket.error:
                        pass
                    except KeyboardInterrupt:
                        pass

    elif options.target != None and options.all:
        target = options.target
        if check == True:
            try:
                test = open(target, 'r')
                res = True
            except:
                res = False
            if res == True:
                targets = open(target, 'r').readlines()
                for t in targets:
                    t = t.strip()

                    def checker():
                        try:
                            if t[:8] == "https://":
                                host = t[8:]
                            elif t[:7] == "http://":
                                host = t[7:]
                            else:
                                host = t

                            ip = socket.gethostbyname(host)
                            run = socket.create_connection((ip, 80), 2)
                            return True
                        except:
                            pass
                        return False

                    if checker() == True:
                        if t[:8] == "https://":
                            host = t[8:]
                        elif t[:7] == "http://":
                            host = t[7:]
                        else:
                            host = t
                        found = []
                        for address_type in ['A', 'AAAA']:
                            try:
                                answers = dns.resolver.query(
                                    host, address_type)
                                for rdata in answers:
                                    found.append(rdata)
                            except dns.resolver.NoAnswer:
                                pass
                        le = len(found)
                        if len(found) > 0:
                            print("\n[~]> Target[ {} ]".format(t))
                            print("[+] Servers Found({}):".format(str(le)))
                            loop = 1
                            for i in found:
                                print("\tSERVER[{}]   >   {}".format(loop, i))
                                loop += 1
                            print("======================\n")
                        else:
                            print("\n[!] No Servers Found !!!")
                            exit(1)
                    else:
                        pass
            elif ',' in target:
                targets = target.split(',')
                for t in targets:

                    def checker():
                        try:
                            if t[:8] == "https://":
                                host = t[8:]
                            elif t[:7] == "http://":
                                host = t[7:]
                            else:
                                host = t

                            ip = socket.gethostbyname(host)
                            run = socket.create_connection((ip, 80), 2)
                            return True
                        except:
                            pass
                        return False

                    if checker() == True:
                        if t[:8] == "https://":
                            host = t[8:]
                        elif t[:7] == "http://":
                            host = t[7:]
                        else:
                            host = t
                        found = []
                        for address_type in ['A', 'AAAA']:
                            try:
                                answers = dns.resolver.query(
                                    host, address_type)
                                for rdata in answers:
                                    found.append(rdata)
                            except dns.resolver.NoAnswer:
                                pass
                        le = len(found)
                        if len(found) > 0:
                            print("\n[~]> Target[ {} ]".format(t))
                            print("[+] Servers Found({}):".format(str(le)))
                            loop = 1
                            for i in found:
                                print("\tSERVER[{}]   >   {}".format(loop, i))
                                loop += 1
                            print("======================\n")
                        else:
                            print("\n[!] No Servers Found !!!")
                            exit(1)
                    else:
                        pass
            else:

                def checker():
                    try:
                        if target[:8] == "https://":
                            host = target[8:]
                        elif target[:7] == "http://":
                            host = target[7:]
                        else:
                            host = target

                        ip = socket.gethostbyname(host)
                        run = socket.create_connection((ip, 80), 2)
                        return True
                    except:
                        pass
                    return False

                if checker() == True:
                    if target[:8] == "https://":
                        host = target[8:]
                    elif target[:7] == "http://":
                        host = target[7:]
                    else:
                        host = target
                    found = []
                    print("[#]~[Finding Servers IP Of TARGET[ {} ].....\n".
                          format(target))
                    for address_type in ['A', 'AAAA']:
                        try:
                            answers = dns.resolver.query(host, address_type)
                            for rdata in answers:
                                found.append(rdata)
                        except dns.resolver.NoAnswer:
                            pass
                    le = len(found)
                    if len(found) > 0:
                        print("[@]~[Found [ {} ] Server(s) Status> UP ".format(
                            str(le)))
                        print("[+] Servers:\n")
                        loop = 1
                        for i in found:
                            print("SERVER[{}]   >   {}".format(loop, i))
                            loop += 1
                    else:
                        print("\n[!] No Servers Found !!!")
                        exit(1)
                else:
                    print("\n[!] CodeError:404 >> No Server Found !!!")
                    exit(1)
        else:
            print("[!] Please Check Your Internet Connection !!!")
            exit(1)

    elif options.fme:
        print("\n[@]~[Finding Your IPs....\n")
        locipe = locip()
        if locipe != "[!] Error Your Not Connect To Any Network !!!\n[!] Please Check Your Connection!":
            print("[L] Local IP: {}".format(locipe))
        else:
            print(" ")
            print(locipe)
            exit(1)
        pupip()
    elif options.network:
        ips_list = map_network()
        if ips_list != False:
            se(1)
            loop = 1
            up = "UP"

            print("======================================")
            print("ID\t\tIP\t\tSTATUS")
            print("==\t\t==\t\t======")
            for ip in ips_list:
                print("{}\t   {}    \t  {}".format(loop, ip, copy(up)))
                loop += 1

            result = loop - 1
            print("\nI Found <{}> Device In Network !".format(result))
        else:
            print(
                "[!] Error Your Not Connect To Any Network !!!\n[!] Please Check Your Connection!"
            )
            exit(1)

    elif options.ve:
        print("\n[>] Version>> 1.0\nWait New Version Soon :)")
        exit(1)
    elif options.ex:
        sy("printf '\e[8;70;180;t' || mode 800")
        sy("clear || cls")
        examp()
        exit(1)
    elif options.check != None:
        sp = options.check
        serpor(sp)
        exit(1)
    else:
        print(parse.usage)
        exit(1)
示例#3
0
文件: LookTe.py 项目: 5l1v3r1/LookTe
def Main():

    # Create Options
    parse.add_option("-T",
                     "-t",
                     "--TARGET",
                     "--target",
                     dest="TARGET",
                     type="string")
    parse.add_option("-1",
                     "--DOMAINSF",
                     "--domainsf",
                     action="store_true",
                     dest="DOMAINS",
                     default=False)
    parse.add_option("-2",
                     "--IPs",
                     action="store_true",
                     dest="IPS",
                     default=False)
    (options, args) = parse.parse_args()

    ## Start...:)

    if options.TARGET != None and options.DOMAINS:
        TARGET = options.TARGET
        ## Check Target If Exist:
        if CHECKNET == True:

            def checkTAR():
                try:
                    if TARGET[:8] == "https://":
                        host = TARGET[8:]
                    elif TARGET[:7] == "http://":
                        host = TARGET[7:]
                    else:
                        host = TARGET
                    IP = socket.gethostbyname(host)
                    con = socket.create_connection((IP, 80), 2)
                    return True
                except:
                    pass
                return False

            if checkTAR() == True:
                try:
                    user_agent = {
                        "User-Agent":
                        "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0"
                    }
                    url = "https://domains.yougetsignal.com/domains.php"
                    form = {"remoteAddress": "{0}".format(TARGET), "key": ""}
                    req = requests.post(url,
                                        headers=user_agent,
                                        data=form,
                                        timeout=15)
                    res = d(req.text)
                except KeyError:
                    print(
                        "\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m[\033[1;31mERROE\033[1;33m]\033[1;33m Something Went Wrong \033[1;31m!!!"
                    )
                    print(
                        "\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33mDomain/IP Address is incorrect\033[1;31m !!!"
                    )
                    print(
                        "\033[1;31m[\033[1;33m!\033[1;31m]\033[1;32m Try Other Domains Format \033[1;36m(^-^)"
                    )
                    exit(1)
                if res["status"] == "Success":
                    se(0.10)
                    print("\033[1;33m=" * 20 +
                          "\033[1;32m>\033[1;35m Config \033[1;32m<" +
                          "\033[1;33m=" * 20)
                    se(0.10)
                    print(
                        "\033[0;32m[T]\033[1;37m TARGET          : \033[1;31m"
                        + str(TARGET))
                    se(0.10)
                    print(
                        "\033[0;32m[S]\033[1;37m START At        : \033[1;34m"
                        + str(timenow))
                    se(0.10)
                    print(
                        "\033[0;32m[R]\033[1;37m Results Method  : \033[1;33m"
                        + res["resultsMethod"])
                    se(0.10)
                    print(
                        "\033[0;32m[D]\033[1;37m Domain Count    : \033[1;36m"
                        + res["domainCount"])
                    se(0.60)
                    print(
                        "\n\n\033[1;36m[\033[1;31m+\033[1;36m]\033[1;32m Scanning TARGET\033[1;33m...\n"
                    )
                    se(1.1)
                    try:
                        for i in range(len(res["domainArray"])):
                            print(
                                "\033[0;34m[\033[1;34m+\033[0;34m] \033[1;31mDomain Reversed\033[1;33m[\033[1;32m{}\033[1;33m]\033[1;30m   :\033[1;35m {}"
                                .format(i + 1, res["domainArray"][i][0]))
                            if not int(i) > 20:
                                se(.1)
                    except KeyboardInterrupt:
                        print("\033[1;33m[Ctrl+C]\033[1;31mExitng....")
                        se(1)
                        print("\033[1;32mSee You Later (^-^)")
                        exit(1)

                    print("\n\033[1;32m[*]\033[0;32m Shutdown At: \033[1;37m" +
                          str(timenow))
                elif res["status"] == "Fail":
                    if "Invalid remote address" in res["message"]:
                        print(
                            "\n\033[1;31m[!]\033[1;33m Something Went Wrong\033[1;31m !!!"
                        )
                        print(
                            "\033[1;31m[\033[0;31m!\033[1;31m]\033[1;33m Status: \033[1;37m"
                            + res["status"])
                        print("\033[1;33m[\033[0;33m!\033[1;33m] " +
                              res["message"])
                        print(
                            "\n~\033[1;37mTry using www. or remove http:// Or Try Other Domain Format\033[1;33m!"
                        )
                    elif "check limit reached for" in res["message"]:
                        print(
                            "\n\033[1;31m[!]\033[1;33m Something Went Wrong\033[1;31m !!!"
                        )
                        print(
                            "\033[1;31m[\033[0;31m!\033[1;31m]\033[1;33m Status: \033[1;37m"
                            + res["status"])
                        print("\033[1;33m[\033[0;33m!\033[1;33m] " +
                              res["message"])
                        print(
                            "\n~\033[1;37m Try To Change Your IP Address\033[1;33m!"
                        )
                    else:
                        print(
                            "\n\033[1;31m[!]\033[1;33m Something Went Wrong\033[1;31m !!!"
                        )
                        print(
                            "\033[1;31m[\033[0;31m!\033[1;31m]\033[1;33m Status: \033[1;37m"
                            + res["status"])
                        print("\033[1;33m[\033[0;33m!\033[1;33m] " +
                              res["message"])
            else:
                print(
                    "\n\033[1;31m[!]\033[1;33m[ERROR:\033[1;34m 404\033[1;33m] Server Not Found Of[\033[1;34m{}\033[1;33m ]\033[1;31m !!!"
                    .format(TARGET))
                exit(1)
        else:
            print(
                "\n\033[1;31m[!][\033[1;33mERROR\033[1;31m]\033[1;33m Please Check Your Internet Connection\033[1;31m !!!"
            )
            exit(1)

    elif options.TARGET != None and options.IPS:
        target = options.TARGET
        if CHECKNET == True:

            def checker():
                try:
                    if target[:8] == "https://":
                        host = target[8:]
                    elif target[:7] == "http://":
                        host = target[7:]
                    else:
                        host = target

                    ip = socket.gethostbyname(host)
                    run = socket.create_connection((ip, 80), 2)
                    return True
                except:
                    pass
                return False

            if checker() == True:
                if target[:8] == "https://":
                    host = target[8:]
                elif target[:7] == "http://":
                    host = target[7:]
                else:
                    host = target
                loop = 1
                se(0.10)
                print("\033[1;33m=" * 20 +
                      "\033[1;32m>\033[1;35m Config \033[1;32m<" +
                      "\033[1;33m=" * 20)
                se(0.10)
                print("\033[0;32m[T]\033[1;37m TARGET          : \033[1;31m" +
                      str(target))
                se(0.10)
                print("\033[0;32m[S]\033[1;37m START At        : \033[1;34m" +
                      str(timenow))
                se(0.60)
                print(
                    "\n\n\033[1;36m[\033[1;31m+\033[1;36m]\033[1;32m Scanning TARGET\033[1;33m...\n"
                )
                se(1.5)
                print(
                    "\n\033[1;37m[\033[0;32m+\033[1;37m]\033[1;31m:\033[1;32mFound\n\033[1;33m------------------------------"
                )
                try:
                    for address_type in ['A', 'AAAA']:
                        try:
                            answers = dns.resolver.query(host, address_type)
                            for rdata in answers:
                                print(
                                    "\033[1;34m[\033[0;34m+\033[1;34m] \033[1;32mWebServer:[\033[1;33m{}\033[1;32m]\033[1;30m :\033[1;35m {}"
                                    .format(loop, rdata))
                                loop += 1
                        except dns.resolver.NoAnswer:
                            pass
                    resulit = loop - 1
                    print(
                        "\n\n\033[1;32m[\033[0;32m+\033[1;32m]\033[1;37m This Target WebSite Has [\033[1;31m{}\033[1;37m] WebServer![:\033[1;33mStatus:[\033[1;32mUP\033[1;33m]"
                        .format(resulit))
                    print("\033[1;32m[*]\033[0;32m Shutdown At: \033[1;37m" +
                          str(timenow))
                except KeyboardInterrupt:
                    print("\033[1;33m[Ctrl+C]\033[1;31mExitng....")
                    se(1)
                    print("\033[1;32mSee You Later (^-^)")
                    exit(1)
            else:
                print(
                    "\n\033[1;31m[!]\033[1;33m[ERROR:\033[1;34m 404\033[1;33m] Server Not Found Of[\033[1;34m{}\033[1;33m ]\033[1;31m !!!"
                    .format(TARGET))
        else:
            print(
                "\n\033[1;31m[!][\033[1;33mERROR\033[1;31m]\033[1;33m Please Check Your Internet Connection\033[1;31m !!!"
            )

    else:
        print(parse.usage)
        exit(1)
示例#4
0
def convnet(IP):
    if "/" not in IP:
        print(
            "\n[!] Invalid Cdir: Must Select Prefix Number [OR] Subnet Mask !!!\n[*] Examples:\n\tpython convnet.py 192.168.1.1/24\n\tpython convnet.py 172.16.0.0/255.255.0.0"
        )
        exit(1)
    IP = IP.split("/")
    subnet = IP[1]
    IP = IP[0]
    if IP.count(".") < 3 or IP.count(".") > 3:
        print("\nInvalid IPv4: [ {} ]".format(IP))
        exit(1)
    a = IP.split(".")
    if (len(a) == 4) and (1 <= int(a[0]) <= 223) and (int(a[0]) != 127) and (
            int(a[0]) != 169
            or int(a[1]) != 254) and (0 <= int(a[1]) <= 255
                                      and 0 <= int(a[2]) <= 255
                                      and 0 <= int(a[3]) <= 255):
        access = "OK"
    else:
        print("\n[!] Invalid IP: [ {} ]".format(IP))
        exit(1)
    c = 0
    if "." in subnet:
        if not subnet.count(".") == 3:
            print("\n[!] Invalid Subnet Mask[ {} ] ".format(subnet))
            exit(1)
        c += 1
        masks = [255, 254, 252, 248, 240, 224, 192, 128, 0]
        netmask = subnet
        b = netmask.split(".")
        if (len(b) == 4) and (int(b[0]) == 255) and (int(
                b[1]) in masks) and (int(b[2]) in masks) and (int(
                    b[3]) in masks) and (int(b[0]) >= int(b[1]) >= int(b[2]) >=
                                         int(b[3])):
            access = "OK"
            bits = sum([bin(int(x)).count("1") for x in netmask.split(".")])
        else:
            print("\n[!] Invalid Subnet Mask[ {} ] ".format(netmask))
            exit(1)
    else:
        if int(subnet) > 32:
            print(
                "\n[!] Invalid Prefix Number: Must Be less than or equal '32' \n[*] example: 192.168.1.1/24"
            )
            exit(1)
        else:
            netmask = '.'.join([
                str((0xffffffff << (32 - int(subnet)) >> i) & 0xff)
                for i in [24, 16, 8, 0]
            ])
    ##################################### Convert ############################################
    ip2bin = lambda IP: ".".join(
        map(str, ["{0:08b}".format(int(x)) for x in IP.split(".")]))  #
    bin2ip = lambda bnum: ".".join(
        map(str, [int(x, 2) for x in bnum.split(".")]))  #
    ip2int = lambda ip: reduce(lambda a, b: long(a) * 256 + long(b),
                               ip.split('.'))  #
    int2ip = lambda num: '.'.join(
        [str((num >> 8 * i) % 256) for i in [3, 2, 1, 0]])  #
    ##########################################################################################
    wacard = ".".join(map(str, [255 - int(x) for x in netmask.split(".")]))
    net2bin = ip2bin(netmask)
    IP2BIN = ip2bin(IP)
    nid = "".join(
        map(str, [
            int(i) & int(r)
            for i, r in zip("".join(IP2BIN.split(".")), "".join(
                net2bin.split(".")))
        ]))
    netIDbin = ".".join(map(''.join, zip(*[iter(nid)] * 8)))
    if netIDbin.split(".")[0][0] == "0": classType = "A"
    elif netIDbin.split(".")[0][:2] == "10": classType = "B"
    else: classType = "C"

    if classType == "C":
        zeros = net2bin.split(".")[-1].count("0")
        ones = net2bin.split(".")[-1].count("1")
    elif classType == "B":
        zeros = "".join(net2bin.split(".")[-2:]).count("0")
        ones = "".join(net2bin.split(".")[-2:]).count("1")
    else:
        zeros = "".join(net2bin.split(".")[-3:]).count("0")
        ones = "".join(net2bin.split(".")[-3:]).count("1")
    validSubnets = abs(2**ones)
    validHosts = abs(2**zeros)
    usableHosts = abs(2**zeros - 2)
    validsubnets = "{0:,}".format(validSubnets) if len(
        str(validSubnets)) > 4 else validSubnets
    validHost = "{0:,}".format(usableHosts) if len(
        str(usableHosts)) > 4 else usableHosts
    netID = bin2ip(netIDbin)
    inmsk = ''.join([
        bin(~0)[3:] if x == '0' else bin(~1)[4:]
        for x in "".join(net2bin.split("."))
    ])
    broadidbin = "".join(
        map(str, [int(i) | int(r) for i, r in zip(nid, inmsk)]))
    broadidbin = ".".join(map(''.join, zip(*[iter(broadidbin)] * 8)))
    broadid = bin2ip(broadidbin)
    if netID != broadid:
        firstIP = ip2int(netID) + 1
        lastIP = ip2int(broadid) - 1
        firstIP = int2ip(firstIP)
        lastIP = int2ip(lastIP)
    else:
        firstIP = netID
        lastIP = broadid

    # Show Info
    if validSubnets == 1:
        print("\n==========" + "=" * len(IP) + "=" + "=" * len(subnet) +
              "======")
        print(".:: INFO[ {}/{} ] ::.".format(IP, subnet))
        se(0.10)
        print("==========" + "=" * len(IP) + "=" + "=" * len(subnet) +
              "======")
        if c == 0:
            print("  [+] NetMask     :>[ {}".format(netmask))
            se(0.10)
        else:
            print("  [+] NetMask Bits:>[ /{}".format(bits))
            se(0.10)
        print("  [+] WildCardMask:>[ {}".format(wacard))
        se(0.10)
        print("  [+] NetWorkID   :>[ {}".format(netID))
        se(0.10)
        print("  [+] BroadCatID  :>[ {}".format(broadid))
        se(0.10)
        print("  [+] ClassType   :>[ {}".format(classType))
        se(0.10)
        print("  [+] FirstIP     :>[ {}".format(firstIP))
        se(0.10)
        print("  [+] LastIP      :>[ {}".format(lastIP))
        se(0.10)
        print("  [+] UsableHosts :>[ {}".format(validHost))
        se(0.10)
        print("  [+] ValidSubnets:>[ {}".format(validsubnets))
    else:
        n = 1
        print("\n=====================================")
        print("[+]        FLSM  Calculator        [+]")
        print("=====================================")
        print("  [*] SubnetMask    :>[ {}".format(netmask) if c ==
              0 else "  [+] NetMask Bits  :>[ /{}".format(bits))
        print("  [*] WildCardMask  :>[ {}".format(wacard))
        print("  [*] ClassType     :>[ {}".format(classType))
        print("  [*] UsableHosts   :>[ {}".format(validHost))
        print("  [*] UsableSubnets :>[ {}".format(validsubnets))
        print("=====================================")

        for i in xrange(1, validSubnets + 1):
            print("\n[*] Subnet Number:[{}]".format(n))
            print("====================" + '=' * len(str(n)))
            print("  [+] NetWorkID  :>[ {}".format(netID))
            print("  [+] FirstIP    :>[ {}".format(firstIP))
            print("  [+] LastIP     :>[ {}".format(lastIP))
            print("  [+] BroadCatID :>[ {}".format(broadid))
            netID = int2ip(ip2int(broadid) + 1)
            firstIP = int2ip(ip2int(netID) + 1)
            broadid = int2ip(ip2int(broadid) + validHosts)
            lastIP = int2ip(ip2int(broadid) - 1)
            n += 1
示例#5
0
def checkURL(url):
    if cnet() !=True:
        print("\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m Error:\033[1;37m Please Check Your Internet Connection \033[1;31m!!!")
        exit(1)
    try:
        br = mechanize.Browser()
        br.set_handle_robots(False)
        br.addheaders = [("User-agent","Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13")]
        br.open("https://safeweb.norton.com/")
        br.select_form(nr=0)
        br["url"]=url
        br.method="get"
        res = br.submit()
        response = res.get_data()
        ch = "This site has not been tested yet."
        if "Unknown" in response:
            loc = "Unknown"
        else:
            try:
             loc = re.findall(r'</img>&nbsp;[^>]*', response)
             loc = loc[0].strip('</img>&nbsp;')
             loc = loc.strip('</div')
            except:
                loc = "???"
        try:
          status = re.findall(r'<b>[^>]*</b></br>',response)[0].strip('<b></b></br>')
        except:
            status = "???"
        try:
          com = re.findall(r'<label>[^>]*</label>', response)[3].strip('<label></label>')
        except:
            com = "0.0"
        try:
            ratedby = re.findall('<small><div class="marginTopM15">[^>]*</div></small>', response)[0].split()
            ratedby = ratedby[3]
        except:
            ratedby ="0"
        if ch not in response:
         tr1 = re.findall(r'Computer Threats: [^>]*', response)[0].strip('Computer Threats: </li>')
         tr2 = re.findall(r'Identity Threats: [^>]*', response)[0].strip('Identity Threats: </li>')
         tr3 = re.findall(r'Annoyance factors: [^>]*', response)[0].strip('Annoyance factors: </li>')
         tot = re.findall(r'Total threats</b> on this site: [^>]*',response)[0].strip('\t\n              \t\t\t</div')
         tot = tot.strip('Total threats</b>')
         totp = tot.strip('n this site:')
         tot = tot[13:]
        else:
            tr1 = "???"
            tr2 = "???"
            tr3 = "???"
            totp = "???"
        print("\n\033[1;32m[\033[1;37m*\033[1;32m] CheckURL[ \033[1;33m{}\033[1;32m ]\033[1;37m ...\033[1;32mBy[\033[1;37msafeweb.norton.com\033[1;32m]".format(url))
        se(2)
        if status =="UNTESTED":
            se(0.10)
            print("\n\033[1;33m[\033[0;33m?\033[1;33m] WebSite Location :\033[1;31m "+loc)
            se(0.10)
            print("\n\033[1;33m[\033[0;33m?\033[1;33m] WebSite STATUS     :\033[1;31m UNTESTED\033[1;33m ?")
            se(0.10)
            print('  \033[1;33m[\033[1;31m?\033[1;33m] Computer Threats   :\033[1;31m '+tr1)
            se(0.10)
            print('  \033[1;33m[\033[1;31m?\033[1;33m] Identity Threats   :\033[1;31m '+tr2)
            se(0.10)
            print('  \033[1;33m[\033[1;31m?\033[1;33m] Annoyance factors  :\033[1;31m '+tr3)
            se(0.10)
            print('\n\033[1;33m[\033[1;31m?\033[1;33m] Total Site threats :\033[1;31m '+totp)
            se(0.10)
            print('\n  \033[1;33m[\033[1;31m?\033[1;33m] Website Rated    :\033[1;31m '+com)
            se(0.10)
            print('  \033[1;33m[\033[1;31m?\033[1;33m] Rated by         :\033[1;31m '+ratedby+" \033[1;33mUsers")
            se(0.10)
            print("\n\033[1;33m=====> \033[0;33mResult\033[1;33m <=====:\n\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m This \033[1;31m[ \033[1;33m"+url+"\033[1;31m ]\033[1;33m Website Has Not been Tested Yet\033[1;31m!\n")
        elif int(tot) ==0:
            se(0.10)
            print('\n\033[1;32m[\033[1;37m?\033[1;32m]\033[1;37m Website Location   :\033[1;32m '+loc)
            se(0.10)
            print("  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m STATUS : \033[1;32m"+status)
            se(0.10)
            print('  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Computer Threats   :\033[1;32m '+tr1)
            se(0.10)
            print('  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Identity Threats   :\033[1;32m '+tr2)
            se(0.10)
            print('  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Annoyance factors  :\033[1;32m '+tr3)
            se(0.10)
            print('\n\033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Total Site threats :\033[1;32m '+totp)
            se(0.10)
            print('\n  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Website Rated  :\033[1;32m '+com)
            se(0.10)
            print('  \033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Rated By       :\033[1;32m '+ratedby+"\033[1;37m Users")
            se(0.10)
            print("\n\033[1;32m=====> \033[1;36mResult\033[1;32m <=====:\n\033[1;32m[\033[1;37m+\033[1;32m]\033[1;37m Secure And Trusted URL[ \033[1;32m"+url+"\033[1;37m ]\n")
            ask = raw_input("\n\033[1;36m~\033[1;32mOPEN[\033[1;37m {} \033[1;32m]\033[1;33m ?(\033[1;37mY:n\033[1;33m)>\033[1;32m ".format(url))
            while ask=="" or ask is None or ask not in ['Y',"y","yes","YES","n","N","NO","no"]:
                ask = raw_input("\033[1;33m!?~\033[1;31mOPEN[\033[1;37m {} \033[1;31m]\033[1;33m ??(\033[1;37mY:n\033[1;33m)>\033[1;31m ".format(url))
            if ask in ["Y","y","yes","YES"]:
		if "https://" in url or "http://" in url:
                 print("\n\033[1;32m[\033[1;37m+\033[1;32m] \033[1;37mOpening....[ \033[1;32m{}\033[1;37m ]".format(url))
                 se(1)
                 op(url)
                 print("\n\033[1;36m~Done\033[1;32m :)")
		else:
                  print("\n\033[1;32m[\033[1;37m+\033[1;32m] \033[1;37mOpening....[ \033[1;32m{}\033[1;37m ]".format(url))
		  url = "https://"+url
                  se(1)
                  op(url)
                  print("\n\033[1;36m~Done\033[1;32m :)")
            else:
                print("\n\033[1;36m~Done\033[1;32m :)")
                exit(1)
        else:
            se(0.10)
            print('\n\033[1;31m[\033[1;33m@\033[1;31m]\033[1;33m Website Location   :\033[1;31m '+loc)
            se(0.10)
            print("  \033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m STATUS : \033[1;31m"+status)
            se(0.10)
            print('  \033[1;31m[\033[1;33m-\033[1;31m]\033[1;33m Computer Threats   :\033[1;31m '+tr1)
            se(0.10)
            print('  \033[1;31m[\033[1;33m-\033[1;31m]\033[1;33m Identity Threats   :\033[1;31m '+tr2)
            se(0.10)
            print('  \033[1;31m[\033[1;33m-\033[1;31m]\033[1;33m Annoyance factors  :\033[1;31m '+tr3)
            se(0.10)
            print('\n\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m Total Site threats :\033[1;31m '+totp)
            se(0.10)
            print('\n  \033[1;31m[\033[1;33m-\033[1;31m]\033[1;33m Website Rated      :\033[1;31m '+com)
            se(0.10)
            print('  \033[1;31m[\033[1;33m-\033[1;31m]\033[1;33m Rated By           :\033[1;31m '+ratedby+"\033[1;33m Users")
            se(0.10)
            print("\n\033[1;31m=====>\033[1;33mResult\033[1;31m<=====\n\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m Not Secure Bad URL[ \033[1;31m"+url+"\033[1;33m ]\n")         
    except KeyboardInterrupt:
        print("\n\033[1;31m[\033[1;33m!\033[1;31m]\033[1;33m Exiting...")
        se(1.5)
        print("\033[1;36m~\033[1;32mBye: )")
        exit(1)
    except IndexError:
        print("\n\033[1;33m[\033[1;31m!\033[1;33m] Error:\033[1;37m Please Check Your URL\033[1;31m !!!")
        exit(1)
示例#6
0
zfile = zipfile.ZipFile(filename)
passwlist = open(passw,"r").readlines()

loop = 1
print("""
===============> ZipCracker <=================

[$] Start At    :> {}
[>] ZipFile     :> {}
[>] Wordlist    :> {}

[^] Checking.......

""".format(timenow,filename,passw))
se(1)
for password in passwlist:
	password = password.strip()
	try:
	   zfile.extractall(pwd=password)
	   print("[+] Trying Password[{}] : {} ==> Yes".format(loop,password))
	   print("\n[#] Password Found: {}".format(password))
	   print("[$] ShutDown At: {}".format(timenow))
	   break
	except:
	   print("[-] Trying Password[{}] : {} ==> No".format(loop,password))
	   loop +=1
	   se(0.10)

else:
	print("\n[@] Sorry I Can't Found Password In This Wordlist! :(\n[*] Try Other Wordlist :)")