Fixed some bugs with resolutions.

This commit is contained in:
AccentuSoft
2022-01-25 00:47:53 +02:00
parent 75d12aed1f
commit dd2a376e02
8 changed files with 21 additions and 19 deletions

View File

@@ -24,11 +24,14 @@ class ASNToCIDR:
for entity in entityJsonList:
if entity['Entity Type'] == 'Autonomous System':
ipWithPrefix = entity[list(entity)[2]]
uid = entity['uid']
split_string = ipWithPrefix.split("/", 1)
ipWithOutPrefix = split_string[0]
ASN = entity["AS Number"]
try:
ipWithPrefix = entity['ASN Cidr']
uid = entity['uid']
split_string = ipWithPrefix.split("/", 1)
ipWithOutPrefix = split_string[0]
ASN = entity["AS Number"]
except Exception:
continue
try:
net = Net(ipWithOutPrefix)
except Exception:

View File

@@ -37,7 +37,7 @@ class IPToASN:
'ASN Cidr': results['asn_cidr'],
'Date Created': results['asn_date'],
'Entity Type': 'Autonomous System'},
{uid: {'Resolution': 'Autonomous System Results', 'Notes': ''}}])
{uid: {'Resolution': 'Autonomous System of IP', 'Notes': ''}}])
returnResult.append(
[{'Organization Name': results['asn_registry'], 'Entity Type': 'Organization'},
{index_of_child: {'Resolution': 'ASN Registry', 'Notes': ''}}])

View File

@@ -24,7 +24,7 @@ class IPWhois:
return "The Entity Provided isn't a valid IP Address"
IPobject = IPWhois(primary_field)
response = IPobject.lookup_whois()
return_result.append([{'AS Number': str(response['asn']),
return_result.append([{'AS Number': 'AS' + str(response['asn']),
'ASN Cidr': str(response['asn_cidr']),
'Entity Type': 'Autonomous System'},
{uid: {'Resolution': 'IPWhois', 'Notes': ''}}])

View File

@@ -6,10 +6,9 @@ class IPQualityScore_Email:
description = "Find information about the location of a given IP Address or Validate an Email Address"
originTypes = {'Email Address'}
resultTypes = {'Phrase', 'Person', 'Email Address'}
parameters = {'IPQualityScore Private Key': {'description': 'Enter your private key under your profile after'
parameters = {'IPQualityScore Private Key': {'description': 'Enter your private key under your profile after '
'signing up on https://ipqualityscore.com. The limit '
'per month is '
'5000 lookups',
'per month is 5000 lookups.',
'type': 'String',
'value': '',
'global': True}}

View File

@@ -6,13 +6,12 @@ class IPQualityScore_IP:
description = "Find information about the location of a given IP Address or Validate an Email Address"
originTypes = {'IP Address'}
resultTypes = {'Phrase', 'Autonomous System', 'Geocordinates', 'Organization', 'Country', 'City'}
parameters = {'IPQualityScore Private Key': {'description': 'Enter your private key under your profile after'
parameters = {'IPQualityScore Private Key': {'description': 'Enter your private key under your profile after '
'signing up on https://ipqualityscore.com. The limit '
'per month is '
'5000 lookups',
'per month is 5000 lookups.',
'type': 'String',
'value': ''},
'global': True}
'value': '',
'global': True}}
def resolution(self, entityJsonList, parameters):
import requests

View File

@@ -1,2 +1,3 @@
pycountry
requests
requests
requests_futures

View File

@@ -34,7 +34,7 @@ class ShodanIPScan:
'Entity Type': 'City'},
{uid: {'Resolution': 'Shodan IP City', 'Notes': ''}}])
if host.get('asn') is not None:
return_result.append([{'AS Number': host['asn'],
return_result.append([{'AS Number': 'AS' + host['asn'],
'Entity Type': 'Autonomous System'},
{uid: {'Resolution': 'Shodan IP AS Number', 'Notes': ''}}])
return_result.append([{'Label': host['ip_str'] + " Location",

View File

@@ -6,8 +6,8 @@ class VirusTotal_IP_Address:
description = "Find information about a IP address using VirusTotal.com"
originTypes = {"IP Address"}
resultTypes = {"Country", "Company", "Autonomous System"}
parameters = {'VirusTotal API Key': {'description': 'Enter your api key under your profile after'
' signing up on https://virustotal.com. '
parameters = {'VirusTotal API Key': {'description': 'Enter your api key under your profile after '
'signing up on https://virustotal.com. '
'Free usage of the API is limited to 1,000 requests '
'with a rate of 4 per minute.',
'type': 'String',