OWASP / OWASP/Nettacker

Data missing on /logs/get_json?target=

Open
#766 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.6k
Forks
1.2k
Avg merge
1d 21h
Merged PRs (30d)
16

Description

Please describe the issue or question and share your OS and Python version.


OS: x
Ubuntu
OS Version: x
22.04.2 LTS
Python Version: x
Python 3.10.12

Hi! in my program that i made to use nettacker i would like to replicate a function of the real UI , the function where you go on crawler and click on a host and inside there is a html table with all the events of that host. i currently did it with /logs/get_json?target=192.168.254.12, in response to that i get this json:

[{"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "22", "event": "host: 192.168.254.12 method: tcp_connect_send_and_receive ports: '22' timeout: 3.0 conditions: ssh: - -OpenSSH_", "json_event": {"timeout": 3.0, "host": "192.168.254.12", "ports": "22", "method": "tcp_connect_send_and_receive", "response": {"ssl_flag": false, "conditions_results": {"ssh": ["-OpenSSH_"]}}}}, {"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "3389", "event": "host: 192.168.254.12 method: tcp_connect_send_and_receive ports: '3389' timeout: 3.0 conditions: open_port: - ''", "json_event": {"timeout": 3.0, "host": "192.168.254.12", "ports": "3389", "method": "tcp_connect_send_and_receive", "response": {"ssl_flag": false, "conditions_results": {"open_port": [""]}}}}, {"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "3306", "event": "host: 192.168.254.12 method: tcp_connect_send_and_receive ports: '3306' timeout: 3.0 conditions: mysql: - is not allowed to connect to this MySQL server", "json_event": {"timeout": 3.0, "host": "192.168.254.12", "ports": "3306", "method": "tcp_connect_send_and_receive", "response": {"ssl_flag": false, "conditions_results": {"mysql": ["is not allowed to connect to this MySQL server"]}}}}, {"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "8081", "event": "host: 192.168.254.12 method: tcp_connect_send_and_receive ports: '8081' timeout: 3.0 conditions: http: - HTTP/1.1 400", "json_event": {"timeout": 3.0, "host": "192.168.254.12", "ports": "8081", "method": "tcp_connect_send_and_receive", "response": {"ssl_flag": true, "conditions_results": {"http": ["HTTP/1.1 400"]}}}}, {"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "", "event": "host: 192.168.254.12 method: socket_icmp timeout: 3.0 conditions: host: 192.168.254.12 response_time: 0.0008175373077392578 ssl_flag: false", "json_event": {"timeout": 3.0, "host": "192.168.254.12", "method": "socket_icmp", "response": {"ssl_flag": false, "conditions_results": {"host": "192.168.254.12", "response_time": 0.0008175373077392578, "ssl_flag": false}}}}, {"scan_unique_id": "xlcbpjisyjvzbcgidjzjgqxuiztvtqkg", "target": "192.168.254.12", "port": "8081", "event": "allow_redirects: false headers: User-Agent: Nettacker 0.3.2 TRENT method: get ssl: false timeout: 3.0 url: https://192.168.254.12:8081 conditions: log: '404' status_code: - '404'", "json_event": {"timeout": 3.0, "headers": {"User-Agent": "Nettacker 0.3.2 TRENT"}, "allow_redirects": false, "ssl": false, "url": "https://192.168.254.12:8081", "method": "get", "response": {"conditions_results": {"status_code": ["404"], "log": "404"}}}}]

the problem here is that the module name is missing, if we go on the nettacker UI and press on a host we see a table with the same data that i have in the json but there is also the module name, which i can't figure out where is located.

tablebett

Where i can also find the module name?

When i list all the hosts they all have a module_name array with all the modules but then when i get the json i cannot determine which scan module a event has used, thank you very much!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the /logs/get_json?target= endpoint and compare its response construction with the host-listing data and the UI table for a selected host. Confirm where the module_name array is populated and define done as returning enough module information for each event to match the UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.