SlideShare uma empresa Scribd logo
1 de 15
Scanner , Sniffer & Injector Modules
Network Monitoring Toolkit
Components comprising the toolkit
• Packet Injection using Raw Sockets
• Packet Sniffer using Raw Sockets
• Packet Sniffer using Python - Scapy
• Implementing a Wireless Networks Sniffer
• Automating Network Scans using Nmap
• UI based Packet Monitoring
Packet Injection (using Raw Sockets)
• Ability to Construct & Inject Raw Packets into the Target network.
• Powerful as we can simulate responses from the Network
• Finding valid Packets for network by sending arbitrary packets.
Creating Raw Sockets in the User Space
• Using socket module , packet interface as the PF_PACKET
and SOCK_RAW as the socket type.
• Socket call accepts three parameters ,socket.htons(0x0800)
specifically signifies the protocol value for the packet which is
IP in this particular case.
• Next we bind the rawSocket to the interface we decide to send
packets over , i.e. Wlan0 here.
• Creating simple packet using the destination Address , Source
address and the protocol value
• Using pack() call , packing the first 6 bytes as destination Mac
Address , next 6 bytes as Source Mac address and next 2
bytes as protocol value.
• Further appending a simple string with packet header.
Monitoring the Network (Over the Interface using tcpDump )
Packet Sniffing (Using Raw Sockets)
• Raw Sockets provides a way to bypass the whole Network
Stack traversal of a packet and delivers it directly to an
application.
• Using PF_PACKET interface , operates on layer 2 of OSI
Model , i.e. Device Drivers
• No header is stripped off from the packet.
Understanding Packet Headers
Building up the Sniffer Module
• Defining rawSocket using PF_PACKET as the packet interface and
SOCK_RAW to indicate that it is a Raw Socket in the Socket
function.
• Adding the third argument socket.htons(0x0800) protocol value
indicating the kernel that we are particularly interested in IP Packets
• Now calling the recvfrom() call over the rawSocket to read a packet
• Unpacking the ethernet Header using unpack( ) into elements of
tuple
• Converting the unpacked values into their hex values using
binascii.hexlify( ) returning corresponding hex : mac Addresses.
• Parsing the Ethernet Header (14 bytes always) of which the first 6
bytes is the destination mac address , next 6 bytes are source mac
address and the next 2 bytes are protocol value
• Next , parsing from byte 14 to 34 , which is the IP Header
• Unpacking the ip Header using unpack( )
• Extracting the Source and Destination IP Addresses
Wireless SSID Sniffer
• Gathering the SSIDs and Mac Addresses of Access
Points
• Defining a Packet Handler function to go ahead and check
for Dot11 Layer in the packet header and extracting the
pkt.addr2 component which is the Mac Address of the
Access Point along with the Access point Name pkt.info
• Sniffing using sniff( ) call on a monitor mode interface
UI Based monitoring of Packets
• The user selects the desired packet and field to be
displayed in the next page.
• The fields are timestamp, source mac, destination mac,
source ip, destination ip, pointer length,source port and
destination port for the packets ARP, IP, or UDP .
This page shows the details of each packet of ARP field as
captured by tcpdump:

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Socket programming
Socket programmingSocket programming
Socket programming
 
IPC SOCKET
IPC SOCKETIPC SOCKET
IPC SOCKET
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linux
 
Introduction to tcp ip linux networking
Introduction to tcp ip   linux networkingIntroduction to tcp ip   linux networking
Introduction to tcp ip linux networking
 
Sockets in unix
Sockets in unixSockets in unix
Sockets in unix
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-python
 
TCPIP
TCPIPTCPIP
TCPIP
 
Sockets and Socket-Buffer
Sockets and Socket-BufferSockets and Socket-Buffer
Sockets and Socket-Buffer
 
3 ip packet
3 ip packet3 ip packet
3 ip packet
 
Wireshark tutorial
Wireshark tutorialWireshark tutorial
Wireshark tutorial
 
Packet filtering using jpcap
Packet filtering using jpcapPacket filtering using jpcap
Packet filtering using jpcap
 
Np unit2
Np unit2Np unit2
Np unit2
 
Python Sockets
Python SocketsPython Sockets
Python Sockets
 
Linux network tools (Maarten Blomme)
Linux network tools (Maarten Blomme)Linux network tools (Maarten Blomme)
Linux network tools (Maarten Blomme)
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Ecet 465  Enthusiastic Study / snaptutorial.com
Ecet 465  Enthusiastic Study / snaptutorial.comEcet 465  Enthusiastic Study / snaptutorial.com
Ecet 465  Enthusiastic Study / snaptutorial.com
 
