Exemplo n.º 1
0
def check(plugin, passport, passport_type):
    """
    plugin: *.json
    passport: username, email, phone
    passport_type: passport type
    """
    if plugin["request"]["{}_url".format(passport_type)]:
        url = plugin["request"]["{}_url".format(passport_type)].format(passport)
    else:
        return
    app_name = plugin["information"]["name"]
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin["status"]["judge_yes_keyword"]
    judge_no_keyword = plugin["status"]["judge_no_keyword"]
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6",
        "Host": urlparse.urlparse(url).netloc,
        "Referer": url,
    }
    if plugin["request"]["method"] == "GET":
        try:
            content = requests.get(url, headers=headers, timeout=8).content
            content = unicode(content, "utf-8")
        except Exception, e:
            print inRed("\n[-] %s ::: %s\n" % (app_name, str(e)))
            return
        if judge_yes_keyword in content and judge_no_keyword not in content:
            print u"[{}] {}".format(category, ("%s (%s)" % (app_name, website)))
            icon = plugin["information"]["icon"]
            desc = plugin["information"]["desc"]
            output_add(category, app_name, website, passport, passport_type, icon, desc)
        else:
            pass
Exemplo n.º 2
0
Arquivo: sreg.py Projeto: 0ps/Sreg
def check(plugin, passport, passport_type):
    '''
    plugin: *.json
    passport: username, email, phone
    passport_type: passport type
    '''
    if plugin["request"]["{0}_url".format(passport_type)]:
        url = plugin["request"]["{0}_url".format(passport_type)]
    else:
        return
    app_name = plugin['information']['name']
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin['status']['judge_yes_keyword']
    judge_no_keyword = plugin['status']['judge_no_keyword']
    headers = {
                'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6',
                'Host': urlparse.urlparse(url).netloc,
                'Referer': url,
                }
    if plugin['request']['method'] == "GET":
        try:
            content = requests.get(url, headers=headers, timeout=8).content
            content = unicode(content, "utf-8")
        except Exception, e:
            print inRed('\n[-] %s ::: %s\n' % (app_name, str(e)))
            return
        if judge_yes_keyword in content and judge_no_keyword not in content:
            print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
            icon = plugin['information']['icon']
            desc = plugin['information']['desc']
            output_add(category, app_name, website, passport, passport_type, icon, desc)
        else:
            pass
Exemplo n.º 3
0
def check(plugin, target, target_type):
    '''
    plugin: *.json
    target: ip, url
    target_type: target type
    '''
    if plugin["request"]["{0}_url".format(target_type)]:
        url = plugin["request"]["{0}_url".format(target_type)]
        url = url.format(target)
    else:
        return
    app_name = plugin['information']['name']
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin['status']['judge_yes_keyword']
    judge_no_keyword = plugin['status']['judge_no_keyword']
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6',
        'Host': urlparse.urlparse(url).netloc,
        'Referer': url,
    }
    if plugin['request']['method'] == "GET":
        try:
            if url.startswith('https://'):
                from requests.packages.urllib3.exceptions import InsecureRequestWarning
                requests.packages.urllib3.disable_warnings(
                    InsecureRequestWarning)
                content = requests.get(url, headers=headers,
                                       verify=False).content
            else:
                content = requests.get(url, headers=headers, timeout=8).content
        except Exception, e:
            print inRed('\n[-] %s ::: %s\n' % (app_name, str(e)))
            return
        for i_no_keyword in judge_no_keyword:
            if i_no_keyword not in content:
                if judge_yes_keyword[0] == '':
                    print u"[{0}] {1}".format(category, ('%s (%s)' %
                                                         (app_name, website)))
                    icon = plugin['information']['icon']
                    desc = plugin['information']['desc']
                    output_add(category, app_name, website, target,
                               target_type, icon, desc, url)
                    break
                else:
                    for i_yes_keywords in judge_yes_keyword:
                        if i_yes_keywords and i_yes_keywords in content:
                            print u"[{0}] {1}".format(
                                category, ('%s (%s)' % (app_name, website)))
                            icon = plugin['information']['icon']
                            desc = plugin['information']['desc']
                            output_add(category, app_name, website, target,
                                       target_type, icon, desc, url)
                            break
        else:
            pass
