- Please read the DISCLAIMER.md before using or referencing this content.
-
lets say you scan
Windows OS(vmware/virtualbox/other) usingnmaptool (kali) -
N.BBydefault windows OS blockicmprequest (ping) for security. So you have to disable the windows firewall thennmapmight show some ports. -
now after
nmapwhere can i see the logs regarding this scan.
-
Check Windows Event Logs:
-
Open the Event Viewer
-
Press
Win + R, typeeventvwr.mschit Enter.Event Viewer → Windows Logs → Security
or
Event Viewer → Windows Logs → System
or
Applications and Services Logs → Microsoft → Windows → Windows Defender Firewall With Advanced Security → Firewall
-
-
What to Look For:
-
Event ID
5152— Packet was blocked by Windows Filtering Platform -
Event ID
5156— Connection was allowed -
Event ID
5157— Connection attempt was blocked -
Event ID
4688— New process created (maybe triggered by exploitation) -
Event ID
4624/4625— Login attempts (if the scan tries creds) -
These logs will tell you when a connection attempt happened, whether it was allowed or blocked, and which IP tried it.
-
-
Turn on Firewall Logging (Optional but awesome):
-
You can explicitly log dropped or successful connections.
-
Steps:
-
Open
Windows Defender FirewallwithAdvanced Security -
Click
Properties -
Go to the
Private Profile(or theone your VM is on) -
Under
Logging,click Customize… -
Set:
-
Log dropped packets:
Yes -
Log successful connections:
Yes -
Set log path:
C:\Windows\System32\LogFiles\Firewall\pfirewall.log
-
-
-
- Now try scanning again and check that file for logs.
| Event ID | Source | Meaning |
|---|---|---|
| 7040 | Service Control Manager | A service change was made (e.g., service start type changed). |
| 8033 | NetBT | Name release on the network. This happens when NetBIOS name registration changes — common in local network activity. |
| 1014 | DNS Client Events | DNS resolution issue (timeout or unreachable DNS server). |
| 10016 | DistributedCOM | A DCOM app tried to access system components it doesn’t have permission for — noisy, but not a threat unless exploited. |
-
These events are more
systemornetwork-related background noise— they’re not direct evidence of yourNmap scan. -
To catch your
Nmapscan specifically, you need to enable Firewall connection logging or useSysmon+ aSIEMfor deeper visibility.
-
Sysmon(System Monitor) — Core for Visibility-
From
Sysinternals(Microsoft). -
Logs:process creation,network connections,file changes,registry mods. -
Works like
EDR light.
-
-
Event Viewer(Built-in)-
Always keep an eye on:
-
Security logs(logins,process creation) -
System logs -
Firewall logs -
AppCrash logs
-
-
-
Windows Defender Firewall Logging-
Enable dropped/successful connections logging:
C:\Windows\System32\LogFiles\Firewall\pfirewall.log
-
-
Windows Performance Monitor/Resource Monitor-
Use
resmon.exeorperfmon.mscto view:-
Open ports -
Active connections -
CPU,memory,disk usage during an attack
-
-
-
Process Monitor(Procmon)-
Real-time,low-level monitoringof:-
Registry -
File system -
Processes -
Great for catching
persistence techniquesormalware behavior.
-
-
-
TCPView
-
GUI to watch
real-time network connections.- Like
netstatonsteroids.
- Like
-
-
Autoruns
-
See all
autostart locations. -
Catch
malware persistence(registry,scheduled tasks,services).
-
-
Wireshark(optional,advanced packet capture)-
Analyze
packetsduring attacks -
Helps correlate events with
real traffic
-
| Tool | Purpose | Role in Detection |
|---|---|---|
Sysmon |
Logs detailed system events (process creation, network connections, file changes, etc.) |
Acts like an EDR agent |
Wazuh |
Collects, analyzes, and correlates logs from Sysmon, Windows Event Logs, etc. |
Acts like a SIEM engine |
-
Get it from the
official Microsoft Sysinternalssite: -
Download the ZIP file and extract it.
-
Inside you’ll find:
-
Sysmon.exe– for32-bit -
Sysmon64.exe– for64-bit
-
-
-
Use this pre-built config (recommended by most professionals):
-
Click
"Code"→Download ZIPorcloneusingGit. -
Unzip it and find the file:
sysmonconfig-export.xml
-
Open
Command PromptasAdministratorandrun:cd path\to\extracted\Sysmon Sysmon64.exe -accepteula -i path\to\sysmonconfig-export.xml
Example
Sysmon64.exe -accepteula -i C:\Users\YourName\Downloads\sysmonconfig-export.xml
sc query sysmon64- You should see
STATE: RUNNING.
-
Sysmon logsgo toEvent Viewerunder: -
Applications and Services Logs>Microsoft>Windows>Sysmon>Operational
-
Opening
cmdorpowershellping 8.8.8.8 whoami notepad curl http://example.com
-
These should generate
eventslike:-
Event ID1(Process Create) -
Event ID3(Network Connection) -
Event ID11(FileCreate)
-
-
In Event Viewer, click
"Operational" -
Check for entries like:
-
Event ID1:A process was created -
Event ID3:Network connection made -
Event ID10:Process accessed another process(for injection detection)
-
-
You’ll see details like:
-
Image path -
Command line -
Parent process -
Source IP/port(for network)
-
-
If you set up
WazuhasSIEM, it’ll collect theselogsand:-
Alert on
suspicious behaviors -
Give you a
beautiful dashboard
-
-
N.B:
raw Event Viewer is like reading The Matrixthats why we are hookingSysmontowazuh(free open-source SIEM tool)
[ Windows 10 VM ]
└── Sysmon (collects rich logs)
└── Wazuh Agent (forwards logs)
[ Ubuntu VM ]
└── Wazuh Manager (SIEM brain)
└── ElasticSearch + Kibana (dashboard + search)-
Choose Where to Host Wazuh
-
I chose Ubuntu VM
-
make sure it needs at least 4GB RAM, 2 CPU cores
-
-
go to official website
-
Open terminal
curl -sO https://packages.wazuh.com/4.11/wazuh-install.sh
then
sudo bash ./wazuh-install.sh -a
-
wait for the installation to finish.
-
Now use pfficial Recommended Action:
Disable Wazuh Updatessed -i "s/^deb /#deb /" /etc/apt/sources.list.d/wazuh.list apt update -
After installation complete you'll see
https://<wazuh-dashboard-ip>:443 User: admin Password: <ADMIN_PASSWORD>
here
<wazuh-dashboard-ip>is your Ubuntu ip -
Now open browser and type
https://<wazuh-dashboard-ip>:443but it will show itsnot secureclickadvanceand continue website. -
You'll see a form then enter your username and password and you'll see
Wazuh dashboard. -
Now you need to add
Wazuh agentinorder to connect with yourWazuh Dasboard.
-
To connect Wazuh agent to Wazhu dasboard you need authentication key. lets see how to generate and connect with Wazhu agent
-
Open terminal in Ubuntu(where you install the Wazhu manager)
sudo /var/ossec/bin/manage_agents
-
You’ll see an interactive menu like this:
**************************************** * Wazuh v4.11.2 Agent manager. * * The following options are available: * **************************************** (A)dd an agent (A). (E)xtract key for an agent (E). (L)ist already added agents (L). (R)emove an agent (R). (Q)uit.
-
Next Choose option
Afor create new agentChoose your action: A,E,L,R or Q: A - Adding a new agent (use '\q' to return to the main menu). Please provide the following: * A name for the new agent: name of ur agent (ex. win10-exploit-vm) * The IP Address of the new agent: <Ip address of your windows machine (ex. 198.165.191.121)> Confirm adding it?(y/n): y Agent added with ID 001.
-
Next Choose
Eto Generateauthentication keyfor Created agentChoose your action: A,E,L,R or Q: E Available agents: ID: 001, Name: win10-exploit-vm, IP: 198.165.191.121 Provide the ID of the agent to extract the key (or '\q' to quit): 001 #Provide ID of available agent
Authentication keywill generateAgent key information for '001' is: mcuwywgjyIHdpbjEwLWV4cGxvaXQtdm0xIDE5Mi4xMjEuMTIyLjEgMTgxNGUxNWUyN2FlNj23dIyOTIzZGRmYWNhNzA5MzY2NTUwNWQ3MjhmOTQyNGYwMWmdjdks0NjAxZDE0OWNhZA==
-
Now we are done. lets install
Wazuh agentforWindows 10 machinewhere we installedsymonand coonect with ourWazhu manager(Ubuntu)
-
Download from official Wazuh website
-
You can choose other agents of your choice.but here i am using
windows
-
After installation You'll see pop windows like below
-
Here add
Manager IP(Ubuntu IP) andAuthentication keythat we generated while creatingagent. -
Now
Save -
Click
ManageandStart the ServceandRefresh
-
Open
PowerShellasAdministratorand run:PS C:\Windows\system32> NET START WazuhSvc
-
Check running status
PS C:\Windows\system32> Get-Service WazuhSvc Status Name DisplayName ------ ---- ----------- Running WazuhSvc Wazuh
All Done Now Our Wazuh agent on(Windows 10) now connected to our Wazuh manager on (Ubuntu) and its Up and Running
-
Open
Wazuh ManageronUbuntuand Opendashboardwith yourlogin credentialslikeusernameandpassword -
In HomePage You'll see
ActiveinAgent Summary
- Click
Active
- Now Its connect and You'll see all logs will be show here from windows 10 machine.
| VM | Purpose | Tools |
|---|---|---|
🟥 Kali Linux |
Red team attacker (send payloads, scan) |
Nmap, Metasploit, etc. |
🟦 Windows 10 (Exploit Target) |
Blue team endpoint (log everything) |
Sysmon + Wazuh Agent |
🟨 Ubuntu (Log Analyzer) |
SIEM + Dashboard server |
Wazuh Manager + ES + Kibana |


