def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: self.cymon_api_key = helpers.config_section_map("Cymon")["api_key"] self.cymon_api = Cymon(self.cymon_api_key) except Exception: self.cymon_api = Cymon() click.secho("[!] Did not find a Cymon API key.",fg="yellow") try: self.urlvoid_api_key = helpers.config_section_map("URLVoid")["api_key"] except Exception: self.urlvoid_api_key = "" click.secho("[!] Did not find a URLVoid API key.",fg="yellow")
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: self.cymon_api_key = helpers.config_section_map("Cymon")["api_key"] self.cymon_api = Cymon(self.cymon_api_key) except Exception: self.cymon_api = Cymon() click.secho("[!] Did not find a Cymon API key.", fg="yellow") try: self.urlvoid_api_key = helpers.config_section_map( "URLVoid")["api_key"] except Exception: self.urlvoid_api_key = "" click.secho("[!] Did not find a URLVoid API key.", fg="yellow")
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: shodan_api_key = helpers.config_section_map("Shodan")["api_key"] self.shoAPI = shodan.Shodan(shodan_api_key) except Exception: self.shoAPI = None print(yellow("[!] Did not find a Shodan API key.")) try: self.cymon_api_key = helpers.config_section_map("Cymon")["api_key"] self.cyAPI = Cymon(self.cymon_api_key) except Exception: self.cyAPI = Cymon() print( yellow( "[!] Did not find a Cymon API key, so proceeding without API auth." )) try: self.urlvoid_api_key = helpers.config_section_map( "URLVoid")["api_key"] except Exception: self.urlvoid_api_key = "" print(yellow("[!] Did not find a URLVoid API key.")) try: self.contact_api_key = helpers.config_section_map( "Full Contact")["api_key"] except Exception: self.contact_api_key = None print(yellow("[!] Did not find a Full Contact API key.")) try: self.censys_api_id = helpers.config_section_map("Censys")["api_id"] self.censys_api_secret = helpers.config_section_map( "Censys")["api_secret"] self.CEN_API_URL = "https://censys.io/api/v1" except Exception: self.cenCertAPI = None self.cenAddAPI = None print(yellow("[!] Did not find a Censys API ID/secret.")) try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] except Exception: self.chrome_driver_path = None try: self.boto3_client = boto3.client('s3') # Test connecting to S3 with the creds supplied to `aws configure` self.boto3_client.head_bucket(Bucket="hostmenow") except Exception: self.boto3_client = None print( yellow( "[!] Could not create an AWS client with the supplied secrets." ))
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: consumer_key = helpers.config_section_map( "Twitter")["consumer_key"] consumer_key_secret = helpers.config_section_map( "Twitter")["key_secret"] access_token = helpers.config_section_map( "Twitter")["access_token"] access_token_secret = helpers.config_section_map( "Twitter")["token_secret"] twit_auth = tweepy.OAuthHandler(consumer_key, consumer_key_secret) twit_auth.set_access_token(access_token, access_token_secret) self.twit_api = tweepy.API(twit_auth) except Exception: self.twit_api = None print(yellow("[!] Could not setup OAuth for Twitter API.")) try: self.emailhunter_api_key = helpers.config_section_map( "EmailHunter")["api_key"] except Exception: self.emailhunter_api_key = "" print(yellow("[!] Could not fetch EmailHunter API key.")) try: self.contact_api_key = helpers.config_section_map( "Full Contact")["api_key"] except Exception: self.contact_api_key = "" print(yellow("[!] Could not fetch Full Contact API key.")) try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] # Try loading the driver as a test browser = webdriver.Chrome(executable_path=self.chrome_driver_path) browser.close() print(green("[*] Chrome web driver test was successful!")) # Catch issues with the web driver or path except WebDriverException: self.chrome_driver_path = None print( yellow( "[!] There was a problem with the specified Chrome web driver in your \ keys.config! Please check it. For now ODIN will try to use PhantomJS for HaveIBeenPwned." )) # Catch issues loading the value from the config file except Exception: self.chrome_driver_path = None print( yellow( "[!] Could not load a Chrome webdriver for Selenium, so we will tryuse \ to use PantomJS for haveIBeenPwned."))
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: consumer_key = helpers.config_section_map("Twitter")["consumer_key"] consumer_key_secret = helpers.config_section_map("Twitter")["key_secret"] access_token = helpers.config_section_map("Twitter")["access_token"] access_token_secret = helpers.config_section_map("Twitter")["token_secret"] twit_auth = tweepy.OAuthHandler(consumer_key, consumer_key_secret) twit_auth.set_access_token(access_token, access_token_secret) self.twit_api = tweepy.API(twit_auth) except Exception: self.twit_api = None print(yellow("[!] Could not setup OAuth for Twitter API.")) try: self.emailhunter_api_key = helpers.config_section_map("EmailHunter")["api_key"] except Exception: self.emailhunter_api_key = "" print(yellow("[!] Could not fetch EmailHunter API key.")) try: self.contact_api_key = helpers.config_section_map("Full Contact")["api_key"] except Exception: self.contact_api_key = "" print(yellow("[!] Could not fetch Full Contact API key."))
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: shodan_api_key = helpers.config_section_map("Shodan")["api_key"] self.shoAPI = shodan.Shodan(shodan_api_key) except Exception: self.shoAPI = None print(yellow("[!] Did not find a Shodan API key.")) try: self.cymon_api_key = helpers.config_section_map("Cymon")["api_key"] self.cyAPI = Cymon(self.cymon_api_key) except Exception: self.cyAPI = Cymon() print( yellow( "[!] Did not find a Cymon API key, so proceeding without API auth." )) try: self.urlvoid_api_key = helpers.config_section_map( "URLVoid")["api_key"] except Exception: self.urlvoid_api_key = "" print(yellow("[!] Did not find a URLVoid API key.")) try: self.contact_api_key = helpers.config_section_map( "Full Contact")["api_key"] except Exception: self.contact_api_key = None print(yellow("[!] Did not find a Full Contact API key.")) try: censys_api_id = helpers.config_section_map("Censys")["api_id"] censys_api_secret = helpers.config_section_map( "Censys")["api_secret"] self.cenCertAPI = censys.certificates.CensysCertificates( api_id=censys_api_id, api_secret=censys_api_secret) self.cenAddAPI = censys.ipv4.CensysIPv4( api_id=censys_api_id, api_secret=censys_api_secret) except Exception: self.cenCertAPI = None self.cenAddAPI = None print(yellow("[!] Did not find a Censys API ID/secret.")) try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] except Exception: self.chrome_driver_path = None
def setup_database_conn(): """Function to setup the database connection to the Neo4j project containing the BloodHound data. """ try: database_uri = helpers.config_section_map("Database")["uri"] database_user = helpers.config_section_map("Database")["username"] database_pass = helpers.config_section_map("Database")["password"] print( yellow( "[*] Attempting to connect to your Neo4j project using {}:{} @ {}." .format(database_user, database_pass, database_uri))) neo4j_driver = GraphDatabase.driver(database_uri, auth=(database_user, database_pass)) return neo4j_driver except Exception: neo4j_driver = None print( red("[!] Could not create a database connection using the details provided in \ your database.config! Please check the URI, username, and password. lso, make sure your Neo4j \ project is running.")) exit()
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect settings from the config file try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] # Try loading the driver as a test self.chrome_options = Options() self.chrome_options.add_argument("--headless") self.chrome_options.add_argument("--window-size=1920x1080") self.chrome_options.add_argument('--ignore-certificate-errors') self.browser = webdriver.Chrome( chrome_options=self.chrome_options, executable_path=self.chrome_driver_path) self.browser_capable = True # Catch issues with the web driver or path except WebDriverException: self.chrome_driver_path = None self.browser_capable = False # Catch issues loading the value from the config file except Exception: self.chrome_driver_path = None self.browser_capable = False if self.browser_capable is False: try: self.browser = webdriver.PhantomJS() self.browser_capable = True print( green( "[*] PhantomJS for web screenshots test was successful!" )) except WebDriverException: self.chrome_driver_path = None self.browser_capable = False print( red("[*] PhantomJS test failed, so we won't take web screenshots." )) except Exception: self.chrome_driver_path = None self.browser_capable = False print( red("[*] PhantomJS test failed, so we won't take web screenshots." ))
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect settings from the config file try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] # Try loading the driver as a test browser = webdriver.Chrome(executable_path=self.chrome_driver_path) browser.close() print(green("[*] Chrome web driver test was successful!")) self.browser_capable = True # Catch issues with the web driver or path except WebDriverException: self.chrome_driver_path = None self.browser_capable = False # Catch issues loading the value from the config file except Exception: self.chrome_driver_path = None self.browser_capable = False if self.browser_capable is False: print( yellow( "[*] Chrome web driver test failed with the provided web driver \ executable. We will try PhantomJS.")) try: webdriver.PhantomJS() self.browser_capable = True print(green("[*] PhantomJS test was successful!")) except WebDriverException: self.chrome_driver_path = None self.browser_capable = False print( red("[*] PhantomJS test failed, so we won't take web screenshots." )) except Exception: self.chrome_driver_path = None self.browser_capable = False print( red("[*] PhantomJS test failed, so we won't take web screenshots." ))
def __init__(self): """Everything that should be initiated with a new object goes here.""" # Collect the API keys from the config file try: shodan_api_key = helpers.config_section_map("Shodan")["api_key"] self.shodan_api = shodan.Shodan(shodan_api_key) except Exception: self.shodan_api = None print(yellow("[!] Did not find a Shodan API key.")) try: self.cymon_api_key = helpers.config_section_map("Cymon")["api_key"] self.cymon_api = Cymon(self.cymon_api_key) except Exception: self.cymon_api = Cymon() print( yellow( "[!] Did not find a Cymon API key, so proceeding without API auth." )) try: self.urlvoid_api_key = helpers.config_section_map( "URLVoid")["api_key"] except Exception: self.urlvoid_api_key = "" print(yellow("[!] Did not find a URLVoid API key.")) try: self.contact_api_key = helpers.config_section_map( "Full Contact")["api_key"] except Exception: self.contact_api_key = None print(yellow("[!] Did not find a Full Contact API key.")) try: self.censys_api_id = helpers.config_section_map("Censys")["api_id"] self.censys_api_secret = helpers.config_section_map( "Censys")["api_secret"] self.censys_api_endpoint = "https://censys.io/api/v1" except Exception: self.censys_api_id = None self.censys_api_secret = None self.censys_api_endpoint = None print(yellow("[!] Did not find a Censys API ID/secret.")) try: self.chrome_driver_path = helpers.config_section_map( "WebDriver")["driver_path"] # Try loading the driver as a test browser = webdriver.Chrome(executable_path=self.chrome_driver_path) browser.close() print(green("[*] Chrome web driver test was successful!")) # Catch issues with the web driver or path except WebDriverException: self.chrome_driver_path = None print( yellow( "[!] There was a problem with the specified Chrome web driver in your \ keys.config! Please check it. For now ODIN will try to use PhantomJS for Netcraft." )) # Catch issues loading the value from the config file except Exception: self.chrome_driver_path = None print( yellow( "[!] Could not load a Chrome webdriver for Selenium, so we will try \ to use PantomJS for Netcraft.")) try: self.boto3_client = boto3.client('s3') # Test connecting to S3 with the creds supplied to `aws configure` self.boto3_client.head_bucket(Bucket="hostmenow") except Exception: self.boto3_client = None print( yellow( "[!] Could not create an AWS client with the supplied secrets." ))