Exemplo n.º 4
0
def check(plugin, target, target_type):
    '''
    plugin: *.json
    target: ip, url
    target_type: target type
    '''
    if plugin["request"]["{0}_url".format(target_type)]:
        url = plugin["request"]["{0}_url".format(target_type)]
        url = url.format(target)
    else:
        return
    app_name = plugin['information']['name']
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin['status']['judge_yes_keyword']
    judge_no_keyword = plugin['status']['judge_no_keyword']
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6',
        'Host': urlparse.urlparse(url).netloc,
        'Referer': url,
    }
    if plugin['request']['method'] == "GET":
        try:
            if url.startswith('https://'):
                from requests.packages.urllib3.exceptions import InsecureRequestWarning
                requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
                content = requests.get(url, headers=headers, verify=False).content
            else:
                content = requests.get(url, headers=headers, timeout=8).content
        except Exception, e:
            print inRed('\n[-] %s ::: %s\n' % (app_name, str(e)))
            return
        for i_no_keyword in judge_no_keyword:
            if i_no_keyword not in content:
                if judge_yes_keyword[0] == '':
                    print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
                    icon = plugin['information']['icon']
                    desc = plugin['information']['desc']
                    output_add(category, app_name, website, target, target_type, icon, desc, url)
                    break
                else:
                    for i_yes_keywords in judge_yes_keyword:
                        if i_yes_keywords and i_yes_keywords in content:
                            print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
                            icon = plugin['information']['icon']
                            desc = plugin['information']['desc']
                            output_add(category, app_name, website, target, target_type, icon, desc, url)
                            break
        else:
            pass
Exemplo n.º 5
0
Arquivo: fuzz.py Projeto: tiany/FuzSub
def get_ip(sub_domain, ban_ip, category, domain):
    # Use Method find_ip_from_dns to Fetch ip
    global DNS_LIST, TOP_LEVEL
    if sub_domain == '' or sub_domain.startswith('.'):
        return
    dns_server = random.choice(DNS_LIST)
    try_count = 0
    while True:
        try:
            ip = find_ip_from_dns(dns_server, sub_domain)
            try_count = 0
            break
        except Exception as e:
            print "[-] Get Failed exception %s! " \
                "Regetting... Domain: %s" % (str(e), sub_domain)
            try_count += 1
            time.sleep(3)  # sleep 3 seconds to avoid network error.
    if ip != ban_ip and ip != []:
        print "[+] <Found> %s" % sub_domain
        output_add(sub_domain, ip, category, domain)
        if category == "TOP-LEVEL":
            return sub_domain
Exemplo n.º 6
0
def check(plugin, passport, passport_type):
    '''
    plugin: *.json
    passport: username, email, phone
    passport_type: passport type
    '''
    if plugin["request"]["{}_url".format(passport_type)]:
        url = plugin["request"]["{}_url".format(passport_type)].format(
            passport)
    else:
        return
    app_name = plugin['information']['name']
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin['status']['judge_yes_keyword']
    judge_no_keyword = plugin['status']['judge_no_keyword']
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6',
        'Host': urlparse.urlparse(url).netloc,
        'Referer': url,
    }
    if plugin['request']['method'] == "GET":
        try:
            content = requests.get(url, headers=headers, timeout=8).content
            content = unicode(content, "utf-8")
        except Exception, e:
            print inRed('\n[-] %s ::: %s\n' % (app_name, str(e)))
            return
        if judge_yes_keyword in content and judge_no_keyword not in content:
            print u"[{}] {}".format(category,
                                    ('%s (%s)' % (app_name, website)))
            icon = plugin['information']['icon']
            desc = plugin['information']['desc']
            output_add(category, app_name, website, passport, passport_type,
                       icon, desc)
        else:
            pass
