feat: Add hostname resolution to Nmap scans

- Add -R flag to Nmap scan options to enable reverse DNS lookup.
- Modify the Nmap processing logic to extract and store hostnames.
- Update PROGRESS.md to reflect the completion of the task.
This commit is contained in:
2025-08-21 12:32:40 -05:00
parent 7e24379fa1
commit 83b25d81a6
3 changed files with 3 additions and 2 deletions

View File

@@ -72,7 +72,7 @@
- [x] Add a log file that only keeps records for the past 24 hours. - [x] Add a log file that only keeps records for the past 24 hours.
- [x] Log all LLM responses to the console. - [x] Log all LLM responses to the console.
- [x] Reduce alerts to only happen between 9am and 12am. - [x] Reduce alerts to only happen between 9am and 12am.
- [ ] Get hostnames of devices in Nmap scan. - [x] Get hostnames of devices in Nmap scan.
- [ ] Filter out RTT fluctuations below 10 seconds. - [ ] Filter out RTT fluctuations below 10 seconds.
- [ ] Filter out temperature fluctuations with differences less than 5 degrees. - [ ] Filter out temperature fluctuations with differences less than 5 degrees.
- [ ] Create a list of known port numbers and their applications for the LLM to check against to see if an open port is a threat - [ ] Create a list of known port numbers and their applications for the LLM to check against to see if an open port is a threat

View File

@@ -13,7 +13,7 @@ DAILY_RECAP_TIME = "20:00"
# Nmap Configuration # Nmap Configuration
NMAP_TARGETS = "192.168.2.0/24" NMAP_TARGETS = "192.168.2.0/24"
NMAP_SCAN_OPTIONS = "-sS -T4" NMAP_SCAN_OPTIONS = "-sS -T4 -R"
# Test Mode (True to run once and exit, False to run continuously) # Test Mode (True to run once and exit, False to run continuously)
TEST_MODE = False TEST_MODE = False

View File

@@ -171,6 +171,7 @@ def get_nmap_scan_results():
host_info = { host_info = {
"ip": host, "ip": host,
"status": scan_data.get("status", {}).get("state", "unknown"), "status": scan_data.get("status", {}).get("state", "unknown"),
"hostname": scan_data.get("hostnames", [{}])[0].get("name", ""),
"open_ports": [] "open_ports": []
} }
if "tcp" in scan_data: if "tcp" in scan_data: