Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def queryvt(self):
if IPInfo.VTAPIKEY == '---Your API Key---':
return {'response_code':0,'verbose_msg':'No API Key'}
parameters = {'ip': self.ip, 'apikey': IPInfo.VTAPIKEY}
url = 'https://www.virustotal.com/vtapi/v2/ip-address/report?%s' % urllib.urlencode(parameters)
response = json.loads(self.__sendrequest(url).read())
return response
def main():
parser = argparse.ArgumentParser(description="Query services for information about an IP Address")
parser.add_argument("ip", help="The target IP address")
parser.add_argument('--vt',dest='vt',action='store_true',help="Query VirusTotal")
parser.add_argument('--blacklists',dest='blacklists',action='store_true',help="Check if the IP exists in any blacklists")
parser.add_argument('--tor',dest='tor',action='store_true',help="Query Tor Services")
parser.add_argument('--all',dest='all',action='store_true',help="Query All Services")
parser.add_argument('--debug',dest='debug',action='store_true',help="Print debug information")
args = parser.parse_args()
ip = IPInfo(args.ip)
print
getipinfo(ip,args.vt)
if args.blacklists or args.all:
print 'Not Implemented'
if args.tor or args.all:
print 'Not Implemented'