A multi-platform HTTP(S) Reverse Shell Server and Client in Python 3

Overview

Phantom - A multi-platform HTTP(S) Reverse Shell Server and Client

Python Version CodeFactor Grade OS OS

Reddit Discord Twitter

Phantom is a multi-platform HTTP(S) Reverse Shell server and client in Python 3. Binaries for Linux and Windows platforms can be built through an embedded script that executes PyInstaller.

Reverse shells can be established through HTTP or HTTPS. The certificates used for HTTPS can be auto-generated by Phantom or supplied by the user.

Phantom includes a helper shell script that enables fast generation of self-signed certificates for use of both servers and clients. After generation, the server and certificate authority certificates required for encrypted connections are bundled in the binaries for portability and ease of execution.

Demo

demo

Try it out!

Simply head over to the dist directory and download the pre-built Linux/Unix or Windows binaries.

The HTTP client files are set to connect to http://localhost:8080, whereas the HTTPS client bundles a CA certificate file for https://localhost:4443 and will only connect to this socket. With that in mind, choose either HTTP or HTTPS and run the server on one shell:

./linux_server http://localhost:8080
            <-- or -->
./linux_server https://localhost:4443

And the client on another one...

./http_linux_client
     <-- or -->
./https_linux_client

The same procedure works for the Windows binaries.

Setup

HTTP Server and Client

You don't need to set up the server and client for HTTP connections. The server will work straight out-of-the-box and the client will connect to any HTTP server. Just download the HTTP binaries from dist and you're done. Execute the binaries with the --help option for instructions.

HTTPS Server and Client

Encrypted communication through HTTPS requires at least two certificates: One for the server, named server.pem by default, and another for the certificate authority, or ca.pem. Phantom bundles both files in binaries for fast deployment. They can be generated by multiple methods or by a simple execution of the generate_certs.sh helper script.

Once the certificates are ready you only need to follow the steps from the Build and Run section below.

Build and Run an HTTPS Server/Client

I. Install Dependencies

Dependency management works with both Poetry (recommended) and Virtualenv. You need to install all dependencies before building binaries.

git clone https://github.com/EONRaider/BCA-Phantom.git
cd BCA-Phantom
poetry install <--or--> pip install -r requirements.txt

II. Build HTTPS Server and Client binaries

The build.py file centralizes the process and takes care of it all. Notice that a built Client binary contains a hardcoded server URL. The connection to the server can be stealthily performed by simply executing the binary.

  • Build and run the Server
    python build.py server --server-cert /path/to/server.pem
    ./linux_server SERVER_URL
  • Build and run the Client
    python build.py client --url SERVER_URL --ca-cert /path/to/ca.pem
    ./https_linux_client

The same procedure works for the Windows binaries.

Legal Disclaimer

The use of code contained in this repository, either in part or in its totality, for engaging targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws.

Developers assume no liability and are not responsible for misuses or damages caused by any code contained in this repository in any event that, accidentally or otherwise, it comes to be utilized by a threat agent or unauthorized entity as a means to compromise the security, privacy, confidentiality, integrity, and/or availability of systems and their associated resources. In this context the term "compromise" is henceforth understood as the leverage of exploitation of known or unknown vulnerabilities present in said systems, including, but not limited to, the implementation of security controls, human- or electronically-enabled.

The use of this code is only endorsed by the developers in those circumstances directly related to educational environments or authorized penetration testing engagements whose declared purpose is that of finding and mitigating vulnerabilities in systems, limiting their exposure to compromises and exploits employed by malicious agents as defined in their respective threat models.

You might also like...
Reverse engineered connection to the TradingView ticker in Python

Tradingview-ticker Reverse engineered connection to the TradingView ticker in Python. Makes a websocket connection to the Tradeview website and receiv

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Hermes Bytecode Reverse Engineering Tool (Assemble/Disassemble Hermes Bytecode)
Hermes Bytecode Reverse Engineering Tool (Assemble/Disassemble Hermes Bytecode)

hbctool A command-line interface for disassembling and assembling the Hermes Bytecode. Since the React Native team created their own JavaScript engine

Info & tools for reverse engineering the M6 smart fitness band
Info & tools for reverse engineering the M6 smart fitness band

m6-reveng This repo contains information and tools for reverse engineering the $7 M6 smart fitness band. Hardware The SoC (system-on-a-chip) is a Teli

My attempt to reverse the Discord nitro token generation function.
My attempt to reverse the Discord nitro token generation function.

