Added proper wandows support
This commit is contained in:
parent
3344f8ab80
commit
aa03438280
@ -5,5 +5,6 @@
|
|||||||
"colour_good":"green",
|
"colour_good":"green",
|
||||||
"colour_pretty":"cyan",
|
"colour_pretty":"cyan",
|
||||||
"colour_default":"reset",
|
"colour_default":"reset",
|
||||||
|
"colour_none":"",
|
||||||
"country_codes":"codes.csv"
|
"country_codes":"codes.csv"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import files as f
|
import files as f
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
def readConf():
|
def readConf(fileLoc):
|
||||||
try:
|
try:
|
||||||
jsonData = json.loads(f.openFile("config.json").read())
|
jsonData = json.loads(f.openFile(os.path.expanduser(fileLoc)).read())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print e
|
print e
|
||||||
jasonData = ""
|
jasonData = ""
|
||||||
|
|||||||
BIN
libs/config.pyc
BIN
libs/config.pyc
Binary file not shown.
28
main.py
28
main.py
@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/python2.7
|
#!/usr/bin/python2.7
|
||||||
import whois
|
import whois
|
||||||
import readline
|
|
||||||
import signal
|
import signal
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
import json
|
import json
|
||||||
import warnings
|
import warnings
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
from dns import reversename
|
from dns import reversename
|
||||||
from ipwhois.net import Net
|
from ipwhois.net import Net
|
||||||
from ipwhois.asn import IPASN
|
from ipwhois.asn import IPASN
|
||||||
@ -13,15 +14,8 @@ from libs import config
|
|||||||
from libs import colours as gc
|
from libs import colours as gc
|
||||||
from libs import cc
|
from libs import cc
|
||||||
|
|
||||||
running = 1
|
|
||||||
prompt = ': '
|
|
||||||
indent = '~ '
|
|
||||||
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"}
|
|
||||||
|
|
||||||
# Loaded from the config file
|
# Loaded from the config file
|
||||||
jsonData = config.readConf()
|
jsonData = config.readConf("~/config.json")
|
||||||
|
|
||||||
subdomains = jsonData["subdomains"]
|
subdomains = jsonData["subdomains"]
|
||||||
dnsrecords = jsonData["dnsrecords"]
|
dnsrecords = jsonData["dnsrecords"]
|
||||||
@ -32,6 +26,22 @@ colour_default = gc.getColour(jsonData["colour_default"])
|
|||||||
CSVFile = jsonData["country_codes"]
|
CSVFile = jsonData["country_codes"]
|
||||||
# Endconfig block
|
# Endconfig block
|
||||||
|
|
||||||
|
if platform.system().lower() == "linux":
|
||||||
|
import readline
|
||||||
|
else:
|
||||||
|
#do windows stuff here
|
||||||
|
colour_attn = ""
|
||||||
|
colour_good = ""
|
||||||
|
colour_pretty = ""
|
||||||
|
colour_default = ""
|
||||||
|
|
||||||
|
running = 1
|
||||||
|
prompt = ': '
|
||||||
|
indent = '~ '
|
||||||
|
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"}
|
||||||
|
|
||||||
CountryDict = cc.parseCSV(cc.openCSV(CSVFile))
|
CountryDict = cc.parseCSV(cc.openCSV(CSVFile))
|
||||||
|
|
||||||
def domainWhois(inData):
|
def domainWhois(inData):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user