Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/jenkins_groovy_code_exec/module.rb
1154 views
1
#
2
# Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
# Browser Exploitation Framework (BeEF) - https://beefproject.com
4
# See the file 'doc/COPYING' for copying permission
5
#
6
class Jenkins_groovy_code_exec < BeEF::Core::Command
7
def self.options
8
configuration = BeEF::Core::Configuration.instance
9
lhost = configuration.beef_host
10
lhost = '' if lhost == '0.0.0.0'
11
[
12
{ 'name' => 'rhost', 'ui_label' => 'Remote Host', 'value' => '127.0.0.1' },
13
{ 'name' => 'rport', 'ui_label' => 'Remote Port', 'value' => '80' },
14
{ 'name' => 'uri', 'ui_label' => 'Target URI', 'value' => '/jenkins/' },
15
{ 'name' => 'rproto',
16
'type' => 'combobox',
17
'ui_label' => 'Target Protocol',
18
'store_type' => 'arraystore',
19
'store_fields' => ['rproto'],
20
'store_data' => [['http'], ['https']],
21
'emptyText' => 'Select a protocol (HTTP/HTTPS)',
22
'valueField' => 'rproto',
23
'displayField' => 'rproto',
24
'mode' => 'local',
25
'forceSelection' => 'true',
26
'autoWidth' => true },
27
{ 'name' => 'payload',
28
'type' => 'combobox',
29
'ui_label' => 'Payload',
30
'store_type' => 'arraystore',
31
'store_fields' => ['payload'],
32
'store_data' => [['reverse_bash'], ['reverse_netcat'], ['reverse_python']],
33
'emptyText' => 'Select a payload',
34
'valueField' => 'payload',
35
'displayField' => 'payload',
36
'mode' => 'local',
37
'forceSelection' => 'false',
38
'autoWidth' => true },
39
{ 'name' => 'lhost', 'ui_label' => 'Listen Host', 'value' => lhost },
40
{ 'name' => 'lport', 'ui_label' => 'Listen Port', 'value' => '8080' }
41
]
42
end
43
44
def post_execute
45
save({ 'result' => @datastore['result'] })
46
end
47
end
48
49