cleanup
This commit is contained in:
parent
aa03438280
commit
0d199267a8
@ -6,7 +6,7 @@ def readConf(fileLoc):
|
|||||||
try:
|
try:
|
||||||
jsonData = json.loads(f.openFile(os.path.expanduser(fileLoc)).read())
|
jsonData = json.loads(f.openFile(os.path.expanduser(fileLoc)).read())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print e
|
print("File not found, you will need to copy the config to your home directory")
|
||||||
jasonData = ""
|
jasonData = ""
|
||||||
return jsonData
|
return jsonData
|
||||||
|
|
||||||
|
|||||||
BIN
libs/config.pyc
BIN
libs/config.pyc
Binary file not shown.
6
main.py
6
main.py
@ -29,7 +29,6 @@ CSVFile = jsonData["country_codes"]
|
|||||||
if platform.system().lower() == "linux":
|
if platform.system().lower() == "linux":
|
||||||
import readline
|
import readline
|
||||||
else:
|
else:
|
||||||
#do windows stuff here
|
|
||||||
colour_attn = ""
|
colour_attn = ""
|
||||||
colour_good = ""
|
colour_good = ""
|
||||||
colour_pretty = ""
|
colour_pretty = ""
|
||||||
@ -39,7 +38,6 @@ running = 1
|
|||||||
prompt = ': '
|
prompt = ': '
|
||||||
indent = '~ '
|
indent = '~ '
|
||||||
whoisrecs = ["NotFound", "DomainName", "Registrar", "Status", "UpdatedDate", "CreationDate", "ExpirationDate", "RegistrantName", "RegistrantEmail", "EligibilityName", "EligibilityType", "EligibilityID", "RegistrantID", "NameServer"]
|
whoisrecs = ["NotFound", "DomainName", "Registrar", "Status", "UpdatedDate", "CreationDate", "ExpirationDate", "RegistrantName", "RegistrantEmail", "EligibilityName", "EligibilityType", "EligibilityID", "RegistrantID", "NameServer"]
|
||||||
#ipData = ["asn_country_code", "asn_description"]
|
|
||||||
ipData = {"asn_country_code":"Country", "asn_description":"Owner"}
|
ipData = {"asn_country_code":"Country", "asn_description":"Owner"}
|
||||||
|
|
||||||
CountryDict = cc.parseCSV(cc.openCSV(CSVFile))
|
CountryDict = cc.parseCSV(cc.openCSV(CSVFile))
|
||||||
@ -49,7 +47,6 @@ def domainWhois(inData):
|
|||||||
return whois.Parser(inData, whoisData[1]).parse()
|
return whois.Parser(inData, whoisData[1]).parse()
|
||||||
|
|
||||||
def signal_handler(singal, frame):
|
def signal_handler(singal, frame):
|
||||||
#print('\n')
|
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
def printWhois(resultData):
|
def printWhois(resultData):
|
||||||
@ -77,7 +74,6 @@ def parseInput(inData):
|
|||||||
if tmpInData == "quit":
|
if tmpInData == "quit":
|
||||||
quit()
|
quit()
|
||||||
if checkIfIP(tmpInData):
|
if checkIfIP(tmpInData):
|
||||||
##IP lookup code
|
|
||||||
lookupIP(tmpInData)
|
lookupIP(tmpInData)
|
||||||
else:
|
else:
|
||||||
lookupDomain(tmpInData)
|
lookupDomain(tmpInData)
|
||||||
@ -132,8 +128,6 @@ def lookupIP(inData):
|
|||||||
ipnet = Net(inData)
|
ipnet = Net(inData)
|
||||||
ipobj = IPASN(ipnet)
|
ipobj = IPASN(ipnet)
|
||||||
results = ipobj.lookup()
|
results = ipobj.lookup()
|
||||||
#for key,value in results.iteritems():
|
|
||||||
# print('%s: %s' % (key, value))
|
|
||||||
for types in ipData:
|
for types in ipData:
|
||||||
if types == "asn_country_code":
|
if types == "asn_country_code":
|
||||||
print(indent + "%s%s:%s\t%s%s" % (colour_pretty, ipData[types], colour_good, CountryDict[results[types]], colour_default))
|
print(indent + "%s%s:%s\t%s%s" % (colour_pretty, ipData[types], colour_good, CountryDict[results[types]], colour_default))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user