TCP port scanning
The following command is used for TCP port scanning. Using this command will send a TCP SYN
packet to each port. The command will then wait for a SYN-ACK
, RST
, or ICMP
error indicating an open port:
>>> res,unans = sr( IP(dst="target") /TCP(flags="S", dport=(1,1024)) )
VLAN hopping
Attacks associated with virtual LAN networks such as VLAN hopping becomes a simple task by just double layering the Dot1Q
protocol first with the VLAN you're going to send on then the VLAN that you are going to. This is make networks using VLANs vulnerable to DDoS attacks methods and other attack vectors:
>>> sendp(Ether()/Dot1Q(vlan=2)/Dot1Q(vlan=7)/IP(dst=target)/ICMP())
Wireless sniffing
Now, I know there are already plenty of wireless sniffers out there, but with scapy you'll grasp a better understanding of how it works. There's already a sniff function but there are several parameters we haven't yet discussed. Well start with iface
, you need to define the connection interface...