exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

perlbot-1.9.2.txt

perlbot-1.9.2.txt
Posted Oct 21, 2002
Authored by Guejez | Site scan-associates.net

Perlbot v1.9.2 contains a remote command execution vulnerability. Fix included.

tags | remote
SHA-256 | 1cb46c10f809342bb6dcd5681375800119327da30ee9b0584de6fcf65a6bec19

perlbot-1.9.2.txt

Change Mirror Download
perlbot 1.9.2 - Remote Command Execution
Discovered By guejez of scan-associates.net

About perlbot:
------------------
[quote from freshmeat]

"Perlbot is an IRC bot written in Perl. It depends on Net::IRC and its
goals are
simplicity, a small footprint, and modularity. It's meant as a more easily
configured
but (for now) less robust alternative to bots like eggdrop. It's also
noticeably
faster by the authors' tests. The base bot allows auto-opping, notes,
multiple
channels, channel forwarding/bridging, etc., but much much more is possible
through
the use of plugins. Many plugins are included, and it should be easy for
anyone with
some knowledge of perl to write their own plugins"

[/quote from freshmeat]

perlbot is avaliable at http://perlbot.sourceforge.net


Vulnerable (tested) Versions:
--------------------
Perlbot version 1.9.2 on SuSe 7.3


Vendor Contact:
----------------
07-22-02 - Emailed burke ^^at^^ bitflood.org and jmuhlich ^^at^^
bitflood.org
Alerted them of this vulnerability
07-22-02 - Recieved email confirming vulnerabilties and stating fixes will
be
in new version.


Vulnerabilities:
----------------
-- Command Execution

1. Due to poor input filtering and a call to the shell it is possible to
issue commands
remotely through the irc interface of this bot. Commands will be
executed with the
uid at which the bot is ran.

A more detailed explaination:

The script tries to make a secure shell call to the aspell program by
filtering user input. It does so in Plugins/Misc/SpelCheck/SpelCheck.pm
like
this:

$text =~ s/\`//g;
$text =~ s/\$//g;
$text =~ s/\|//g;

Then the call to the shell is:

my @spell = `echo "$text"| aspell -S -a 2>&1`;

To issue a command one could "break out" of the quotes and then issue a
seperate
command by using ; Inorder to prevent this more restrictive input
filtering
needs to be put inplace. The author said they will change from using
aspell
to using a google API for spell checking. This provides better support for
people who don't have aspell installed and more security.


2. Due to poor input filtering and a bad open() call it is possible to
execute commands.

A more detailed explaination:

The script tries to prevent reverse directory transversal by filtering user
input to disallow '..' in Plog.pl:

$p =~ s/\.\.//g; # so people can't read arbitrary files

$filename .= $p;

Then in HTMLPlog.pm it uses this variable to open a file in an unsafe way:

open FILE, $filename;

This allows for command execution if $filename ends in a |. Combin this
with the ability to do directory transversal with .\./ and you can issue
any command the script has permission to.


-- Path Transveral

1. Due to poor input filtering it is possible to read any file on the
server the
script has permission to.

A more detailed explaination:

This is the same issue as above, but without appending the | to the
inputted
filename. This will allow an attacker to to read any file the script has
permission to. The file contents will be sent to the clients browser.


Proof Of Concept:
-----------------
No proof of concept will be givin for these issues.

Fix:
----
According to the author a fix will be released with version 1.9.3, until
then my
suggested patch for version 1.4.2 is to replace this line in
plugins/SpelCheck/Plugin.pm:

$args =~ tr/\w //c;

With:

$args =~ s/[^\w]//g;

For version 1.9.2 my suggested fix is to replace these lines in
Plugins/Misc/SpelCheck/SpelCheck.pm:

# $text =~ tr/\w//c;

$text =~ s/\`//g;
$text =~ s/\$//g;
$text =~ s/\|//g;

With:

$text =~ s/[^\w]//g;

As a temperary fix, for both versions, I suggest removing the
miscscripts/irclogs
directory. Since the orignal draft of this advisory there has been
multiple new
versions of perlbot, download any above 1.9.2.


Thanks:
-------
Samy Kamkar - bugtraq post on another perlbot got me thinking. Good shell
trick with $IFS.
irc.efnet.org #vuln - various people helping with perl security issues.
pokleyzz, sk , and all of scan-associates.net


--------------------------------------------------------------------------
http://www.scan-associates.net/

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 Files
  • 26
    Apr 26th
    14 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    20 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close