discord-theory-I PART: I My attempt to reverse the Discord nitro token generation function. The Nitro generation tools thing is common in Discord now,

A bot to get Statistics like the Playercount from your Minecraft-Server on your Discord-Server

Hey Thanks for reading me. Warning: My English is not the best I have programmed this bot to show me statistics about the player numbers and ping of m

This Server Cloner can clone the server you want with all the perms of roles in every particular channel.

Server-Cloner-with-perms ๐Ÿš€ This Server Cloner can clone the server you want with all the perms of roles in every particular channel. Features Clone C

A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes
A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes

A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes.

WhatsApp Web API client with multi-device support

Tauros WhatsApp Web client for multi-device in python Free software: MIT Documentation: https://tauros.readthedocs.io Features TODO Credits This packa

Comments
  • Build Error

    Build Error

    Hi !

    First of all, thank you very much for this great tool !

    I'm trying to build binary with self signed certs (made with your script). Unfortunately the build doesn't work and python return an error I don't understand.

    $python build.py server --server-cert server-cert.pem
    Traceback (most recent call last):
      File "build.py", line 38, in <module>
        def server(args: argparse.Namespace) -> list[str]:
    TypeError: 'type' object is not subscriptable
    

    Hope this question is not to stupid. Thanks in advance for your help.

    opened by snax44 2
  • build error

    build error

    [[email protected] BCA-Phantom]# python3 build.py server --server-cert /root/cert/server.pem Traceback (most recent call last): File "build.py", line 38, in def server(args: argparse.Namespace) -> list[str]: TypeError: 'type' object is not subscriptable

    opened by ghost 0
  • issue with certificacion

    issue with certificacion

    I got this message in the client when I have to connect <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

    ` ./https_linux_client Traceback (most recent call last): File "urllib/request.py", line 1346, in do_open File "http/client.py", line 1279, in request File "http/client.py", line 1325, in _send_request File "http/client.py", line 1274, in endheaders File "http/client.py", line 1034, in _send_output File "http/client.py", line 974, in send File "http/client.py", line 1448, in connect File "ssl.py", line 500, in wrap_socket File "ssl.py", line 1040, in _create File "ssl.py", line 1309, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "client.py", line 145, in File "client.py", line 84, in execute File "commands.py", line 38, in open_session File "commands.py", line 26, in _send File "client.py", line 78, in post File "urllib/request.py", line 214, in urlopen File "urllib/request.py", line 517, in open File "urllib/request.py", line 534, in _open File "urllib/request.py", line 494, in _call_chain File "urllib/request.py", line 1389, in https_open File "urllib/request.py", line 1349, in do_open urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)> [3535] Failed to execute script 'client' due to unhandled exception!`

    Both certificates were build with the generate_certs.sh

    opened by rogerio77 0
Releases(v2.0.0)
Owner
Computer programming. Cybersecurity.
Python client for numerbay.ai - the Numerai community marketplace

NumerBay Python API Programmatic interaction with numerbay.ai - the Numerai community marketplace. If you encounter a problem or have suggestions, fee

Numerai Council of Elders 5 Nov 30, 2022
Wrapper for wttr.in weather forecast.

pywttr Wrapper for wttr.in weather forecast. Asynchronous version here. Installation pip install pywttr Example This example prints the average temper

Almaz 6 Dec 25, 2022
A code to match you with the perfect Taylor Swift song for your mood and relationship status.

taylorswift A package for matching your current mood and relationship status to a suitable Taylor Swift song. Requirements: Python 2 or 3, and the num

Megan Mansfield 82 Dec 09, 2022
A lightweight Python wrapper for the IG Markets API

trading_ig A lightweight Python wrapper for the IG Markets API. Simplifies access to the IG REST and Streaming APIs with a live or demo account. What

IG Python 247 Dec 08, 2022
A program that automates the boring parts of completing the Daily accounting spreadsheet at Taos Ski Valley

TSV_Daily_App A program that automates the boring parts of completing the Daily accounting spreadsheet at my old job. To see how it works you will nee

Devin Beck 2 Jan 01, 2022
Userbot untuk memutar video dan lagu di vcg/os

Userbot untuk memutar video dan lagu di vcg/os

FJ_GAMING 2 Nov 13, 2021
Build a better understanding of your data in PostgreSQL.

Data Fluent for PostgreSQL Build a better understanding of your data in PostgreSQL. The following shows an example report generated by this tool. It g

Mark Litwintschik 28 Aug 30, 2022
A Python wrapper around the Soundcloud API

