what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

molly-0.5.txt

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

Molly v0.5, a simple IRC bot, has a remote command execution vulnerability.

tags | remote
SHA-256 | de62902cfd60d5669ce7aa5ae775c74b939aa91c990f1a6f94003714552a1f80

molly-0.5.txt

Change Mirror Download
Molly 0.5 - Remote Command Execution
Discovered By guejez of scan-associates.net

About Molly:
------------------
[quote from Molly homepage]

"Molly is a small, simple IRC bot that I use for intra-office
communication. She
will handle lunch menus, stock quotes, take polls and stuff like that."

[/quote from Molly homepage]

Molly is avaliable at http://www.lysator.liu.se/~unicorn/hacks/molly/


Vulnerable (tested) Versions:
--------------------
Molly version 0.5 on SuSe 7.3


Vendor Contact:
----------------
07-22-02 - Emailed unicorn ^^at^^ lysator.liu.se Alerted him of this
vulnerability
07-23-02 - Recieved email confirming vulnerabilties and stating some issues
will
be fixed in newer versions and some will not be fixed.


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

1. Due to a call which sends unfiltered user input to be interpreted
by the shell it is possible to run any command at the permission level
of the script.

A more detailed explaination:

In plugins/nslookup.pl the script makes a call to the shell. Sending
user input in the $host variable:

@answer = `/usr/bin/nslookup $host`; # FIXME: Should be configurable.

The user input is not checked for any shell metacharacters or limited
to any set of characters, so users can execute commands by supplying
something like scan-associates.net;/bin/ls

I suggest fixing this by making sure $host is only the characters \w or
'.'
(this limits nslookup queries, you may want to come up with your own
filter).
Then use system('/usr/bin/nslookup', $host); instead of ``, so that the
$host variable is sent as an argument only, not directly to the shell.

The same advice should be used with:

@answer = `/home/hape/bin/winpopup.sh $to $from "$message"`;

in unusedplugins/pop.pl

`/home/hape/bin/sms.pl $words[2] $words[3] "$text"`;

in unusedplugins/sms.pl

and

open(SMB, "| smbclient '\\\\$server\\$printer' lkpcourse -P -U
lkpcourse -n
lkpcourse -W LKPIFS") || die("Couldn't open /tmp/hpled.tmp!");

in unusedplugins/hpled.pl. All of which are making calls to the shell
without
checking user input.


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


Fix:
----
According to the author a fix for some of the issues will be in all
versions after
0.5. The author did make note that anything in the unusedplugins/
directory is not
maintained, may not work, and may introduce security issues into your
script. Use
with causion. The website for molly reflexs that there has been no fixes
for any
of these issues.

As a quick fix replace the following line in plugins/nslookup.pl:

@answer = `/usr/bin/nslookup $host`; # FIXME: Should be configurable.

With:

$host =~ s/[^\w\.]//g;
open(NSLOOKUP, "-|", "/usr/bin/nslookup '$host'");
@answer = <NSLOOKUP>;

I suggest not to use any plugins from within unusedplugins, but if you must
then
replace the following line in unusedplugins/pop.pl

@answer = `/home/hape/bin/winpopup.sh $to $from "$message"`;

With:

$to =~ s/[^\w\.]//g;
$from =~ s/[^\w\.\s]//g;
open(WINPOP, "-|", "/usr/bin/nslookup /home/hape/bin/winpopup.sh '$to'
'$from' '$message'");
@answer = <WINPOP>;

Replace the following line in unusedplugins/sms.pl

`/home/hape/bin/sms.pl $words[2] $words[3] "$text"`;

With:

$words[2] =~ s/[^\w\.\s]//g;
$words[3] =~ s/[^\w\.\s]//g;
$text =~ s/[^\w\.\s]//g;
system('/home/hape/bin/sms.pl', $words[2], $words[3], $text);

And replace the following line in unusedplugins/hpled.pl:

open(SMB, "| smbclient '\\\\$server\\$printer' lkpcourse -P -U lkpcourse -n
lkpcourse -W LKPIFS") || die("Couldn't open /tmp/hpled.tmp!");

With:

$server =~ s/[^\w\.]//g;
$printer =~ s/[^\w\.]//g;
open(SMB, "| smbclient '\\\\$server\\$printer' lkpcourse -P -U lkpcourse -n
lkpcourse -W LKPIFS") || die("Couldn't open /tmp/hpled.tmp!");


Thanks:
-------
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:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close