summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2014-02-14 12:04:23 +0200
committerFilipp Lepalaan <f@230.to>2014-02-14 12:04:23 +0200
commitb8bbae01544acce8c1e18d612dfb966170c6cfdc (patch)
treef218112dca2ef0a1f5314d958444b2eb90ad9864
parentd1e3944239eda8ce4d171b94234f3e3559186fa1 (diff)
downloadintercheck-b8bbae01544acce8c1e18d612dfb966170c6cfdc.tar.gz
intercheck-b8bbae01544acce8c1e18d612dfb966170c6cfdc.tar.bz2
intercheck-b8bbae01544acce8c1e18d612dfb966170c6cfdc.zip
Fix running behind proxy
-rw-r--r--app.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/app.py b/app.py
index ba29028..29ff502 100644
--- a/app.py
+++ b/app.py
@@ -41,8 +41,9 @@ class ScanHandler(tornado.web.RequestHandler):
out['results'].append({'raw': '* help - shows this help message'})
if cmd == 'nmap':
- logging.debug('SCANNING!')
- result = subprocess.check_output(['nmap', self.request.remote_ip])
+ host = self.request.headers.get('X-Real-IP', self.request.remote_ip)
+ logging.debug('SCANNING %s' % host)
+ result = subprocess.check_output(['nmap', host])
for r in re.finditer(r'(\d+/[a-z]{3})\s([a-z]+)\s+(.+)', result):
t = r.groups()
out['results'].append({