Skip to main content

create pcaps, or replay traffic on an interface

Project description

Implementation of Scapy Traffic Generator

What is this package for?

  • Simulating network traffic by creating packets and either saving a pcap file for further use or replaying the packets on a given interface

How to install

pip install ScapyTrafficGenerator

How To run

Use -X to define protocol

ScapyTrafficGenerator -X http

Scapy Traffic Generators runtime Basic Arguments defined with -r

-F File  (can be given multiple times)
-i interface to run
-s src ip
-S src PORT
-d dst ip
-D dst port
-m scr mac
-M dst mac
-X Method(integer 1-6)  (1= GET, 2 = PUT, 3 = POST, 4 = GET, 5= PUT, 6 = POST)  *methods 1,2,3 are for HTTP and 4,5,6 are for FTP
-E Encoding (integer 2-6) (2=CHUNKED, 3 = GZIP, 4 = CHUNKED+GZIP, 5 = MULTIPART single form, 6 = MULTIPART multi form)  *encoding for http only, 2-4 is for GET only, 5-6 is for PUT/POST only.

#example

ScapyTrafficGenerator -X http -r '-X 1 -F /files/Malicious_DOC.doc -i eth0 -s 1.1.1.1 -S 33333 -d 2.2.2.2 -D 80 -m 12:31:25:15:a1:55 -M 12:31:25:15:a1:2b'

### not specifying a field will default to a random value (file should default to none)

Additional HTTP specific arguments

--host <host>  specify a host
-u <url>  specify a request url
-B swap destination ip to use ipv6
-b swap source ip to use ipv6
-R <response string> set server response (HTTP/1.1 200 OK is default)
-L <dir> location to transfer files (instead of just one file it will sent whole dir)
-N <server name> specify server name
--gretunnel encapsulate traffic as gre
-A swap all default ip to use ipv6
-l http pipeline files (if one file is in request it will download it multiple times)
-x <packets per second>  specify packets per second to replay traffic
-j <request header>  add a request header
-k <response header> add a response header
-v <vlan tag id>  specify a vlan tag id
-O <offset>  specify how long ago packet occured
-V  <Version> http version (default HTTP/1.1)
-U  <useragent string>  specify particular user agent for windows/linux/etc  (default curl/7.35.0)
-T  timeout  >> repeat replaying traffic until time

Additional FTP specific arguments

-c command source port
-C command destination port
-B swap destination ip to use ipv6
-b swap source ip to use ipv6
-L <dir> location to transfer files (instead of just one file it will sent whole dir)
-N <server name> specify server name
-A swap all default ip to use ipv6
-x <packets per second>  specify packets per second to replay traffic
-w specify server diretory
-W specify working directory
-a use active ftp
-v <vlan tag id>  specify a vlan tag id
-u user password
-z <number of segments> specify segmentation
-P specify same dataport umougst multiple sessons/segments

Additional TCP specific arguments

-p <data_from_source:data_response_from_destination> packet data (default="HELLOSERVER:HELLOCLIENT")

other supported protocols

-DNS
-DHCP
-ICMP
-SMB
-SMB2
-HTTPS (with fake data for encrypting files)

To Save as a pcap instead of replaying envoronment vaiable must be set to where you want to save the pcap file to

export CREATE_PCAP_ONLY=\tmp\mypcap.pcap; ScapyTrafficGenerator -X http -r '-i eth1 -s 10.21.21.21 -u "/mybadurl.com"'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ScapyTrafficGenerator, version 2.19.1
Filename, size File type Python version Upload date Hashes
Filename, size ScapyTrafficGenerator-2.19.1.tar.gz (477.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page