GRE (generic routing encapsulation)
GRE (generic routing encapsulation)GRE (generic routing encapsulation)
GRE (generic routing encapsulation)
 
Np unit iii
Np unit iiiNp unit iii
Np unit iii
 
Using metasploit
Using metasploitUsing metasploit
Using metasploit
 

Destaque

Cst nestlé waters
Cst   nestlé watersCst   nestlé waters
Cst nestlé waters
ADCONSEIL
 
CV_Vinit_Kumar_Charging_Exp_6.7 yrs
CV_Vinit_Kumar_Charging_Exp_6.7 yrsCV_Vinit_Kumar_Charging_Exp_6.7 yrs
CV_Vinit_Kumar_Charging_Exp_6.7 yrs
Vinit Kumar
 
Borang pendaftaran olahraga
Borang pendaftaran olahragaBorang pendaftaran olahraga
Borang pendaftaran olahraga
murizal
 

Destaque (14)

Cst nestlé waters
Cst   nestlé watersCst   nestlé waters
Cst nestlé waters
 
11 Uhr Zug
11  Uhr  Zug11  Uhr  Zug
11 Uhr Zug
 
Unimed Seguros
Unimed SegurosUnimed Seguros
Unimed Seguros
 
MaxHaus - PowerPoint Conceitual
MaxHaus - PowerPoint ConceitualMaxHaus - PowerPoint Conceitual
MaxHaus - PowerPoint Conceitual
 
Gestão individualizada dos talentos conarh 2011 seguros unimed
Gestão individualizada dos talentos   conarh 2011 seguros unimedGestão individualizada dos talentos   conarh 2011 seguros unimed
Gestão individualizada dos talentos conarh 2011 seguros unimed
 
