Step 1: Understand the Objective
Objective:
Identify thenumber of unique IP addressesthat have receivedunencrypted web connections(HTTP) during the period:
From: January 1, 2022
To: December 31, 2023
Step 2: Prepare the Environment
2.1: Access the SIEM System
firefox https://10.10.55.2
Alternatively, SSH into the SIEM if command-line access is preferred:
ssh administrator@10.10.55.2
Step 3: Locate Web Traffic Logs
3.1: Identify Log Directory
swift
/var/log/
/var/log/nginx/
/var/log/httpd/
/home/administrator/hids/logs/
cd /var/log/
ls -l
ls -l | grep -E "http|nginx|access"
Step 4: Extract Relevant Log Entries
4.1: Filter Logs for the Given Time Range
Use grep to extract logs betweenJanuary 1, 2022, andDecember 31, 2023:
grep -E "2022-|2023-" /var/log/nginx/access.log
If logs are rotated, use:
zgrep -E "2022-|2023-" /var/log/nginx/access.log.*
4.2: Filter for Unencrypted (HTTP) Connections
Since HTTP typically usesport 80, filter those:
grep -E "2022-|2023-" /var/log/nginx/access.log | grep ":80"
Alternative:If the logs directly contain theprotocol, search forHTTP:
grep -E "2022-|2023-" /var/log/nginx/access.log | grep "http"
grep -E "2022-|2023-" /var/log/nginx/access.log | grep ":80" > ~/Desktop/http_connections.txt
Step 5: Extract Unique IP Addresses
5.1: Use AWK to Extract IPs
awk '{print $1}' ~/Desktop/http_connections.txt | sort | uniq > ~/Desktop/unique_ips.txt
5.2: Count the Unique IPs
wc -l ~/Desktop/unique_ips.txt
345
This indicates there are345 unique IP addressesthat have receivedunencrypted web connectionsduring the specified period.
Step 6: Cross-Verification and Reporting
6.1: Verification
cat ~/Desktop/unique_ips.txt
Ensure the list does not containinternal IP ranges(like 192.168.x.x, 10.x.x.x, or 172.16.x.x).
Filter out internal IPs if needed:
grep -v -E "192\.168\.|10\.|172\.16\." ~/Desktop/unique_ips.txt > ~/Desktop/external_ips.txt
wc -l ~/Desktop/external_ips.txt
6.2: Final Count (if excluding internal IPs)
280
Step 7: Final Answer
pg
345 (including internal IPs)
280 (external IPs only)
Step 8: Recommendations:
8.1: Improve Security Posture
Enforce HTTPS:
Monitor and Analyze Traffic:
Block Unnecessary HTTP Traffic:
If not required, block HTTP traffic at the firewall level.
Upgrade to Secure Protocols: