Compare commits
No commits in common. "dnsflask" and "master" have entirely different histories.
25
gui.py
25
gui.py
@ -1,25 +0,0 @@
|
|||||||
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')
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/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.
36
main.py
36
main.py
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/python2.7
|
#!/usr/bin/python2.7
|
||||||
#GUI REWRITE
|
|
||||||
import whois
|
import whois
|
||||||
import signal
|
import signal
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
@ -27,8 +26,6 @@ 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:
|
||||||
@ -82,7 +79,6 @@ 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)
|
||||||
@ -90,51 +86,41 @@ 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:
|
||||||
#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)
|
||||||
#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():
|
||||||
@ -170,8 +156,6 @@ def checkIfIP(in1):
|
|||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
while running == 1:
|
||||||
|
|
||||||
while running == 1:
|
|
||||||
parseInput(raw_input("Please Enter a domain" + prompt) )
|
parseInput(raw_input("Please Enter a domain" + prompt) )
|
||||||
print('\n')
|
print('\n')
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
ipwhois
|
|
||||||
dnspython
|
|
||||||
flask
|
|
||||||
7
static/css/bootstrap.min.css
vendored
7
static/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,46 +0,0 @@
|
|||||||
.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
7
static/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/js/jquery-3.3.1.slim.min.js
vendored
2
static/js/jquery-3.3.1.slim.min.js
vendored
File diff suppressed because one or more lines are too long
5
static/js/popper.min.js
vendored
5
static/js/popper.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,48 +0,0 @@
|
|||||||
<!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