Exemplo n.º 7
0
Arquivo: sreg.py Projeto: 0ps/Sreg
            if v == "":
                post_data[k] = passport
        try:
            content = requests.post(url, data=post_data, headers=headers, timeout=8).content
            encoding = chardet.detect(content)["encoding"]
            if encoding == None:
                encoding = "utf-8"
            content = unicode(content, encoding)
        except Exception, e:
            print e, app_name
            return
        if judge_yes_keyword in content and judge_no_keyword not in content:
            print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
            icon = plugin['information']['icon']
            desc = plugin['information']['desc']
            output_add(category, app_name, website, passport, passport_type, icon, desc)
        else:
            pass
    else:
        print u"{}:::Error!".format(plugin['request']['name'])


def main():
    reload(sys)
    sys.setdefaultencoding("utf-8")
    parser = argparse.ArgumentParser(description="Check how many Platforms the User registered.")
    parser.add_argument("-u", action="store", dest="user")
    parser.add_argument("-e", action="store", dest="email")
    parser.add_argument("-c", action="store", dest="cellphone")
    parser_argument = parser.parse_args()
    banner = '''
Exemplo n.º 8
0
            else:
                content = requests.post(url,
                                        data=post_data,
                                        headers=headers,
                                        timeout=8).content
        except Exception, e:
            print e, app_name
            return
        for i_no_keyword in judge_no_keyword:
            if i_no_keyword not in content:
                if judge_yes_keyword[0] == '':
                    print u"[{0}] {1}".format(category, ('%s (%s)' %
                                                         (app_name, website)))
                    icon = plugin['information']['icon']
                    desc = plugin['information']['desc']
                    output_add(category, app_name, website, target,
                               target_type, icon, desc, url)
                    break
                else:
                    for i_yes_keywords in judge_yes_keyword:
                        if i_yes_keywords and i_yes_keywords in content:
                            print u"[{0}] {1}".format(
                                category, ('%s (%s)' % (app_name, website)))
                            icon = plugin['information']['icon']
                            desc = plugin['information']['desc']
                            output_add(category, app_name, website, target,
                                       target_type, icon, desc, url)
                            break
    else:
        print u"{}:::Error!".format(plugin['request']['name'])

Exemplo n.º 9
0
                                    data=post_data,
                                    headers=headers,
                                    timeout=8).content
            encoding = chardet.detect(content)["encoding"]
            if encoding == None:
                encoding = "utf-8"
            content = unicode(content, encoding)
        except Exception, e:
            print e, app_name
            return
        if judge_yes_keyword in content and judge_no_keyword not in content:
            print u"[{}] {}".format(category,
                                    ('%s (%s)' % (app_name, website)))
            icon = plugin['information']['icon']
            desc = plugin['information']['desc']
            output_add(category, app_name, website, passport, passport_type,
                       icon, desc)
        else:
            pass
    else:
        print u"{}:::Error!".format(plugin['request']['name'])


def main():
    reload(sys)
    sys.setdefaultencoding("utf-8")
    parser = argparse.ArgumentParser(
        description="Check how many Platforms the User registered.")
    parser.add_argument("-u", action="store", dest="user")
    parser.add_argument("-e", action="store", dest="email")
    parser.add_argument("-c", action="store", dest="cellphone")
    parser_argument = parser.parse_args()
Exemplo n.º 10
0
            if url.startswith('https://'):
                from requests.packages.urllib3.exceptions import InsecureRequestWarning
                requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
                content = requests.post(url, data=post_data, headers=headers, verify=False).content
            else:
                content = requests.post(url, data=post_data, headers=headers, timeout=8).content
        except Exception, e:
            print e, app_name
            return
        for i_no_keyword in judge_no_keyword:
            if i_no_keyword not in content:
                if judge_yes_keyword[0] == '':
                    print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
                    icon = plugin['information']['icon']
                    desc = plugin['information']['desc']
                    output_add(category, app_name, website, target, target_type, icon, desc, url)
                    break
                else:
                    for i_yes_keywords in judge_yes_keyword:
                        if i_yes_keywords and i_yes_keywords in content:
                            print u"[{0}] {1}".format(category, ('%s (%s)' % (app_name, website)))
                            icon = plugin['information']['icon']
                            desc = plugin['information']['desc']
                            output_add(category, app_name, website, target, target_type, icon, desc, url)
                            break
    else:
        print u"{}:::Error!".format(plugin['request']['name'])


def main():
    reload(sys)
Exemplo n.º 11
0
def check(plugin, passport, passport_type):
    """
    plugin: *.json
    passport: username, email, phone
    passport_type: passport type
    """
    if plugin["request"]["{0}_url".format(passport_type)]:
        url = plugin["request"]["{0}_url".format(passport_type)]
    else:
        return

    url = str(url).replace("{}", passport)
    app_name = plugin["information"]["name"]
    category = plugin["information"]["category"]
    website = plugin["information"]["website"]
    judge_yes_keyword = plugin["status"]["judge_yes_keyword"].strip()
    judge_no_keyword = plugin["status"]["judge_no_keyword"].strip()
    p_yes, p_no = None, None
    try:
        p_yes = re.compile(judge_yes_keyword)
        p_no = re.compile(judge_no_keyword)
    except Exception as e:
        # print(app_name + " " + str(e))
        pass
    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36",
        "Host": urlparse.urlparse(url).netloc,
        "Referer": url,
    }
    if plugin.has_key("headers"):
        headers.update(plugin["headers"])

    if plugin["request"]["method"] == "GET":
        try:
            content = requests.get(url, headers=headers, timeout=8).content
            content = unicode(content, "utf-8").strip()
            # GET DEBUG
            # print(inRed(app_name + ": " + content + ", " + str(headers)))
            # GET DEBUG FILTER BY APPNAME
            # if app_name == "":
            #     print(inRed(app_name + ": " + content + ", " + str(headers)))
        except Exception as e:
            print(inRed("\n[-] %s ::: %s\n" % (app_name, str(e))))
            return
        flag = (p_yes is not None and re.search(p_yes, content) is not None) or (
            judge_no_keyword != "" and judge_yes_keyword in content
        )
        flag &= not (
            (p_no is not None and re.search(p_no, content) is not None)
            or (judge_no_keyword != "" and judge_no_keyword in content)
        )
        if flag:
            print(u"[{0}] {1}".format(category, ("%s (%s)" % (app_name, website))))
            icon = plugin["information"]["icon"]
            desc = plugin["information"]["desc"]
            output_add(category, app_name, website, passport, passport_type, icon, desc)
        else:
            pass
    elif plugin["request"]["method"] == "POST":
        if plugin["request"].has_key("post_serial"):
            post_data = plugin["request"]["post_serial"]
            post_data = post_data.replace("{}", passport)
        else:
            post_data = plugin["request"]["post_fields"]
            if post_data.values().count("") > 1:
                print("The POST field can only leave a null value.")
                return
            for k, v in post_data.iteritems():
                if v == "":
                    post_data[k] = passport
        try:
            content = requests.post(url, data=post_data, headers=headers, timeout=8).content
            encoding = chardet.detect(content)["encoding"]
            if encoding == None:
                encoding = "utf-8"
            content = unicode(content, encoding).strip()
            # POST DEBUG
            # print(inRed(app_name + ": " + content + ", " + str(headers)))
            # POST DEBUG FILTER BY APPNAME
            # if app_name == "":
            #     print(inRed(app_name + ": " + content + ", " + str(headers)))
        except Exception as e:
            print(inRed("\n[-] %s ::: %s\n" % (app_name, str(e))))
            return
        # if judge_yes_keyword in content and judge_no_keyword not in content:
        flag = (p_yes is not None and re.search(p_yes, content) is not None) or (
            judge_no_keyword != "" and judge_yes_keyword in content
        )
        flag &= not (
            (p_no is not None and re.search(p_no, content) is not None)
            or (judge_no_keyword != "" and judge_no_keyword in content)
        )
        if flag:
            print(u"[{0}] {1}".format(category, ("%s (%s)" % (app_name, website))))
            icon = plugin["information"]["icon"]
            desc = plugin["information"]["desc"]
            output_add(category, app_name, website, passport, passport_type, icon, desc)
        else:
            pass
    else:
        print(u"{}:::Error!".format(plugin["request"]["name"]))