Skip to content

Commit 12038ed

Browse files
committed
Fix rapid7#5244, Remove unnecessary check for mysql_drop_and_create_sys_exec
Fix rapid7#5244, MySQL is always return OK so it doesn't seem to be so important to check res for DROP FUNCTION IF EXISTS sys_exe
1 parent cc87df9 commit 12038ed

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)