├── LICENSE ├── README.md ├── ab.sh ├── curl.sh └── ua.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jerry Gamblin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Random User Agents 2 | A couple of quick and dirty bash scripts using 7500 random useragents (in ua.txt) to test WAF bruteforce and flood blocking. 3 | 4 | # CURL 5 | ![Gif](http://i.giphy.com/3o7TKReKtMtFMVByOQ.gif "Gif") 6 | 7 | # AB 8 | ![Gif](http://i.giphy.com/l0MYLVcGnOzagSs36.gif "Gif") 9 | 10 | # OSX gsuhf install 11 | Using brew: `brew install coreutil` 12 | 13 | # OSX brew install 14 | Using brew: `brew install ab` 15 | -------------------------------------------------------------------------------- /ab.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | target="http://jgamblin.com/" 3 | clear 4 | echo 5 | echo -e "Testing WAF/BruteForce/Crawling Detection" 6 | echo 7 | while true 8 | do 9 | UserAgent=`gshuf -n 1 ua.txt` 10 | STARTTIME=$(date +%s) 11 | for run in {1} 12 | do 13 | ab -n 1000 -c 50 -H "User-Agent: %$UserAgent" -q $target > results.txt 14 | clear 15 | echo 16 | echo 'Complete requests:' 17 | cat results.txt | grep 'Complete requests' | awk '{print $3}' 18 | echo 'Failed requests:' 19 | cat results.txt | grep 'Failed requests' | awk '{print $3}' 20 | echo 'Requests per second:' 21 | cat results.txt | grep 'Requests per second' | awk '{print $4}' 22 | done 23 | ENDTIME=$(date +%s) 24 | echo -e "Time:" 25 | echo -e "$(($ENDTIME - $STARTTIME)) seconds" 26 | echo -e "User Agent:" 27 | echo -e "$UserAgent" 28 | echo 29 | sleep 2 30 | 31 | done 32 | -------------------------------------------------------------------------------- /curl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | target="http://jgamblin.com" 3 | 4 | echo 5 | echo -e "Curling $target to test WAF detection" 6 | echo 7 | 8 | while true 9 | do 10 | UserAgent=`gshuf -n 1 ua.txt` 11 | STARTTIME=$(date +%s) 12 | for run in {1..10} 13 | do 14 | curl --compressed -A "$UserAgent" -sL -w "%{http_code} %{url_effective}\\n" $target -o /dev/null 15 | done 16 | ENDTIME=$(date +%s) 17 | echo 18 | echo -e "It took $(($ENDTIME - $STARTTIME)) seconds to complete 10 curls using:" 19 | echo -e "$UserAgent" 20 | echo 21 | done 22 | --------------------------------------------------------------------------------