Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 980 Bytes

Scapy.md

File metadata and controls

32 lines (24 loc) · 980 Bytes

1. List of all protocols: ls()
2. Check internals of protocol: ls(protocol_name)
3. List of commands supperted by Scapy: lsc()
4. Check help of any command: help(command)

Packet Creation:

ICMP:

  1. Create packet: packet_ICMP = IP(dst="IP or Hostname")/ICMP()/"PAYLOAD"
  2. Check packet configurations: packet_ICMP.show()
  3. Summary of created packet: packet_ICMP.summary()
  4. Details of created packet: ls(packet_ICMP)

TCP:

  1. Create TCP packet: packet_TCP = Ether()IP(dst="IP or Hostname")/TCP(dport=port_number, flags='S')

Sending Packet:

  1. sr(packet_name)

Packet information:

  1. ans,unans=_
  2. ans.show()

Host discovery

ICMP:

  1. packet_ICMP = IP(dst="IP/Hostname")/ICMP()
  2. ans,unans = sr(packet_ICMP)
  3. ans = summary(lambda s,r: r.sprintf('{IP: %IP.src% is alive}'))

TCP SYN:

  1. packet_TCP_SYN = IP(dst="IP or Hostname")/TCP(dport=port_number, flags='S')