This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""


import socket
from threatrecon.api import get_api_key
from threatrecon.query import raw_query_threat_recon


api_key = get_api_key() or 'my api key'
search = raw_input("Please Enter an indicator: ")

results = raw_query_threat_recon(search, api_key)

indicator_meta = []
related_indicators = []


#check host IP if no results
if not results:     # results is an empty list
    try:    # tries to get IP from domain
        iplookup = socket.gethostbyname(search)
        print "***** No results found for this domain..."
        print "***** checking host IP: %s\n" % iplookup
        results = raw_query_threat_recon(iplookup, api_key)
Example #2
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

"""
#This is a POC program that provides examples for using Threat Recon objects. These are only examples for demo purposes

#* replace the api_key variable with your key



from threatrecon import query
from threatrecon.api import get_api_key, APIError

api_key = get_api_key() or 'my API key'
search = 'out.se7.org'

print


a = query.query_threat_recon(search, api_key)
"""
EXAMPLE 1: Get number of results'
"""
print 'EXAMPLE 1: Number of results for search'
print '\n'
print len(a)
print '\n'
"""
Example 2: