base on Single-file PHP shell # p0wny@shell:~# -- Single-file PHP Shell [![Discord](https://img.shields.io/badge/chat-Discord-8c9eff?logo=discord&logoColor=ffffff)](https://discord.gg/P77sWhuSs4) p0wny@shell:~# is a very basic, single-file, PHP shell. It can be used to quickly execute commands on a server when pentesting a PHP application. Use it with caution: this script represents a security risk for the server. **Features:** * Command history (using arrow keys `↑` `↓`) * Auto-completion of command and file names (using `Tab` key) * Navigate on the remote file-system (using `cd` command) * Upload a file to the server (using `upload <destination_file_name>` command) * Download a file from the server (using `download <file_name>` command) **WARNING:** THIS SCRIPT IS A SECURITY HOLE. **DO NOT** UPLOAD IT ON A SERVER UNLESS YOU KNOW WHAT YOU ARE DOING! ![Screenshot](./screenshot.png) **Demo with Docker:** docker build -t p0wny . docker run -it -p 8080:8080 -d p0wny # open with your browser http://127.0.0.1:8080/shell.php ## Contributing ### Questions If you have any question, you can: * [Open an issue](https://github.com/flozz/p0wny-shell/issues) on GitHub * [Ask on Discord](https://discord.gg/P77sWhuSs4) (I am not always available to chat, but I try to answer to everyone) ### Bugs Please [open an issue](https://github.com/flozz/p0wny-shell/issues) on GitHub with as much information as possible if you found a bug: * Your operating system / Linux distribution (and its version) * The PHP version you are using (example: `PHP-FPM 8.1`, `Apache mod_php 7.4`,...) * The Web server you are using and its version (example: `Nginx 1.23`, `Apache 2.4.55`,...) * All the logs and message outputted by the software * etc. ### Pull requests Please consider [filing a bug](https://github.com/flozz/p0wny-shell/issues) before starting to work on a new feature; it will allow us to discuss the best way to do it. It is obviously unnecessary if you just want to fix a typo or small errors in the code. ## Support this project Want to support this project? * [☕️ Buy me a coffee](https://www.buymeacoffee.com/flozz) * [💵️ Give me a tip on PayPal](https://www.paypal.me/0xflozz) * [❤️ Sponsor me on GitHub](https://github.com/sponsors/flozz) ## Changelog * **v2023.08.10:** * Make p0wny@shell compatible with PHP 5.3 (@FrancoisCapon, #38) * **v2023.05.28:** * Encode all data fields as base64 to avoid encoding errors, especially on Windows (@cli-ish, #8, #35) * **v2023.05.22:** * Display the username and the hostname in the prompt (@cli-ish, #33, #7) * **v2023.05.10:** * Try different execution functions (`exec`, `shell_exec`, `system`, `passthru`, `popen`, `proc_open`) to run commands to bypass disabled functions (@cli-ish, #31, #32) * **v2023.02.27:** * Make terminal window resizable (@FrancoisCapon, #27) * **v2023.02.13:** * Larger terminal size on large screens (@psyray, #26) * No more horozontal scrolling on small screens (@flozz) * **v2022.09.19:** * Expand path in `cd` command (`cd ~`, `cd ~username`,...) * Go home when running cd withoud argument. * → Thanks @FrancoisCapon for the suggestion (#25) * **v2021.01.24:** * Style improvements: * Better-looking scrollbar on webkit (@nakamuraos) * Display a smaller logo on mobile (@nakamuraos) * Ergonomic improvements: * Focus the command field when clicking the page (@nakamuraos) * Put the cursor at the end of the command field while navigating the history (@nakamuraos) * **v2019.06.07:** * Adds the `clear` command to clear the terminal (@izharaazmi #12) * **v2018.12.15:** * File upload and download feature (@Oshawk #5) * **v2018.06.01:** * Auto-completion of command and file names (@lo001 #2) * Adaptation to mobile devices (responsive) (@lo001 #2) * Improved handling of stderr (@lo001 #2) * **v2018.05.30:** * ES5 compatibility (@lo00l #1) * Dependency to JQuery removed (@lo00l #1) * Command history using arrow keys (@lo00l #1) * Keep the command field focused when pressing the tab key * **v2017.10.30:** * CSS: invalid color fixed * **v2016.11.10:** * Initial release ", Assign "at most 3 tags" to the expected json: {"id":"5038","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"