ඔයාගේ network එකට suspicious traffic එකක් එනවා.
Port scan එකක් වෙන්න පුළුවන්.
Exploit attempt එකක් වෙන්න පුළුවන්.
Brute-force pattern එකක් වෙන්න පුළුවන්.
Malware communication එකක් වෙන්න පුළුවන්.
ප්රශ්නය මෙන්න:
Firewall එක traffic එක allow කළාට පස්සේ, “මේ traffic එක suspicious” කියලා හඳුනාගන්නේ කවුද?
එතනට එන්නේ IDS — Intrusion Detection System.
IDS එකේ primary job එක network/host events monitor කරලා, intrusion හෝ security incident එකක් වෙන්න පුළුවන් pattern එකක් හඳුනාගෙන alert/log generate කරන එක. NIST අනුව IDPS technologies network-based, wireless, network behavior analysis සහ host-based වගේ categories වලට වෙන් කළ හැක.
IDS කියන්නේ ඇත්තටම මොකක්ද?
IDS = Intrusion Detection System
සරලව කිව්වොත්:
Network එකේ හෝ system එකේ සිදුවන activity inspect කරලා suspicious behavior හඳුනාගෙන security alert එකක් generate කරන system එකක්.
ඒ කියන්නේ IDS එකේ main output එක “දැනගැනීම”.
උදාහරණයක්:
Attacker
↓
Suspicious Traffic
↓
Network
↓
IDS Sensor
↓
Detection Engine
↓
Alert / Log
↓
Security Analyst / SIEM
IDS එක දැකපු දෙය අනුව:
Possible Port Scan
Suspicious HTTP Request
Malware Signature Detected
Brute-force Pattern
Anomalous Traffic
වගේ alert එකක් generate කරන්න පුළුවන්.
IDS vs IPS — මේ දෙක confuse කරන්න එපා
මේක cybersecurity learners ලා අතර common misconception එකක්.
IDS
Traffic
↓
Inspect
↓
Detect
↓
Alert
IDS එක සාමාන්යයෙන් detect + report side එකේ.
IPS
Traffic
↓
Inspect
↓
Detect
↓
Block / Drop / Reject
IPS එක traffic path එකේ enforcement කරන්න පුළුවන්.
Suricata documentation එකේ IPS mode එක traffic filter එකක් ලෙස ක්රියා කරන බවත් drop/reject rules භාවිතා කර unwanted traffic block කළ හැකි බවත් දක්වයි.
ඒ නිසා:
IDS = “මේක suspicious”
IPS = “මේක suspicious, ඒ නිසා stop කරනවා”
කියලා basic mental model එකක් ගන්න පුළුවන්.
හැබැයි real-world deployments වල IDS/IPS boundary එක product mode, architecture සහ configuration එක මත වෙනස් වෙන්න පුළුවන්.
IDS වැඩ කරන ආකාරය
IDS එක magic system එකක් නෙවෙයි.
එකකට input එකක් ඕන.
Network IDS එකකට:
Packets
Flows
Protocols
HTTP
DNS
TLS metadata
TCP/UDP behavior
වගේ network telemetry ලැබෙන්න පුළුවන්.
Host IDS එකකට:
Process activity
File changes
Authentication events
System logs
Configuration changes
වගේ host-level events inspect කරන්න පුළුවන්.
NIST හි IDPS guidance එක network-based සහ host-based systems ඇතුළු monitoring models විස්තර කරයි.
IDS Detection Methods 3ක් ගැන හරියට තේරුම් ගමු
IDS එකකට suspicious activity detect කරන්න එකම technique එකක් නැහැ.
1. Signature-Based Detection
මෙතන system එක දන්නා malicious pattern එකක් හොයනවා.
උදාහරණයක් ලෙස:
known exploit pattern
known malware payload pattern
known attack sequence
known malicious indicator
rule එකකට match වුණොත්:
ALERT
උදාහරණයක් විදිහට Snort rules packet payload එකේ data inspect කරලා pattern matching කරන්න පුළුවන්. Snort documentation එක payload detection options හරහා packet data කොහොම inspect කරනවාද කියලා පැහැදිලි කරයි.
මේ model එකේ biggest advantage එක:
Known attack → හොඳ detection potential
හැබැයි weakness එක:
Unknown attack → signature එක නැත්නම් miss වෙන්න පුළුවන්
2. Anomaly-Based Detection
මෙතන question එක:
“මේ behavior එක normal traffic pattern එකෙන් වෙනස්ද?”
උදාහරණයක්:
සාමාන්යයෙන් server එකක්:
10 DNS queries/min
50 HTTP requests/min
වගේ traffic generate කරනවා කියලා baseline එකක් තිබුණා කියමු.
එක පාරට:
5000 DNS queries/min
වගේ abnormal behavior එකක් පේනවා.
එතකොට IDS/monitoring system එකකට:
Unusual DNS activity
වගේ detection එකක් generate කරන්න පුළුවන්.
මේ approach එක known signatures වලට විතරක් depend වෙන්නේ නැති නිසා useful.
හැබැයි false positives වැඩි වෙන්න පුළුවන්.
3. Behavioral / Protocol Analysis
මේක signature එකක් match කරන එකට වඩා behavior එක සහ protocol semantics inspect කරන පැත්ත.
උදාහරණයක්:
Normal HTTP request
vs
Malformed / suspicious HTTP behavior
හෝ:
Normal DNS behavior
vs
Odd query / response pattern
Modern network detection systems protocol-aware inspection, metadata සහ anomalies එකට භාවිතා කළ හැක.
Suricata EVE output එකෙන් alerts වලට අමතරව anomaly, HTTP, DNS, TLS, flow වගේ event data JSON ලෙස log කළ හැකි බව official docs වලින් පෙන්වයි.
IDS Types
NIST classification එකෙන් බැලුවොත් මේ field එක එකම “IDS box” එකකට සීමා වෙන්නේ නැහැ.
NIDS — Network Intrusion Detection System
Network traffic monitor කරන එක.
Internet
↓
Router / Switch
↓
[ IDS Sensor ]
↓
Internal Network
Use cases:
Port scanning detection
Suspicious protocol activity
Exploit attempts
Malware traffic indicators
Policy violations
HIDS — Host Intrusion Detection System
Individual machine එකක් monitor කරන model එක.
උදාහරණයක්:
Linux Server
├── auth logs
├── process activity
├── file changes
├── system events
└── configuration
↓
HIDS
එතකොට network traffic එකෙන් නොපෙනෙන host-level behavior detect කරන්න පුළුවන්.
Wireless IDS
Wireless environment එක specifically monitor කරන්න design කරන systems තියෙනවා.
උදාහරණ:
Wi-Fi clients
Access Points
Wireless traffic
Authentication behavior
Rogue devices
NIST IDPS classification එකේ wireless technologies වෙනම category එකක් ලෙස සලකයි.
Network Behavior Analysis
NBA approach එක traffic behavior, flows සහ broader patterns analyze කරන පැත්ත.
මේක:
“Packet එකේ මේ string එක තියෙනවද?”
වගේ simple signature matching එකකට වඩා behavior-focused වෙන්න පුළුවන්.
Practical Example — Snort
FSOCIETY.LK readers ලාට familiar example එකක්:
Snort
Snort official site එක අනුව එය open-source intrusion prevention system එකක් වන අතර real-time traffic analysis සහ packet logging හැකියාව ලබා දෙයි. Kali package documentation එක Snort එක network intrusion detection සඳහාත් rules-based logging සඳහාත් භාවිතා කළ හැකි බව සඳහන් කරයි.
Kali Linux වල package install කරන්න:
“sudo apt update”
“sudo apt install snort”
Kali official package page එකේ sudo apt install snort installation command එක සහ package dependencies list කරලා තියෙනවා.
Version check:
“snort -V”
Help:
snort -h
Kali documentation එකේ snort -h command එක available CLI help options පෙන්වන බව දක්වයි.
IDS Lab එකක් හදන්නේ කොහොමද?
Real production network එකට test commands දාලා experiment කරන එක වැරදියි.
Better architecture එක:
┌───────────────┐
│ Attacker VM │
│ Kali Linux │
└───────┬───────┘
│
│ Test Traffic
▼
┌───────────────┐
│ IDS Sensor │
│ Snort/Suricata│
└───────┬───────┘
│
▼
┌───────────────┐
│ Target VM │
│ Linux/Windows │
└───────────────┘
මේ setup එකෙන්:
Traffic generation
↓
Packet capture
↓
Rule matching
↓
Detection
↓
Alert
↓
Investigation
කියන full lifecycle එක ඉගෙන ගන්න පුළුවන්.
IDS එකට Packet Capture එක වැදගත් ඇයි?
Network IDS එකක් packets/traffic visibility මත heavily depend වෙනවා.
Traffic එක sensor එකට පේන්නේ නැත්නම්, detection එක logically impossible.
මේක IDS architecture එකේ extremely important point එකක්.
Traffic exists
≠
IDS can see traffic
ඒ නිසා sensor placement matters.
Typical deployment considerations:
SPAN / Mirror Port
TAP
Inline
Virtual switching
Cloud traffic mirroring
වගේ architectures භාවිතා කළ හැක.
Snort Rules කියන්නේ මොනවද?
Snort rules කියන්නේ detection logic.
Conceptually:
IF
traffic matches condition
THEN
generate alert
Rule එකක:
protocol
source
destination
ports
direction
content
metadata
action
වගේ elements තියෙන්න පුළුවන්.
ඒ නිසා IDS එක “packet sniffer” එකක් විතරක් නෙවෙයි.
Detection engine + rules + logging + alerting architecture එකක්.
Snort official rule documentation එක packet payload inspection සහ inspection buffers ගැන detailed explanation එකක් ලබා දෙනවා.
Suricata — Another Major IDS/IPS Engine
Snort එක්ක compare කරන්න commonly used technology එකක්:
Suricata
Suricata documentation එකේ rules engine එක protocol/application-aware inspection buffers සහ signature types භාවිතා කරන බව දැක්වේ.
එහි EVE JSON logging system එක particularly useful.
Example concept:
Suricata
↓
eve.json
↓
jq / Logstash / SIEM
↓
Detection / Investigation
Official documentation අනුව EVE JSON output එකෙන් alerts, anomalies, metadata, file information සහ protocol-specific records structured JSON ලෙස ලබාගත හැක.
ඒක SOC environment එකක valuable වෙන්නේ මේ නිසා:
Raw Packet
↓
Detection
↓
Structured Event
↓
Correlation
↓
Investigation
Zeek — IDS කියන concept එකට වැදගත් වෙන තවත් tool එකක්
Zeek traditional signature-based IDS එකක් ලෙස පමණක් හිතන එක වැරදියි.
Zeek network activity එකෙන් rich logs generate කරන network security monitoring platform එකක් ලෙස widely used.
Official documentation එකේ common logs අතර:
conn.log
dns.log
http.log
files.log
ssl.log
x509.log
ssh.log
smtp.log
rdp.log
quic.log
වගේ logs ගොඩක් තියෙනවා.
ඒ කියන්නේ network investigation එකේ question එක:
“Attack එක detect වුණාද?”
විතරක් නෙවෙයි.
තවත් questions:
Who communicated?
With whom?
When?
Which protocol?
Which service?
What DNS was queried?
What HTTP activity occurred?
What TLS information was observed?
වගේ questions වලට telemetry දෙන්න පුළුවන්.
IDS එකේ biggest problem එක — False Positives
Suppose IDS එක alert 10,000ක් generate කළා.
ඒ අතර actual incidents තියෙන්නේ 20ක් විතරයි.
එතකොට analyst:
10,000 alerts
↓
Noise
↓
Alert fatigue
වෙන්න පුළුවන්.
ඒක security team එකට serious operational problem එකක්.
ඒ නිසා good IDS deployment එකේ objective:
“Maximum alerts” නෙවෙයි.
Objective එක:
“Useful, actionable detections.”
IDS එකක් තිබ්බා කියලා secure ද?
නැහැ.
මේක dangerous misconception එකක්.
IDS එක:
every attack detect කරන්නේ නැහැ
every malware sample identify කරන්නේ නැහැ
encrypted traffic හැමදාම inspect කරන්න බැහැ
endpoint compromise එකක් හැම වෙලාවෙම network level එකෙන් පේන්නේ නැහැ
sensor visibility limitations තියෙනවා
false positives තියෙනවා
false negatives තියෙනවා
misconfiguration detection quality එක drastically reduce කරන්න පුළුවන්
ඒ නිසා IDS එක security stack එකේ එක් control එකක් විතරයි.
HTTPS තිබ්බොත් IDS blind ද?
“HTTPS නිසා IDS එකට කිසිම දෙයක් පේන්නේ නැහැ” කියන statement එකත් oversimplified.
Encryption නිසා payload visibility අඩු වෙන්න පුළුවන්.
නමුත් network telemetry වල:
IP addresses
Ports
Timing
Flow metadata
TLS-related metadata
Connection behavior
DNS activity
වගේ information වලින් useful detections හදාගත හැකි අවස්ථා තියෙනවා.
Suricata වගේ systems application/protocol-oriented event logging support කරන බව official EVE documentation එකෙන් පේනවා.
ඒ නිසා:
Encrypted
≠
Invisible
නමුත්:
Encrypted
≠
Fully inspectable payload
ද කියලා මතක තියාගන්න.
Advanced Insight — Detection ≠ Attribution
IDS එක alert එකක් දුන්නා:
Possible SSH brute-force activity
ඒකෙන් automatically:
“මේ attacker තමයි”
කියලා conclude කරන්න බැහැ.
IDS alert එක:
signal එකක්
Investigation එක:
context-building process එකක්
SOC analyst කෙනෙක් combine කරන්න පුළුවන්:
IDS alert
+
Firewall logs
+
DNS logs
+
Authentication logs
+
Endpoint telemetry
+
Threat intelligence
+
Packet capture
එතකොට incident එකේ actual story එක build කරන්න පුළුවන්.
IDS + SIEM = Bigger Picture
IDS එක standalone tool එකක් විදිහට use කරන්න පුළුවන්.
හැබැයි enterprise environment එකක:
IDS
Firewall
EDR
DNS
Proxy
Authentication
Cloud Logs
↓
SIEM
↓
Correlation
↓
Detection
↓
Investigation
↓
Response
වගේ architecture එකක් much more powerful.
මෙතන single alert එකකට වඩා correlated evidence වැදගත්.
Attacker vs Defender Perspective
Attacker side
Attacker කෙනෙක් network activity generate කරනකොට:
Scanning
Enumeration
Authentication attempts
Exploit traffic
C2 communication
Data transfer
වගේ behavior traces generate වෙන්න පුළුවන්.
Defender side
Defender:
Detect
Correlate
Investigate
Contain
Respond
Improve rules
කරනවා.
ඒ නිසා ethical hacking ඉගෙන ගන්න කෙනෙකුට IDS තේරුම් ගැනීම වැදගත්.
ඔයා attack එක කොහොම execute කරනවද කියලා විතරක් දැනගෙන security engineer කෙනෙක් වෙන්න බැහැ.
ඒ activity එක defender කෙනෙක්ට කොහොම පේනවද කියලා දැනගන්න ඕන.
Useful Lab Workflow
තමන්ගේ isolated lab එකක මේ sequence එක practice කරන්න:
1. Build a small virtual network
2. Deploy IDS sensor
3. Generate legitimate traffic
4. Capture traffic
5. Enable detection rules
6. Generate safe test activity
7. Observe alerts
8. Inspect logs
9. Identify false positives
10. Tune detection
ඊළඟ level එකේ:
PCAP
↓
Detection rule
↓
Alert
↓
JSON / log
↓
jq
↓
SIEM
↓
Correlation
කියන workflow එක practice කරන්න.
LEGAL / ETHICAL WARNING
මේ article එකේ සඳහන් IDS, Snort, Suricata සහ network-testing concepts තමන්ගේම lab එකක, CTF environment එකක හෝ explicit permission තියෙන system/network එකක විතරක් test කරන්න.
වෙනත් කෙනෙකුගේ network එක scan කිරීම, traffic capture කිරීම හෝ security controls test කිරීම permission නැතුව කිරීම නීතිවිරෝධී විය හැක.

IDS කියන්නේ “hacker blocker” එකක් නෙවෙයි.
එහි core value එක:
Security-relevant activity visibility + detection + alerting
හොඳ IDS deployment එකකට tool එක install කරන එක පමණක් ප්රමාණවත් නැහැ.
වැදගත් දේවල්:
Visibility
+
Good detection logic
+
Correct sensor placement
+
Low-noise tuning
+
Quality telemetry
+
Human investigation
කියන components එකට වැඩ කරන එක.
Advanced cybersecurity වලදී interesting question එක:
“IDS එක attack එක detect කළාද?”
විතරක් නෙවෙයි.
“IDS එකට attack එක පේන්න තිබුණේ කොහොමද, මොන evidence එකක් generate වුණාද, false positive එකක්ද, detection එක bypass වෙන්න පුළුවන්ද, සහ ඒ evidence එකෙන් incident එක reconstruct කරන්න පුළුවන්ද?”
ඒක තමයි real-world detection engineering mindset එක
Fsociety.LK
