Last active
August 29, 2015 14:06
-
-
Save mivade/5b09582176168c80a89b to your computer and use it in GitHub Desktop.
nmapy - Simple web frontend to nmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
# C extensions | |
*.so | |
# Distribution / packaging | |
.Python | |
env/ | |
build/ | |
develop-eggs/ | |
dist/ | |
eggs/ | |
lib/ | |
lib64/ | |
parts/ | |
sdist/ | |
var/ | |
*.egg-info/ | |
.installed.cfg | |
*.egg | |
# PyInstaller | |
# Usually these files are written by a python script from a template | |
# before PyInstaller builds the exe, so as to inject date/other infos into it. | |
*.manifest | |
*.spec | |
# Installer logs | |
pip-log.txt | |
pip-delete-this-directory.txt | |
# Unit test / coverage reports | |
htmlcov/ | |
.tox/ | |
.coverage | |
.cache | |
nosetests.xml | |
coverage.xml | |
# Translations | |
*.mo | |
*.pot | |
# Django stuff: | |
*.log | |
# Sphinx documentation | |
docs/_build/ | |
# PyBuilder | |
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import request, Flask | |
import subprocess | |
app = Flask(__name__) | |
@app.route('/', methods=['GET', 'POST']) | |
def submit(): | |
if request.method == 'POST': | |
pass | |
else: | |
return 'form' | |
@app.route('/<hostname>') | |
def nmap(hostname): | |
out = subprocess.check_output( | |
'nmap {:s}'.format(hostname), | |
shell=True) | |
return '<pre>{:s}</pre>'.format(out) | |
if __name__ == "__main__": | |
app.run(debug=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment