Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/fuzzers/smb/smb_create_pipe.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::SMB::Client7include Msf::Auxiliary::Fuzzer89def initialize(info = {})10super(update_info(info,11'Name' => 'SMB Create Pipe Request Fuzzer',12'Description' => %q{13This module sends a series of SMB create pipe14requests using malicious strings.15},16'Author' => [ 'hdm' ],17'License' => MSF_LICENSE18))19end2021def do_smb_create(pkt,opts={})22@connected = false23connect24smb_login25@connected = true26smb_create("\\" + pkt)27end2829def run30last_str = nil31last_inp = nil32last_err = nil3334cnt = 03536fuzz_strings do |str|37cnt += 13839if(cnt % 100 == 0)40print_status("Fuzzing with iteration #{cnt} using #{@last_fuzzer_input}")41end4243begin44do_smb_create(str, 0.25)45rescue ::Interrupt46print_status("Exiting on interrupt: iteration #{cnt} using #{@last_fuzzer_input}")47raise $!48rescue ::Exception => e49last_err = e50ensure51disconnect52end5354if(not @connected)55if(last_str)56print_status("The service may have crashed: iteration:#{cnt-1} method=#{last_inp} string=#{last_str.unpack("H*")[0]} error=#{last_err}")57else58print_status("Could not connect to the service: #{last_err}")59end60return61end6263last_str = str64last_inp = @last_fuzzer_input65end66end67end686970