3 *[browse.php - Remote payload](https://github.com/bytecode-77/browse.php-payload), single file directory browser & downloader <https://bytecode77.com/hacking/payloads/browse>*
\r
5 **browse.php** is a PHP single-file script providing an HTML based directory
\r
6 browser. Once arbitrary write access is granted to a directory, deploying this
\r
7 file will yield comprehensive insights in the directory structure of the server.
\r
9 The script allows to...
\r
11 * ... browse the file system with the privileges of the executing user
\r
12 * ... download files using PHP's `readfile()`
\r
13 * ... dictionary traversal, i.e. attempting paths, like `"..\..\..\"` *(if possible)*
\r
17 Let's have a look at some comprehensive screenshots. For demonstration purposes,
\r
18 I deployed this script on my own server, which I obviously *have* write access
\r
19 to. While taking the screenshots, I have picked a non-guessible name in order to
\r
20 avoid "accidents" in the time beeing. After I was finished, I deleted the file -
\r
21 **don't forget this if you test the script!**
\r
23 ### 1. Starting the script
\r
25 You have done 99% of the work by acquiring write access remotely.
\r
26 Congratulations, you are a genious! ;) Now, browse.php will list the current
\r
27 directory. From there, navigation is a simple & UI based task.
\r
29 ![](https://bytecode77.com/images/sites/hacking/payloads/browse/001.png)
\r
31 ### 2. View & download files
\r
33 You can view or download any file. Especially PHP files - and we all know which
\r
34 ones are particularly interesting. This is a lot more convenient than the
\r
35 `readfile("[...]\config.php")` code is that usually deployed in multiple trial
\r
36 and error attempts until the correct path is hit.
\r
38 ![](https://bytecode77.com/images/sites/hacking/payloads/browse/002.png)
\r
40 Any file you care about is accessible and can be downloaded. Note, that this is
\r
41 a simple and therefore deployable & compatible script, not a feature complete
\r
42 "remote cloud solution payload".
\r
44 ![](https://bytecode77.com/images/sites/hacking/payloads/browse/003.png)
\r
46 Directory traversal attacks, like `"..\..\..\..\file.txt"` are possible, as we
\r
47 can specify any path to the script. Here, I have deliberately weakened the
\r
48 server configuration to demonstrate how a user that is not jailed could cause
\r
51 Please note, that I'm using **my own** server for this demonstration. I really
\r
52 hope I didn't forget to delete the file afterwards...
\r
54 ![](https://bytecode77.com/images/sites/hacking/payloads/browse/004.png)
\r
58 I have actually developed this while testing suphp, Apache MPM and similar, not
\r
59 in an actual pentest. This helped me to debug through the web server
\r
60 implementation. However, the main purpose primarily suits pentesting.
\r
64 [![](https://bytecode77.com/images/shared/favicon16.png) bytecode77.com/hacking/payloads/browse](https://bytecode77.com/hacking/payloads/browse)