Commit 4122858d authored by Edvard Rejthar's avatar Edvard Rejthar

#29 using ip instead of localhost

Signed-off-by: Edvard Rejthar's avatarEdvard Rejthar <edvard.rejthar@nic.cz>
parent 43f6307b
......@@ -10,8 +10,8 @@ Scans a website for a sign of a parasite hosts or commands.
4. Perform installation: ```/tmp/mdmaug/INSTALL```
5. Everything should be located in `/opt/mdmaug`.
6. For testing purposes, launch it under newly created `mdmaug` user: `su - mdmaug -c 'python3 -m mdmaug'`
7. Connect in the browser at: https://localhost:5000
8. Try analysing `/static/demopage.html` on local server
7. Connect in the browser at: https://127.0.0.1:5000
8. Try analysing `https://127.0.0.1:5000/static/demopage.html` on local server
9. For deployment, configure nginx properly to be used with flask
### Notes
......
......@@ -75,9 +75,10 @@ class ScanController:
:param url: scanned url
:type cached: True = Any cached version, int = cached version X days old. If None or not found, site will be reanalysed
"""
print("tttttttttt", url)
url = assure_url(url)
if not url:
return f'Invalid URL {escape(url)}'
return f'Invalid URL {escape(url)} {url}'
else:
self.url = url
......
......@@ -29,6 +29,7 @@ def assure_url(url):
""" Assure this is URL and not a shell.
# XX what about other protocols? smb, sftp? Is there a danger?
# XX doesnt work for http://localhost (there is demopage)
:param url: any URL
:return: url, prepended with "http" if no scheme found, or false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment