Raspberry Pi : Web Site Traffic Generator Python Bot



Python Code running on Raspberry Pi or any other device and OS you have, 
Pi is low powered and will run for much less power. 

What it is > A noise generator to use for an Incident Response / Network Defense simulation. The only issue is that my simulation environment uses multiple IDS/IPS/NGFW devices that will not pass and log simple TCPreplays of canned traffic. I needed the traffic to be as organic as possible, essentially mimicking real users browsing the web.

Usage : Great to test out your web server, test out network traffic, run multiple threads for load testing etc.



The steps :

Install git

Install GIT
sudo apt-get install git



Download
git clone https://github.com/ecapuano/web-traffic-generator.git


change directory
cd web-traffic-generator/ 


copy template 
cp config.py.template config.py


edit the file
sudo nano config.py

change ClickDepth, minWait and maxWait as per requirement or leave it default
go to rootURLs - add the website/webpage you want your bot to.
modify the Debug = True [to view the script run]

[save] ctrl+o
[exit] ctrl+z


install pip
sudo apt install python3-pip
sudo apt install python-pip 

verify installtion of pip
pip3 --version
pip --version 

install requests
sudo pip install requests


run the script
python gen.py


get your pi :
/\

Comments

  1. The output for me is 4 bad request, always 4 bad requests. I have also checked my website's stats and there is no traffic recorded...Can you please give me a hand? Thanks!

    ReplyDelete

Post a Comment