Switched everything to pylon
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from flask import Flask
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
import os
|
||||
|
||||
basedir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config['SECRET_KEY'] = 'super secret key'
|
||||
#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///scanned.db'
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'scanned.db')
|
||||
db = SQLAlchemy(app)
|
||||
|
||||
app.config.from_object(__name__)
|
||||
from app import views
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
from app import db
|
||||
|
||||
class target(db.Model):
|
||||
__tablename__ = 'targets'
|
||||
id = db.Column(db.Integer, primary_key = True)
|
||||
os = db.Column(db.String())
|
||||
hostname = db.Column(db.String())
|
||||
address = db.Column(db.String())
|
||||
ports = db.Column(db.String())
|
||||
|
||||
def __init__(self, os, hostname, address, ports):
|
||||
self.os = os
|
||||
self.hostname = hostname
|
||||
self.address = address
|
||||
self.ports = ports
|
||||
|
||||
def __repr__(self):
|
||||
return '<address %r>' % self.address
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
body{
|
||||
background-color: black;
|
||||
color: black;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-align:center;
|
||||
margin:2% 5% 0 5%;
|
||||
}
|
||||
|
||||
h2{
|
||||
color:gray;
|
||||
padding-bottom:0;
|
||||
}
|
||||
|
||||
#scan-table{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
th{
|
||||
padding:5px;
|
||||
}
|
||||
tr{
|
||||
border:1px solid white;
|
||||
background-color: #E8EDFF;
|
||||
}
|
||||
td{
|
||||
padding:5px;
|
||||
}
|
||||
tr td:last-child{
|
||||
text-align: left;
|
||||
}
|
||||
.table-header{
|
||||
border-bottom:10px solid white;
|
||||
font-weight: bold;
|
||||
background-color: #B9C9FE;
|
||||
}
|
||||
|
||||
|
||||
tbody tr:hover td {
|
||||
background-color: #FFEFC6;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
table tr:last-child td:first-child {
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
table tr:first-child th:first-child {
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
|
||||
table tr:last-child td:last-child {
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
table tr:first-child th:last-child {
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
|
||||
a:hover, a:link, a:visited, a:active{
|
||||
color:gray;
|
||||
text-decoration:none;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
function filter_ports(filter) {
|
||||
let portCol = document.querySelectorAll("tbody tr td:last-child");
|
||||
portCol.forEach((item) => {
|
||||
if(!new RegExp(filter).test(item.innerText)){
|
||||
item.parentNode.style.display = "none";
|
||||
} else {
|
||||
item.parentNode.style.display = "table-row";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.querySelector("#ports").addEventListener("keyup", (event) => {
|
||||
if (event.key === "Enter") {
|
||||
filter_ports(event.srcElement.value);
|
||||
}
|
||||
});
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Page Not Found{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<style type="text/css">
|
||||
body{
|
||||
padding-top: 40px;
|
||||
}
|
||||
h1, p{
|
||||
text-align:center;
|
||||
}
|
||||
h1{
|
||||
font-size:64px;
|
||||
margin:75px 0 50px;
|
||||
}
|
||||
p{
|
||||
font-size:24px;
|
||||
margin:15px 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<h1>404</h1>
|
||||
<p>That page doesn't even exist.</p>
|
||||
<p>Why don't you just <a href="{{ url_for('home') }}">go back home</a>?</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<title>Gutterbox</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="/static/css/style.css" rel="stylesheet">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
{% block css %} {% endblock%}
|
||||
</head>
|
||||
<body>
|
||||
{% block main %}{% endblock %}
|
||||
{% block js %} {% endblock%}
|
||||
</body>
|
||||
<script src="/static/js/table.js"></script>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main %}
|
||||
<h2>This might help</h2>
|
||||
<p style="padding-top:0;"><a href="https://github.com/d4rkr41n"><i>- d4rkr41n</i></a></p>
|
||||
|
||||
<table id="scan-table">
|
||||
<thead>
|
||||
<tr class="table-header">
|
||||
<th>OS</td>
|
||||
<th>HOSTNAME</td>
|
||||
<th>ADDRESS</td>
|
||||
<th><input type="text" name="ports" id="ports" placeholder="ports"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
{% for target in targets %}
|
||||
<tr>
|
||||
{% if target.os == "Windows" %}
|
||||
<td class='windows'><img src='static/media/windows.png'></td>
|
||||
{% elif target.os == "Linux" %}
|
||||
<td class='linux'><img src='static/media/linux.png'></td>
|
||||
{% else %}
|
||||
<td class='linux'><img src='static/media/unsure.png'></td>
|
||||
{% endif %}
|
||||
|
||||
<td>{{ target.hostname }}</td>
|
||||
<td>{{ target.address }}</td>
|
||||
<td>{{ target.ports }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,52 @@
|
||||
"""
|
||||
Flask Documentation: http://flask.pocoo.org/docs/
|
||||
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
|
||||
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
|
||||
This file creates your application.
|
||||
"""
|
||||
|
||||
from app import app, db
|
||||
from flask import render_template, request, redirect, url_for, flash
|
||||
from app.models import target
|
||||
# import sqlite3
|
||||
|
||||
###
|
||||
# Routing for your application.
|
||||
###
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
"""Render website's home page."""
|
||||
targets = db.session.query(target).all()
|
||||
return render_template('home.html', targets=targets)
|
||||
|
||||
###
|
||||
# The functions below should be applicable to all Flask apps.
|
||||
###
|
||||
|
||||
@app.route('/<file_name>.txt')
|
||||
def send_text_file(file_name):
|
||||
"""Send your static text file."""
|
||||
file_dot_text = file_name + '.txt'
|
||||
return app.send_static_file(file_dot_text)
|
||||
|
||||
|
||||
@app.after_request
|
||||
def add_header(response):
|
||||
"""
|
||||
Add headers to both force latest IE rendering engine or Chrome Frame,
|
||||
and also to cache the rendered page for 10 minutes.
|
||||
"""
|
||||
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
|
||||
response.headers['Cache-Control'] = 'public, max-age=600'
|
||||
return response
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(error):
|
||||
"""Custom 404 page."""
|
||||
return render_template('404.html'), 404
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True,host="0.0.0.0",port="8080")
|
||||
Reference in New Issue
Block a user