soundcloud-python A friendly wrapper around the Soundcloud API. Installation To install soundcloud-python, simply: pip install soundcloud Or if you'r

SoundCloud 83 Dec 12, 2022
A cracking tool of Xiaomi Dr AI (Archytas / Archimedes)

Archytas Tool ๆˆ‘ไปฌๅผบ็ƒˆๆŠตๅˆถ้—ฒ้ฑผๅนณๅฐไธŠๆœช็ปๆŽˆๆƒ็š„ๅˆทๆœบๆœๅŠก๏ผ ๆˆ‘ๅฏนๆœฌไบบไน‹ๅ‰ๅœจ็จ‹ๅบไธญไธบ้˜ฒๆญข่ฟ่ง„ๅˆทๆœบๆœๅŠกๆทปๅŠ ๆœช็”Ÿๆ•ˆ็š„ๆ ผๆœบไปฃ็ ๆ„ŸๅˆฐๆŠฑๆญ‰๏ผŒๅœจๆญคๅฃฐๆ˜Žๆญค่ฟ‡ๆฟ€่กŒไธบไธŽ Crack Mi Dr AI Team ๆ— ๅ…ณ๏ผŒๅนถๅฐ†็จ‹ๅบๅผ€ๆบใ€‚ A cracking tool of Xiaomi Dr AI (Archy

rponeawa 5 Oct 25, 2022
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 07, 2021
A Telegram Bot to generate permanent Stream and Download links for any Telegram file

Telegram File To Stream Link This bot will give you permanent Stream and Download links for Telegram files Deploy the Bot Press the below button to de

Shadow 80 Dec 16, 2022
An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.

TWINT - Twitter Intelligence Tool No authentication. No API. No limits. Twint is an advanced Twitter scraping tool written in Python that allows for s

TWINT Project 14.2k Jan 03, 2023
PyLyrics Is An [Open-Source] Bot That Can Help You Get Song Lyrics

PyLyrics-Bot Telegram Bot To Search Song Lyrics From Genuis. ๐Ÿค– Demo: ๐Ÿ‘จโ€๐Ÿ’ป Deploy: โค Deploy Your Own Bot : Star ๐ŸŒŸ Fork ๐Ÿด & Deploy -Easy Way -Self-h

DAMIEN 12 Nov 12, 2022
Takes upcoming items from a Google Calendar and posts them to Slack.

Google Calendar to Slack by Jason Snell - [email protected] This Python s

6 Aug 21, 2022
Wrapper for Between - ๋น„ํŠธ์œˆ์„ ์œ„ํ•œ ํŒŒ์ด์ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

PyBetween Wrapper for Between - ๋น„ํŠธ์œˆ์„ ์œ„ํ•œ ํŒŒ์ด์ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ Legal Disclaimer ์˜ค์ง ๊ต์œก์  ๋ชฉ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋น„ํŠธ์œˆ์€ VCNC์˜ ์ž์‚ฐ์ž…๋‹ˆ๋‹ค. ์•…์˜์  ๊ณต๊ฒฉ์— ์ด์šฉํ• ์‹œ ์ฒ˜๋ฒŒ ๋ฐ›์„์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์— ๋”ฐ๋ฅธ ์ฑ…์ž„์€ ์‚ฌ์šฉ์ž๊ฐ€

1 Mar 15, 2022
rewise is an unofficial wrapper for google search's auto-complete feature

rewise is an unofficial wrapper for google search's auto-complete feature

Somdev Sangwan 71 Jul 19, 2022
This discord bot preview user 42intra login picture.

42intra_Pic BOT This discord bot preview user 42intra login picture. created by: @YOPI#8626 Using: Python 3.9 (64-bit) (You don't need 3.9 but some fu

Zakaria Yacoubi 7 Mar 22, 2022
The Official Twilio SendGrid Led, Community Driven Python API Library

The default branch name for this repository has been changed to main as of 07/27/2020. This library allows you to quickly and easily use the SendGrid

Twilio SendGrid 1.4k Jan 07, 2023
Python API Client for Twitter API v2

๐Ÿ Python Client For Twitter API v2 ๐Ÿš€ Why Twitter Stream ? Twitter-Stream.py a python API client for Twitter API v2 now supports FilteredStream, Samp

Twitivity 31 Nov 19, 2022
Neko is An Anime themed advance Telegram group management bot.

NekoRobot A modular telegram Python bot running on python3 with an sqlalchemy, mongodb database. โ•’โ•โ•โ•ใ€Œ Status ใ€ Maintained Support Group Included Free

Lovely Boy 22 Jan 05, 2023