![]() ![]() rw-r-r- 1 root root 496 Dec 6 05:22 /usr/share/applications/sktop rw-r-r- 1 root root 463 Mar 21 09:45 /usr/share/applications/sktop rw-r-r- 1 root root 300 Dec 6 05:22 /usr/share/applications/sktop ![]() rw-r-r- 1 root root 448 Dec 6 05:22 /usr/share/applications/sktop rw-r-r- 1 root root 363 Mar 21 09:45 /usr/share/applications/sktop rw-r-r- 1 root root 1383 Jan 11 11:41 /usr/share/applications/sktop rw-r-r- 1 root root 8754 Nov 28 04:55 /usr/share/applications/sktop ![]() rw-r-r- 1 root root 125 /usr/share/applications/sktop $ ls -l /usr/share/applications/*.desktop Linux Mint users can list files in the /usr/share/applications/ directory for some examples of this. desktop file extension is used in Linux systems to create application launchers. The target believes fake_video.mp4 is legitimate and has no idea the operating system was just compromised. What we can't see in the GIF is the Netcat connection being made to the attacker's system when fake_video.mp4 opens. desktop file, configured to look like an ordinary MP4 in this file manager. The first (real_video.mp4) is a real MP4 of a movie trailer. It doesn’t always happen, but is probably to be expected since we’re not daemonising ourself properly.Two files are being extracted in the GIF. I’ve noticed a couple of zombie processes while testing this shell. You’ll need to modify it before it will work on windows. This particular implementation of the reverse shell is unix-based. If there are none, you’ll have to make do with a form-based PHP shell. Pick a port that’s allowed through Firewall. Outbound firewalling (aka egress filtering) may prevent your reverse shell connection reaching you. Thanks to Jovana Milutinovich for translating. Isn’t there going to be a rather suspicious looking shell process when the admin runs “ps”? It’s OK to hit cancel in your browser once you’ve got your shell. Your browser will appear to hang when you access the reverse shell. Additionally the PHP script attempts to daemonise itself and dissociate from the parent process to avoid this (though it rarely works in practise). It doesn’t seem to on the systems that I’ve tested it on (Gentoo Linux only so far). Isn’t the shell connection just going to be severed when the web server times out the PHP script? Perhaps you just can’t be bothered to upload a second program. You need to use an installed scripting language like Python, PERL, PHP, etc. Uploading a compiled program will be of no use in these situations. Perhaps the only areas on disk that you have write access to are mounted with the “noexec” option. Uid=81(apache) gid=81(apache) groups=81(apache) Some useful commans such as w, uname -a, id and pwd are run automatically for you: $ nc -v -n -l -p 1234Ĭonnect to from (UNKNOWN) 58012 If all went well, the web server should have thrown back a shell to your netcat listener. Run the script simply by browsing to the newly uploaded file in your web browser (NB: You won’t see any output on the web page, it’ll just hang if successful): Enjoy your new shell Using whatever vulnerability you’ve discovered in the website, upload php-reverse-shell.php. Use the same port here as you specified in the script (1234 in this example): $ nc -v -n -l -p 1234 Upload and Run the script Start a TCP listener on a host and port that will be accessible by the web server. $port = 1234 // CHANGE THIS Get Ready to catch the reverse shell Edit the following lines of php-reverse-shell.php: $ip = '127.0.0.1' // CHANGE THIS To prevent someone else from abusing your backdoor – a nightmare scenario while pentesting – you need to modify the source code to indicate where you want the reverse shell thrown back to. Update 2011-11: Imax sent me a link to his tool fimap which uses php-reverse-shell. I stumbled across this video someone made of php-reverse-shell. It differs from web form-based shell which allow you to send a single command, then return you the output. This will be a proper interactive shell in which you can run interective programs like telnet, ssh and su. Bound to this TCP connection will be a shell. The script will open an outbound TCP connection from the webserver to a host and port of your choice. Upload this script to somewhere in the web root then run it by accessing the appropriate URL in your browser. This tool is designed for those situations during a pentest where you have upload access to a webserver that’s running PHP. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |