configuring-snort-ids-for-intrusion-detection
यह क्या करती है
यह गाइड Snort को इंस्टॉल और सेट अप करने का तरीका बताती है। Snort एक ऐसा प्रोग्राम है जो नेटवर्क ट्रैफ़िक पर नज़र रखने वाले ट्रैफ़िक पुलिस की तरह काम करता है। यह आपके नेटवर्क में आने-जाने वाले सारे ट्रैफ़िक को देखता है और संदिग्ध या खतरनाक गतिविधि खोजता है, जैसे घुसपैठिए जो सिस्टम में घुसने की कोशिश करें।
कब इस्तेमाल करें
- ✓जब आप अपने नेटवर्क को हमलों से बचाना चाहते हैं।
- ✓जब आप किसी खास खतरे को पकड़ने के लिए अपने नियम बनाना चाहते हैं।
- ✓जब आप गलत अलर्ट (false alarms) कम करने के लिए मौजूदा नियमों को ठीक करना चाहते हैं।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/configuring-snort-ids-for-intrusion-detection/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Snort सेट करो ताकि वह मेरे नेटवर्क पर नज़र रखे और संदिग्ध गतिविधि के बारे में मुझे अलर्ट करे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
Snort को इंस्टॉल और कॉन्फ़िगर किया जाता है ताकि वह सारे नेटवर्क ट्रैफ़िक को "सुने"। यह हमले के पैटर्न पहचानने के लिए नियमों के एक सेट का इस्तेमाल करता है। कोई पैटर्न मिलने पर यह अलर्ट जनरेट करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Configuring Snort IDS for Intrusion Detection
When to Use
- Deploying a network-based intrusion detection system to monitor traffic at key network boundaries
- Writing custom Snort rules to detect organization-specific threats, attack patterns, or policy violations
- Tuning existing rulesets to reduce false positives while maintaining detection coverage
- Integrating Snort alerts with SIEM platforms for centralized security monitoring
- Validating network security controls by generating test traffic and confirming detection
Do not use as a replacement for endpoint detection, for monitoring encrypted traffic without TLS inspection, or as the sole security control without complementary defenses.
Prerequisites
- Snort 3.x installed from source or package manager (
snort --versionto verify) - Network interface configured for promiscuous mode on a span port or network tap
- DAQ (Data Acquisition Library) installed for packet capture integration
- Registered Snort account for downloading Snort Subscriber (paid) or Community rulesets from snort.org
- PulledPork 3 or similar rule management tool for automated ruleset updates
- Sufficient CPU and memory for inline traffic inspection at line rate
Workflow
Step 1: Install and Verify Snort 3
# Install dependencies (Ubuntu/Debian)
sudo apt install -y build-essential libpcap-dev libpcre3-dev libnet1-dev \
zlib1g-dev luajit hwloc libdumbnet-dev bison flex libcmocka-dev \
libnetfilter-queue-dev libmnl-dev autotools-dev libluajit-5.1-dev \
pkg-config cmake libhwloc-dev liblzma-dev openssl libssl-dev cpputest \
libsqlite3-dev uuid-dev
# Install DAQ from source
git clone https://github.com/snort3/libdaq.git
cd libdaq && ./bootstrap && ./configure && make && sudo make install
# Install Snort 3
git clone https://github.com/snort3/snort3.git
cd snort3 && ./configure_cmake.sh --prefix=/usr/local
cd build && make -j$(nproc) && sudo make install
sudo ldconfig
# Verify installation
snort -V
Step 2: Configure Network Interfaces
# Disable offloading features that interfere with packet inspection
sudo ethtool -K eth1 gro off lro off tso off gso off rx off tx off
# Enable promiscuous mode
sudo ip link set eth1 promisc on
# Create systemd service for persistent interface configuration
sudo tee /etc/systemd/system/snort-iface.service << 'EOF'
[Unit]
Description=Configure Snort capture interface
Before=snort.service
[Service]
Type=oneshot
ExecStart=/sbin/ethtool -K eth1 gro off lro off tso off gso off rx off tx off
ExecStart=/sbin/ip link set eth1 promisc on
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable snort-iface.service
Step 3: Configure Snort 3 with Lua Configuration
# Create Snort directory structure
sudo mkdir -p /usr/local/etc/snort/{rules,builtin_rules,lists,appid}
sudo mkdir -p /var/log/snort
# Edit the main Snort configuration
sudo tee /usr/local/etc/snort/snort.lua << 'LUAEOF'
-- Snort 3 Configuration
-- Network variables
HOME_NET = '10.10.0.0/16'
EXTERNAL_NET = '!$HOME_NET'
-- Path variables
RULE_PATH = '/usr/local/etc/snort/rules'
BUILTIN_RULE_PATH = '/usr/local/etc/snort/builtin_rules'
-- Configure DAQ
daq = {
module_dirs = { '/usr/local/lib/daq' },
modules = { { name = 'afpacket', variables = { 'buffer_size_mb=256' } } }
}
-- Decoder configuration
normalizer = { tcp = { ips = true } }
-- Stream inspection
stream = { }
stream_tcp = { policy = 'linux', session_timeout = 180 }
stream_udp = { session_timeout = 30 }
stream_icmp = { }
-- HTTP inspection
http_inspect = { }
-- DNS inspection
dns = { }
-- SSL/TLS inspection
ssl = { }
-- SMB inspection
dce_smb = { }
-- File identification and processing
file_id = { rules_file = '/usr/local/etc/snort/file_magic.rules' }
-- Port scan detection
port_scan = {
protos = 'all',
scan_types = 'all',
memcap = 10000000
}
-- Reputation-based filtering
-- reputation = {
-- blacklist = RULE_PATH .. '/blocklist.rules'
-- }
-- IPS rules
ips = {
enable_builtin_rules = true,
include = RULE_PATH .. '/snort3-community.rules',
variables = {
nets = { HOME_NET = HOME_NET, EXTERNAL_NET = EXTERNAL_NET },
ports = {
HTTP_PORTS = '80 8080 8443',
SSH_PORTS = '22',
DNS_PORTS = '53'
}
}
}
-- Alert output
alert_fast = {
file = true,
packet = false,
limit = 100
}
-- Unified2 output for Barnyard2/SIEM integration
…
अक्सर पूछे जाने वाले सवाल
Snort क्या है?
Snort एक मुफ़्त प्रोग्राम है, जो Network Intrusion Detection System (NIDS) के रूप में काम करता है। यह नेटवर्क ट्रैफ़िक पर नज़र रखता है और खतरनाक गतिविधि की स्थिति में एडमिनिस्ट्रेटर को अलर्ट कर सकता है।
Snort में 'rules' क्या होते हैं?
Rules ऐसे निर्देश हैं जो Snort को बताते हैं कि क्या खोजना है। ये ट्रैफ़िक के पैटर्न तय करते हैं जो हमले या अवांछित गतिविधि का संकेत हो सकते हैं।
'false positives' क्या होते हैं?
False positive तब होता है जब Snort किसी ऐसी चीज़ का अलर्ट दे जो असल में खतरा नहीं है। नियमों को ठीक (tune) करने से ऐसे गलत अलर्ट कम होते हैं।
जानकारी
लेखक का मूल विवरण
Installs, configures, and tunes Snort 3 to monitor network traffic for malicious activity using custom and community rulesets, preprocessors, and alert output plugins. Use when deploying network-based intrusion detection at key boundaries, writing custom Snort rules, tuning rulesets to reduce false positives, or integrating Snort alerts with a SIEM. '
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #7765
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।