enhancements

This commit is contained in:
Ali Razmjoo 2021-08-12 11:49:32 +02:00
parent e949fed984
commit 4e83ff2ae4
6 changed files with 9 additions and 7 deletions

1
.data/readme.md Normal file
View File

@ -0,0 +1 @@
### Mettacker's data path

1
.data/results/readme.md Normal file
View File

@ -0,0 +1 @@
### Nettacker's results path

1
.data/tmp/readme.md Normal file
View File

@ -0,0 +1 @@
### Nettacker's tmp path

1
.gitignore vendored
View File

@ -17,7 +17,6 @@ logs.txt
*.log *.log
results.* results.*
.owasp-nettacker* .owasp-nettacker*
.data*
*.html *.html
*.htm *.htm
*.DS_Store *.DS_Store

View File

@ -321,7 +321,7 @@ def get_results():
try: try:
page = int(get_value(flask_request, "page")) page = int(get_value(flask_request, "page"))
if page > 0: if page > 0:
page-=1 page -= 1
except Exception: except Exception:
page = 0 page = 0
return jsonify( return jsonify(
@ -330,7 +330,7 @@ def get_results():
@app.route("/results/get", methods=["GET"]) @app.route("/results/get", methods=["GET"])
def get_result_content(): ## todo: working now but improvement for filename def get_result_content():
""" """
get a result HTML/TEXT/JSON content get a result HTML/TEXT/JSON content
@ -351,7 +351,7 @@ def get_result_content(): ## todo: working now but improvement for filename
@app.route("/results/get_json", methods=["GET"]) @app.route("/results/get_json", methods=["GET"])
def get_results_json(): ##working fine def get_results_json(): # todo: fix
""" """
get host's logs through the API in JSON type get host's logs through the API in JSON type
@ -450,7 +450,7 @@ def get_last_host_logs(): ## working
try: try:
page = int(get_value(flask_request, "page")) page = int(get_value(flask_request, "page"))
if page > 0: if page > 0:
page-=1 page -= 1
except Exception: except Exception:
page = 0 page = 0
return jsonify(last_host_logs(page)), 200 return jsonify(last_host_logs(page)), 200
@ -540,7 +540,7 @@ def go_for_search_logs(): ## working fine
try: try:
page = int(get_value(flask_request, "page")) page = int(get_value(flask_request, "page"))
if page > 0: if page > 0:
page-=1 page -= 1
except Exception: except Exception:
page = 0 page = 0
try: try:

View File

@ -50,7 +50,7 @@ def nettacker_api_config():
# "10.0.0.0/24", # "10.0.0.0/24",
# "192.168.1.1-192.168.1.255" # "192.168.1.1-192.168.1.255"
# ], # ],
"api_access_log": "nettacker.log", "api_access_log": os.path.join(sys.path[0], '.data/nettacker.log'),
} }