spelling, formatting
parent
e2468d8f1e
commit
4f61fe992b
|
@ -89,6 +89,7 @@ In this example we make a `post` form that pings a user provided IP, which is a
|
||||||
2. `mkdir /var/www/cgi-bin`
|
2. `mkdir /var/www/cgi-bin`
|
||||||
3. Enable folder for cgi execution: add `ScriptAlias "/cgi-bin/" "/var/www/cgi-bin/"` to `/etc/apache2/sites-enabled/000-default.conf ` inside of the `VirtualHost` tags
|
3. Enable folder for cgi execution: add `ScriptAlias "/cgi-bin/" "/var/www/cgi-bin/"` to `/etc/apache2/sites-enabled/000-default.conf ` inside of the `VirtualHost` tags
|
||||||
4. Create the vulnerable page by writing the following text to `/var/www/cgi-bin/example.pl`:
|
4. Create the vulnerable page by writing the following text to `/var/www/cgi-bin/example.pl`:
|
||||||
|
|
||||||
```
|
```
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
use CGI qw(:standard);
|
use CGI qw(:standard);
|
||||||
|
@ -106,6 +107,7 @@ In this example we make a `post` form that pings a user provided IP, which is a
|
||||||
$query->end_form(),
|
$query->end_form(),
|
||||||
$query->end_html();
|
$query->end_html();
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Make it executable: `chmod +x /var/www/cgi-bin/example.pl`
|
5. Make it executable: `chmod +x /var/www/cgi-bin/example.pl`
|
||||||
|
|
||||||
We can verify this page is exploitable by chaining commands so instead of submitting `127.0.0.1` we'll submit `127.0.0.1;whoami`.
|
We can verify this page is exploitable by chaining commands so instead of submitting `127.0.0.1` we'll submit `127.0.0.1;whoami`.
|
||||||
|
@ -195,6 +197,7 @@ In this example we make a `post` form that pings a user provided IP, which is a
|
||||||
|
|
||||||
1. Enable cgi: `a2enmod php7.0`
|
1. Enable cgi: `a2enmod php7.0`
|
||||||
2. Create the vulnerable page by writing the following text to `/var/www/html/example.php`:
|
2. Create the vulnerable page by writing the following text to `/var/www/html/example.php`:
|
||||||
|
|
||||||
```
|
```
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in New Issue