Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e62b756155 | |||
| b704eea43f | |||
| 9c8665b716 | |||
| 18eb6cdca4 | |||
| 9d5a9eb391 | |||
|
|
0a33f67577 | ||
|
|
048c46f2bc | ||
| 3c173e851b | |||
|
|
0c9bfd8d3e | ||
|
|
9a91620cf0 | ||
|
|
3b2b0bcff4 | ||
|
|
7f2468e1a9 |
25
gui.py
Normal file
25
gui.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from flask import Flask, render_template, request
|
||||||
|
import main as dnspy
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.config['DEBUG'] = True
|
||||||
|
|
||||||
|
@app.route('/', methods=['POST', 'GET'])
|
||||||
|
def index():
|
||||||
|
if request.method == 'POST':
|
||||||
|
data = request.form['domain']
|
||||||
|
print(data)
|
||||||
|
dnsinfo, whois = dnspy.lookupDomain(str(data))
|
||||||
|
#dnsinfo = {"." : "."}
|
||||||
|
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
|
||||||
|
else:
|
||||||
|
whois = {"Status" : "Please enter a domain"}
|
||||||
|
dnsinfo = {"Stub" : "Data"}
|
||||||
|
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
|
||||||
|
|
||||||
|
@app.route('/domain/', methods=['POST', 'GET'])
|
||||||
|
def getDomain():
|
||||||
|
data = request.form['domain']
|
||||||
|
return data
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(host='0.0.0.0')
|
||||||
7
install.sh
Normal file
7
install.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git clone http://git.vps.benjamyn-testing.com/benjamyn/whois
|
||||||
|
pip install -r requirements.txt
|
||||||
|
cd whois
|
||||||
|
python2 setup.py install
|
||||||
|
|
||||||
Binary file not shown.
BIN
libs/cc.pyc
BIN
libs/cc.pyc
Binary file not shown.
BIN
libs/colours.pyc
BIN
libs/colours.pyc
Binary file not shown.
BIN
libs/config.pyc
BIN
libs/config.pyc
Binary file not shown.
BIN
libs/files.pyc
BIN
libs/files.pyc
Binary file not shown.
40
main.py
40
main.py
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python2.7
|
#!/usr/bin/python2.7
|
||||||
|
#GUI REWRITE
|
||||||
import whois
|
import whois
|
||||||
import signal
|
import signal
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
@ -26,6 +27,8 @@ colour_default = gc.getColour(jsonData["colour_default"])
|
|||||||
CSVFile = jsonData["country_codes"]
|
CSVFile = jsonData["country_codes"]
|
||||||
# Endconfig block
|
# Endconfig block
|
||||||
|
|
||||||
|
dnsrecs = {}
|
||||||
|
|
||||||
if platform.system().lower() == "linux":
|
if platform.system().lower() == "linux":
|
||||||
import readline
|
import readline
|
||||||
else:
|
else:
|
||||||
@ -79,6 +82,7 @@ def parseInput(inData):
|
|||||||
lookupDomain(tmpInData)
|
lookupDomain(tmpInData)
|
||||||
|
|
||||||
def recLookup(inData):
|
def recLookup(inData):
|
||||||
|
global dnsrecs
|
||||||
for dnsrec in dnsrecords:
|
for dnsrec in dnsrecords:
|
||||||
try:
|
try:
|
||||||
data = dns.resolver.query(inData, dnsrec)
|
data = dns.resolver.query(inData, dnsrec)
|
||||||
@ -86,41 +90,51 @@ def recLookup(inData):
|
|||||||
rdataTMP = rdata.to_text().split(" ")
|
rdataTMP = rdata.to_text().split(" ")
|
||||||
if dnsrec != "MX":
|
if dnsrec != "MX":
|
||||||
if dnsrec != "NS":
|
if dnsrec != "NS":
|
||||||
print( indent + colour_pretty + "%s:\t%s%s" % (dnsrec, colour_good, rdata) + colour_default)
|
#print( indent + colour_pretty + "%s:\t%s%s" % (dnsrec, colour_good, rdata) + colour_default)
|
||||||
|
dnsrecs[dnsrec] = rdata
|
||||||
else:
|
else:
|
||||||
tmpData = cnameToA(rdata.to_text())
|
tmpData = cnameToA(rdata.to_text())
|
||||||
print( indent + colour_pretty + "%s:\t%s%s -> %s" % (dnsrec, colour_good, rdata, tmpData) + colour_default)
|
#print( indent + colour_pretty + "%s:\t%s%s -> %s" % (dnsrec, colour_good, rdata, tmpData) + colour_default)
|
||||||
|
dnsrecs[dnsrec] = rdata
|
||||||
else:
|
else:
|
||||||
tmpData = cnameToA(rdataTMP[1])
|
tmpData = cnameToA(rdataTMP[1])
|
||||||
print( indent + colour_pretty + "%s:\t%s%s -> %s" % (dnsrec, colour_good, rdata, tmpData) + colour_default)
|
#print( indent + colour_pretty + "%s:\t%s%s -> %s" % (dnsrec, colour_good, rdata, tmpData) + colour_default)
|
||||||
|
dnsrecs[dnsrec] = rdata
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def subLookup(inData, sub):
|
def subLookup(inData, sub):
|
||||||
|
global dnsrecs
|
||||||
try:
|
try:
|
||||||
data = dns.resolver.query(sub + '.' + inData)
|
data = dns.resolver.query(sub + '.' + inData)
|
||||||
for rdata in data:
|
for rdata in data:
|
||||||
if data.qname == data.canonical_name:
|
if data.qname == data.canonical_name:
|
||||||
print(indent + colour_pretty + "%s:\t%s%s" % (sub, colour_good, rdata) + colour_default)
|
#Old function printed the result now I am returning the result, may add to a dict.
|
||||||
|
#print(indent + colour_pretty + "%s:\t%s%s" % (sub, colour_good, rdata) + colour_default)
|
||||||
|
dnsrecs[sub] = rdata
|
||||||
else:
|
else:
|
||||||
for rdata in dns.resolver.query(sub + '.' + inData, "CNAME"):
|
for rdata in dns.resolver.query(sub + '.' + inData, "CNAME"):
|
||||||
print(indent + colour_pretty + "%s:\t%s%s -> %s" % (sub, colour_good, rdata, cnameToA(sub + "." + inData).to_text()) + colour_default)
|
#print(indent + colour_pretty + "%s:\t%s%s -> %s" % (sub, colour_good, rdata, cnameToA(sub + "." + inData).to_text()) + colour_default)
|
||||||
|
dnsrecs[sub] = rdata
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def lookupDomain(inData):
|
def lookupDomain(inData):
|
||||||
|
global dnsrecs
|
||||||
|
dnsrecs = {}
|
||||||
try:
|
try:
|
||||||
result = domainWhois(inData)
|
result = domainWhois(inData)
|
||||||
except Exception as E:
|
except Exception as E:
|
||||||
print('%s : TLD most likely needs to be configured' % (E))
|
print('%s : TLD most likely needs to be configured' % (E))
|
||||||
result = "Error"
|
result = "Error"
|
||||||
print("\nWhois Information")
|
#print("\nWhois Information")
|
||||||
printWhois(result)
|
#printWhois(result)
|
||||||
print("\nDNS Records")
|
#print("\nDNS Records")
|
||||||
recLookup(inData)
|
recLookup(inData)
|
||||||
print("\nSub Domains")
|
#print("\nSub Domains")
|
||||||
for subs in subdomains:
|
for subs in subdomains:
|
||||||
subLookup(inData, subs)
|
subLookup(inData, subs)
|
||||||
|
return dnsrecs, result
|
||||||
|
|
||||||
def lookupIP(inData):
|
def lookupIP(inData):
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
@ -156,6 +170,8 @@ def checkIfIP(in1):
|
|||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
while running == 1:
|
if __name__ == '__main__':
|
||||||
parseInput(raw_input("Please Enter a domain" + prompt) )
|
|
||||||
print('\n')
|
while running == 1:
|
||||||
|
parseInput(raw_input("Please Enter a domain" + prompt) )
|
||||||
|
print('\n')
|
||||||
|
|||||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ipwhois
|
||||||
|
dnspython
|
||||||
|
flask
|
||||||
7
static/css/bootstrap.min.css
vendored
Normal file
7
static/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
46
static/css/test.css
Normal file
46
static/css/test.css
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
.records {
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 30px;
|
||||||
|
color: #363636;
|
||||||
|
}
|
||||||
|
|
||||||
|
.myNav {
|
||||||
|
background-color: #A4A4A4;
|
||||||
|
color: #363636;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
width: 40%;
|
||||||
|
background-color: #B1B1B1;
|
||||||
|
padding: 2%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row:after {
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buffer {
|
||||||
|
width: 2%;
|
||||||
|
background-color: #363636;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.allmostbiggertext {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 700;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
background-color: #363636;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.col-centered{
|
||||||
|
float: none;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
7
static/js/bootstrap.min.js
vendored
Normal file
7
static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
static/js/jquery-3.3.1.slim.min.js
vendored
Normal file
2
static/js/jquery-3.3.1.slim.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
static/js/popper.min.js
vendored
Normal file
5
static/js/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
48
templates/dns.html
Normal file
48
templates/dns.html
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
|
<!-- Bootstrap CSS -->
|
||||||
|
<link rel="stylesheet" href="/static/css/bootstrap.min.css" crossorigin="anonymous">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/static/css/test.css">
|
||||||
|
<title>DNSPy2: Electric Boogaloo</title>
|
||||||
|
</head>
|
||||||
|
<body class='body'>
|
||||||
|
<div class="navbar myNav">
|
||||||
|
<div class="container" style="width: 100%">
|
||||||
|
<h3>DNSPy2: Electric Boogaloo
|
||||||
|
<form action="/" method='post'></h3>
|
||||||
|
<label class='allmostbiggertext'><span style="display:inline-block; width: 40px;"></span>Domain Name:
|
||||||
|
<input type='Text' name='domain'>
|
||||||
|
<input type='Submit'>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container records justify-content-between row col-centered" style="width: 70%;">
|
||||||
|
<div class="column rounded">
|
||||||
|
<b>Whois Information:</b>
|
||||||
|
{% for key, value in whois.iteritems() %}
|
||||||
|
<li><b>{{ key }} </b> - {{ value }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
<div class="buffer">
|
||||||
|
</div>
|
||||||
|
<div class="column rounded">
|
||||||
|
<b>DNS Records</b>
|
||||||
|
{% for key, value in dnsinfo.iteritems() %}
|
||||||
|
<li><b>{{ key }} </b> - {{ value }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Optional JavaScript -->
|
||||||
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
<script src="/static/js/jquery-3.3.1.slim.min.js" crossorigin="anonymous"></script>
|
||||||
|
<script src="/static/js/popper.min.js" crossorigin="anonymous"></script>
|
||||||
|
<script src="/static/js/bootstrap.min.js" crossorigin="anonymous"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user