I would like to test an IDS in a test network.

I know scapy can be used to generate network traffic, in particluar to simulate fake SYN flood attacks etc like the one here github. All the example scripts using scapy show its possible to specify which destination IP to use, however they all appear to randomly generate a source IP address. My question is, is it possible to specify the source IP using scapy, even if that address is a real address being used on the network.

I basically want to simulate an attack that looks like it is coming from another device on the network.

  • 1
    Scapy can do almost anything you want. – Ron Trunk Jun 16 '18 at 20:11
  • ok great I hadn't seen any examples of specifying the source IP, but if it can do it, then fantastic ! – Bat Jun 16 '18 at 22:30
scapy_pkt = Ether(dst='00:00:0c:01:01:14', src='00:00:0c:01:01:13')/ \
            IP(dst='', src='')/ \
            TCP(sport=1025, dport=80, \
                flags='S', seq=99999)
| improve this answer | |
  • perfect many thanks that was exactly what I was looking for – Bat Jun 17 '18 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.