From b8bbae01544acce8c1e18d612dfb966170c6cfdc Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 14 Feb 2014 12:04:23 +0200 Subject: Fix running behind proxy --- app.py | 5 +++-- 1 file 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({ -- cgit v1.2.3