Extraction De Bonus (ou comment gagner des centaines d'euros sans risque)
Extraction De Bonus (ou comment gagner des centaines d'euros sans risque)Extraction De Bonus (ou comment gagner des centaines d'euros sans risque)
Extraction De Bonus (ou comment gagner des centaines d'euros sans risque)
 
арулар асыл жандар
арулар асыл жандарарулар асыл жандар
арулар асыл жандар
 
Fully reused vlsi architecture of fm0 manchester encoding using sols techniqu...
Fully reused vlsi architecture of fm0 manchester encoding using sols techniqu...Fully reused vlsi architecture of fm0 manchester encoding using sols techniqu...
Fully reused vlsi architecture of fm0 manchester encoding using sols techniqu...
 
Stratégie Drive To Store - Petit déjeuner SEA SF
Stratégie Drive To Store  - Petit déjeuner SEA SFStratégie Drive To Store  - Petit déjeuner SEA SF
Stratégie Drive To Store - Petit déjeuner SEA SF
 
CV_Vinit_Kumar_Charging_Exp_6.7 yrs
CV_Vinit_Kumar_Charging_Exp_6.7 yrsCV_Vinit_Kumar_Charging_Exp_6.7 yrs
CV_Vinit_Kumar_Charging_Exp_6.7 yrs
 
Drive to Store - L'enjeu
Drive to Store - L'enjeuDrive to Store - L'enjeu
Drive to Store - L'enjeu
 
Chimney Presentation
Chimney PresentationChimney Presentation
Chimney Presentation
 
SFR RED Aquarium Paris
SFR RED Aquarium ParisSFR RED Aquarium Paris
SFR RED Aquarium Paris
 
Borang pendaftaran olahraga
Borang pendaftaran olahragaBorang pendaftaran olahraga
Borang pendaftaran olahraga
 

Semelhante a Presentation 6

Custom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_RouterCustom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_Router
Vishal Vasudev
 
PACKET Sniffer IMPLEMENTATION
PACKET Sniffer IMPLEMENTATIONPACKET Sniffer IMPLEMENTATION
PACKET Sniffer IMPLEMENTATION
Goutham Royal
 
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docxWireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
alanfhall8953
 
Wireshark Lab IP v6.0 Supplement to Computer Networking.docx
Wireshark Lab IP v6.0  Supplement to Computer Networking.docxWireshark Lab IP v6.0  Supplement to Computer Networking.docx
Wireshark Lab IP v6.0 Supplement to Computer Networking.docx
alanfhall8953
 
NAT 64 FPGA Implementation
NAT 64 FPGA ImplementationNAT 64 FPGA Implementation
NAT 64 FPGA Implementation
Janith Rukman
 

Semelhante a Presentation 6 (20)

Internet Protocol Version 4
Internet Protocol Version 4Internet Protocol Version 4
Internet Protocol Version 4
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
ACN solved Manual By Ketan.pdf
ACN solved Manual By Ketan.pdfACN solved Manual By Ketan.pdf
ACN solved Manual By Ketan.pdf
 
Clase 4. Routing IP.pdf
Clase 4. Routing IP.pdfClase 4. Routing IP.pdf
Clase 4. Routing IP.pdf
 
Routing of netwok protocls and how .pptx
Routing of netwok protocls and how .pptxRouting of netwok protocls and how .pptx
Routing of netwok protocls and how .pptx
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
11 coms 525 tcpip - internet protocol - forward
11   coms 525 tcpip - internet protocol - forward11   coms 525 tcpip - internet protocol - forward
11 coms 525 tcpip - internet protocol - forward
 
Java 1
Java 1Java 1
Java 1
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
Custom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_RouterCustom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_Router
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 
PACKET Sniffer IMPLEMENTATION
PACKET Sniffer IMPLEMENTATIONPACKET Sniffer IMPLEMENTATION
PACKET Sniffer IMPLEMENTATION
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
 
IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
 
IPv6: Internet Protocol version 6
IPv6: Internet Protocol version 6IPv6: Internet Protocol version 6
IPv6: Internet Protocol version 6
 
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docxWireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
 
Wireshark Lab IP v6.0 Supplement to Computer Networking.docx
Wireshark Lab IP v6.0  Supplement to Computer Networking.docxWireshark Lab IP v6.0  Supplement to Computer Networking.docx
Wireshark Lab IP v6.0 Supplement to Computer Networking.docx
 
NAT 64 FPGA Implementation
NAT 64 FPGA ImplementationNAT 64 FPGA Implementation
NAT 64 FPGA Implementation
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6
 
lecture08.ppt
lecture08.pptlecture08.ppt
lecture08.ppt
 

Presentation 6

  • 1. Scanner , Sniffer & Injector Modules Network Monitoring Toolkit
  • 2. Components comprising the toolkit • Packet Injection using Raw Sockets • Packet Sniffer using Raw Sockets • Packet Sniffer using Python - Scapy • Implementing a Wireless Networks Sniffer • Automating Network Scans using Nmap • UI based Packet Monitoring
  • 3. Packet Injection (using Raw Sockets) • Ability to Construct & Inject Raw Packets into the Target network. • Powerful as we can simulate responses from the Network • Finding valid Packets for network by sending arbitrary packets.
  • 4. Creating Raw Sockets in the User Space • Using socket module , packet interface as the PF_PACKET and SOCK_RAW as the socket type. • Socket call accepts three parameters ,socket.htons(0x0800) specifically signifies the protocol value for the packet which is IP in this particular case. • Next we bind the rawSocket to the interface we decide to send packets over , i.e. Wlan0 here. • Creating simple packet using the destination Address , Source address and the protocol value • Using pack() call , packing the first 6 bytes as destination Mac Address , next 6 bytes as Source Mac address and next 2 bytes as protocol value. • Further appending a simple string with packet header.
  • 5. Monitoring the Network (Over the Interface using tcpDump )
  • 6. Packet Sniffing (Using Raw Sockets)
  • 7. • Raw Sockets provides a way to bypass the whole Network Stack traversal of a packet and delivers it directly to an application. • Using PF_PACKET interface , operates on layer 2 of OSI Model , i.e. Device Drivers • No header is stripped off from the packet.
  • 9. Building up the Sniffer Module • Defining rawSocket using PF_PACKET as the packet interface and SOCK_RAW to indicate that it is a Raw Socket in the Socket function. • Adding the third argument socket.htons(0x0800) protocol value indicating the kernel that we are particularly interested in IP Packets • Now calling the recvfrom() call over the rawSocket to read a packet • Unpacking the ethernet Header using unpack( ) into elements of tuple • Converting the unpacked values into their hex values using binascii.hexlify( ) returning corresponding hex : mac Addresses. • Parsing the Ethernet Header (14 bytes always) of which the first 6 bytes is the destination mac address , next 6 bytes are source mac address and the next 2 bytes are protocol value
  • 10. • Next , parsing from byte 14 to 34 , which is the IP Header • Unpacking the ip Header using unpack( ) • Extracting the Source and Destination IP Addresses
  • 11. Wireless SSID Sniffer • Gathering the SSIDs and Mac Addresses of Access Points • Defining a Packet Handler function to go ahead and check for Dot11 Layer in the packet header and extracting the pkt.addr2 component which is the Mac Address of the Access Point along with the Access point Name pkt.info • Sniffing using sniff( ) call on a monitor mode interface
  • 12.
  • 13. UI Based monitoring of Packets
  • 14. • The user selects the desired packet and field to be displayed in the next page. • The fields are timestamp, source mac, destination mac, source ip, destination ip, pointer length,source port and destination port for the packets ARP, IP, or UDP .
  • 15. This page shows the details of each packet of ARP field as captured by tcpdump: