Skip to content

Instantly share code, notes, and snippets.

@mivade
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mivade/5b09582176168c80a89b to your computer and use it in GitHub Desktop.
Save mivade/5b09582176168c80a89b to your computer and use it in GitHub Desktop.
nmapy - Simple web frontend to nmap
*~
# 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/
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