2

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.

2
  • 1
    Scapy can do almost anything you want.
    – Ron Trunk
    Commented Jun 16, 2018 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
    Commented Jun 16, 2018 at 22:30

1 Answer 1

1
scapy_pkt = Ether(dst='00:00:0c:01:01:14', src='00:00:0c:01:01:13')/ \
            IP(dst='1.1.1.14', src='1.1.1.13')/ \
            TCP(sport=1025, dport=80, \
                flags='S', seq=99999)
1
  • perfect many thanks that was exactly what I was looking for
    – Bat
    Commented Jun 17, 2018 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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