mirror of
https://github.com/Llloooggg/DDoS.git
synced 2026-03-06 10:06:23 +03:00
Исправил пути на абсолютные
This commit is contained in:
20
__init__.py
20
__init__.py
@@ -1,6 +1,7 @@
|
|||||||
#!venv/bin/python3
|
#!venv/bin/python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import link_extractor
|
import link_extractor
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
@@ -12,24 +13,25 @@ from threading import Thread
|
|||||||
|
|
||||||
global requestCountSuccess, requestCountExecuted
|
global requestCountSuccess, requestCountExecuted
|
||||||
|
|
||||||
if not os.path.exists('./maps/'):
|
script_path = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||||
os.makedirs('./maps/')
|
|
||||||
|
if not os.path.exists(f'{script_path}/maps/'):
|
||||||
|
os.makedirs(f'{script_path}/maps/')
|
||||||
|
|
||||||
devnull = open('/dev/null', 'w')
|
devnull = open('/dev/null', 'w')
|
||||||
|
|
||||||
|
|
||||||
def url_grab(full_url):
|
def url_grab(full_url):
|
||||||
|
|
||||||
if os.path.exists(f'./maps/{url}'):
|
if os.path.exists(f'{script_path}/maps/{url}'):
|
||||||
|
|
||||||
with open(f'./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'./maps/{url}')
|
os.mknod(f'{script_path}/maps/{url}')
|
||||||
with open(f'./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)
|
||||||
|
|
||||||
@@ -58,8 +60,8 @@ class DDoSer(Thread):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# url = input(datetime.now().strftime('[%x %X] ') + 'Введите адрес сайта: ')
|
url = input(f'{datetime.now().strftime("[%X]")} Введите адрес сайта: ')
|
||||||
url = '192.168.56.102'
|
# url = '192.168.56.102'
|
||||||
|
|
||||||
subUrls = url_grab(url)
|
subUrls = url_grab(url)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user