summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.py4
-rw-r--r--index.html40
2 files changed, 28 insertions, 16 deletions
diff --git a/app.py b/app.py
index b5c092a..79b3fa9 100644
--- a/app.py
+++ b/app.py
@@ -1,4 +1,5 @@
import re
+import logging
import subprocess
import tornado.ioloop
import tornado.web
@@ -14,6 +15,7 @@ class MainHandler(tornado.web.RequestHandler):
class ScanHandler(tornado.web.RequestHandler):
def get(self):
+ logging.debug('SCANNING!')
result = subprocess.check_output(['nmap', self.request.remote_ip])
for r in re.finditer(r'(\d+/[a-z]{3})\s([a-z]+)\s+(.+)', result):
t = r.groups()
@@ -27,4 +29,6 @@ application = tornado.web.Application([
if __name__ == '__main__':
application.listen(8888)
+ logging.basicConfig(level=logging.DEBUG)
+ logging.debug('intercheck ready for action...')
tornado.ioloop.IOLoop.instance().start()
diff --git a/index.html b/index.html
index 89cb1f5..134bbf2 100644
--- a/index.html
+++ b/index.html
@@ -1,19 +1,27 @@
<!DOCTYPE html>
<html>
-<head>
- <title>intercheck 0.001</title>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
- <style type="text/css">
- body {
-
- }
- </style>
-</head>
-<body>
-{% block main %}
- <form method="post" action="/scan/">
- <button type="submit">Go!</button>
- </form>
-{% end %}
-</body>
+ <head>
+ <title>intercheck 0.001</title>
+ <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
+ <style type="text/css">
+ button {
+ width: 100px;
+ height: 50px;
+ }
+ </style>
+ <script type="text/javascript">
+ $(function(){
+ $('button').click(function(){
+ console.log('SCANNING!!!');
+ $.getJSON('/scan/', function(r){
+ console.log(r);
+ });
+ });
+ });
+ </script>
+ </head>
+ <body>
+ <button type="button">Go!</button>
+ <blockquote id="results"></blockquote>
+ </body>
</html>