Пример #1
0
def censys_auto_query():
    print """
        Enter Country Code:

        (Examples:TR,RU,USA,IT)
        """

    country_code = raw_input(">>")
    try:
        COUNTRY_CODES[country_code.upper()]
    except KeyError:
        print "Invalid selection, please try again.\n"
        censys_auto_query()

    print """
        Enter Protocol 

        (Examples:ssh, ftp, telnet):
        """
    protocol = raw_input(">>")
    try:
        censys_protocols[protocol]
    except KeyError:
        print "Invalid selection, please try again.\n"
        censys()
    query = query_constructor(country_code, protocol, 'censys')
    res = censys_search(query, protocol)
    if res:
        time.sleep(5)
        main_menu()
    else:
        censys()
Пример #2
0
def censys_auto_query():
    print """
        Enter Country Code:

        (Examples:TR,RU,USA,IT)
        """

    country_code = raw_input(">>")
    try:
        COUNTRY_CODES[country_code.upper()]
    except KeyError:
        print "Invalid selection, please try again.\n"
        censys_auto_query()

    print """
        Enter Protocol 

        (Examples:ssh, ftp, telnet):
        """
    protocol = raw_input(">>")
    try:
        censys_protocols[protocol]
    except KeyError:
        print "Invalid selection, please try again.\n"
        censys()
    query = query_constructor(country_code, protocol, 'censys')
    res = censys_search(query, protocol)
    if res:
        time.sleep(5)
        main_menu()
    else:
        censys()
Пример #3
0
def censys_custom_query():
    print """
    Enter your query:

    (Example: location.country_code: US and tags: scada)
    """
    query = raw_input(">>")
    protocol = "custom"
    res = censys_search(query, protocol)
    if res:
        time.sleep(5)
        main_menu()
    else:
        censys()
Пример #4
0
def censys_custom_query():
    print """
    Enter your query:

    (Example: location.country_code: US and tags: scada)
    """
    query = raw_input(">>")
    protocol = "custom"
    res = censys_search(query, protocol)
    if res:
        time.sleep(5)
        main_menu()
    else:
        censys()