Skip to content

Commit 3c92d53

Browse files
committed
Lnad rapid7#5334, @wchen-r7's deletes unnecessary check on mysql_drop_and_create_sys_exec
2 parents 25099dd + 12038ed commit 3c92d53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/core/exploit/mysql.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ def mysql_upload_sys_udf(arch=:win32,target_path=nil)
162162
end
163163

164164
def mysql_drop_and_create_sys_exec(soname)
165-
res = mysql_query("DROP FUNCTION IF EXISTS sys_exec") # Already checked, actually
166-
return false if res.nil?
165+
# Just drop it. MySQL will always say "OK" anyway.
166+
# See #5244
167+
mysql_query("DROP FUNCTION IF EXISTS sys_exec")
167168

168169
res = mysql_query("CREATE FUNCTION sys_exec RETURNS int SONAME '#{soname}'")
169170
return false if res.nil?

0 commit comments

Comments
 (0)