Below is everything you really need in order to execute that proof-of-concept Perl script from your Kali box and test it — plus a short walkthrough of what the script is doing, so you can tweak / extend it later.
─────────────────────────────
- Prerequisites
─────────────────────────────
• A legal test target
‑ The bug only exists on Apache 1.3.x for Windows (Win32 build).
‑ Modern Apache (2.x) or any Unix/Linux build is not vulnerable.
‑ Kioptrix VMs ship with old Apache 1.3 on Linux, so they are not a match. You’d need your own Windows VM with Apache 1.3.x if you want to reproduce it.
• Perl 5 interpreter (already on Kali).
• The module LWP::Simple (part of the libwww-perl bundle).
‑ Most Kali images already have it, but if use LWP::Simple fails you can install with:
sudo apt update && sudo apt install libwww-perl
• Outbound HTTP connectivity from Kali to the vulnerable host (no special privileges required; any user can run it).
─────────────────────────────
2. Quick installation check
─────────────────────────────
perl -MLWP::Simple -e 'print "LWP OK\n"'
If you get “LWP OK”, you’re set. If you see “Can’t locate LWP/Simple.pm”, install the package as shown above.
─────────────────────────────
3. Save the script
─────────────────────────────
nano apache-slash-test.pl # or your editor of choice
(paste the code)
chmod +x apache-slash-test.pl # optional, lets you run ./apache-slash-test.pl
─────────────────────────────
4. Usage
─────────────────────────────
perl apache-slash-test.pl <target_host_or_IP>
Example:
perl apache-slash-test.pl 192.168.56.105
The script will:
- grab the normal root page (http://host/) and store it in $odata
- request the same page with 2 slashes, 3 slashes, … up to 4095 slashes
- stop when the server’s response differs (meaning the index file lookup failed and directory listing spilled out).
It then prints the number of slashes that trigger the bug and dumps the resulting directory listing.
─────────────────────────────
5. What if the target uses HTTPS?
─────────────────────────────
LWP::Simple can fetch HTTPS but only if the underlying SSL libraries are present.
You’d need to change the script a bit:
use LWP::UserAgent;
my ua->get("https://i))