pwn 0.4.775 → 0.4.776
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/pwn_jenkins_create_job +5 -5
- data/bin/pwn_jenkins_create_view +5 -5
- data/bin/pwn_jenkins_install_plugin +5 -5
- data/bin/pwn_jenkins_update_plugins +5 -5
- data/bin/pwn_jenkins_useradd +5 -5
- data/lib/pwn/plugins/jenkins.rb +8 -8
- data/lib/pwn/version.rb +1 -1
- data/vagrant/provisioners/jenkins.sh +7 -7
- data/vagrant/provisioners/jenkins_ssh-keygen.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ff1671592d8e854bb0f495bd1cbc1a285de652ea1548b5794d45ca39d5ef77
|
4
|
+
data.tar.gz: 5926108a739137b599a4ba2db1b5c713d2b3bf3efb3edacb7d0076b4c4b168c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1bd4834110a6f97787c86e8452a2569883aab04447d3900f29ca68faf6a0946799a82bcaa8db447ea8d89e1453fa73a50b45ef2c030b5dd0840c3b8adce728c
|
7
|
+
data.tar.gz: dcb5d740052ecedaac46fa496e1ee13414dfe85090fc0f66ba3c28d6a0f362efc2096ae43d021f0da22b2b1a177d79bbc4bd2878b2e3784894b2354e20ee0f0a
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
37
37
|
$ rvm list gemsets
|
38
38
|
$ gem install --verbose pwn
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.4.
|
40
|
+
pwn[v0.4.776]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.4.
|
55
|
+
pwn[v0.4.776]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
data/bin/pwn_jenkins_create_job
CHANGED
@@ -20,8 +20,8 @@ OptionParser.new do |options|
|
|
20
20
|
opts[:username] = user
|
21
21
|
end
|
22
22
|
|
23
|
-
options.on('-
|
24
|
-
opts[:
|
23
|
+
options.on('-PKEY', '--api-key=KEY', '<Optional - Jenkins API Key (Will Prompt if Flag Undetected)>') do |api_key|
|
24
|
+
opts[:api_key] = api_key
|
25
25
|
end
|
26
26
|
|
27
27
|
options.on('-jNAME', '--job-name=NAME', '<Required - Name of Job to Create>') do |job|
|
@@ -41,7 +41,7 @@ end
|
|
41
41
|
ip = opts[:ip].to_s.scrub
|
42
42
|
port = opts[:port].to_i
|
43
43
|
username = opts[:username]
|
44
|
-
|
44
|
+
api_key = opts[:api_key]
|
45
45
|
job_name = opts[:job_name].to_s.scrub
|
46
46
|
config_xml = File.read(opts[:config_xml]) if File.exist?(opts[:config_xml])
|
47
47
|
|
@@ -50,13 +50,13 @@ if port.positive?
|
|
50
50
|
ip: ip,
|
51
51
|
port: port,
|
52
52
|
username: username,
|
53
|
-
|
53
|
+
api_key: api_key
|
54
54
|
)
|
55
55
|
else
|
56
56
|
jenkins_obj = PWN::Plugins::Jenkins.connect(
|
57
57
|
ip: ip,
|
58
58
|
username: username,
|
59
|
-
|
59
|
+
api_key: api_key
|
60
60
|
)
|
61
61
|
end
|
62
62
|
|
data/bin/pwn_jenkins_create_view
CHANGED
@@ -20,8 +20,8 @@ OptionParser.new do |options|
|
|
20
20
|
opts[:username] = user
|
21
21
|
end
|
22
22
|
|
23
|
-
options.on('-
|
24
|
-
opts[:
|
23
|
+
options.on('-PKEY', '--api-key=KEY', '<Required - Jenkins API Key>') do |api_key|
|
24
|
+
opts[:api_key] = api_key
|
25
25
|
end
|
26
26
|
|
27
27
|
options.on('-vVIEW', '--view-name=VIEW', '<Required - View Name to Create>') do |view_name|
|
@@ -41,7 +41,7 @@ end
|
|
41
41
|
ip = opts[:ip].to_s.scrub
|
42
42
|
port = opts[:port].to_i
|
43
43
|
username = opts[:username]
|
44
|
-
|
44
|
+
api_key = opts[:api_key]
|
45
45
|
view_name = opts[:view_name].to_s.chomp.strip.scrub
|
46
46
|
regex_filter = opts[:regex_filter].to_s.chomp.strip.scrub
|
47
47
|
|
@@ -50,13 +50,13 @@ if port.positive?
|
|
50
50
|
ip: ip,
|
51
51
|
port: port,
|
52
52
|
username: username,
|
53
|
-
|
53
|
+
api_key: api_key
|
54
54
|
)
|
55
55
|
else
|
56
56
|
jenkins_obj = PWN::Plugins::Jenkins.connect(
|
57
57
|
ip: ip,
|
58
58
|
username: username,
|
59
|
-
|
59
|
+
api_key: api_key
|
60
60
|
)
|
61
61
|
end
|
62
62
|
|
@@ -20,8 +20,8 @@ OptionParser.new do |options|
|
|
20
20
|
opts[:username] = user
|
21
21
|
end
|
22
22
|
|
23
|
-
options.on('-
|
24
|
-
opts[:
|
23
|
+
options.on('-PKEY', '--api-key=KEY', '<Required - Jenkins API Key>') do |api_key|
|
24
|
+
opts[:api_key] = api_key
|
25
25
|
end
|
26
26
|
|
27
27
|
options.on('-pPLUGIN', '--plugin=PLUGIN', '<Required - Comma-Delimited List of Jenkins Plugins to Install>') do |plugins|
|
@@ -45,7 +45,7 @@ end
|
|
45
45
|
ip = opts[:ip].to_s.scrub
|
46
46
|
port = opts[:port].to_i
|
47
47
|
username = opts[:username]
|
48
|
-
|
48
|
+
api_key = opts[:api_key]
|
49
49
|
plugins = opts[:plugins].to_s.scrub
|
50
50
|
list_available_bool = if opts[:list_available_bool]
|
51
51
|
true
|
@@ -60,13 +60,13 @@ if port.positive?
|
|
60
60
|
ip: ip,
|
61
61
|
port: port,
|
62
62
|
username: username,
|
63
|
-
|
63
|
+
api_key: api_key
|
64
64
|
)
|
65
65
|
else
|
66
66
|
jenkins_obj = PWN::Plugins::Jenkins.connect(
|
67
67
|
ip: ip,
|
68
68
|
username: username,
|
69
|
-
|
69
|
+
api_key: api_key
|
70
70
|
)
|
71
71
|
end
|
72
72
|
|
@@ -20,8 +20,8 @@ OptionParser.new do |options|
|
|
20
20
|
opts[:username] = user
|
21
21
|
end
|
22
22
|
|
23
|
-
options.on('-
|
24
|
-
opts[:
|
23
|
+
options.on('-PKEY', '--api-key=KEY', '<Required - Jenkins API Key>') do |api_key|
|
24
|
+
opts[:api_key] = api_key
|
25
25
|
end
|
26
26
|
|
27
27
|
options.on('-pPLUGIN', '--plugin-name=PLUGIN', '<Optional - Update Specific Plugin>') do |plugin_name|
|
@@ -45,7 +45,7 @@ end
|
|
45
45
|
ip = opts[:ip].to_s.scrub
|
46
46
|
port = opts[:port].to_i
|
47
47
|
username = opts[:username]
|
48
|
-
|
48
|
+
api_key = opts[:api_key]
|
49
49
|
plugin_name = opts[:plugin_name]
|
50
50
|
list_updates_bool = if opts[:list_updates_bool]
|
51
51
|
true
|
@@ -60,13 +60,13 @@ if port.positive?
|
|
60
60
|
ip: ip,
|
61
61
|
port: port,
|
62
62
|
username: username,
|
63
|
-
|
63
|
+
api_key: api_key
|
64
64
|
)
|
65
65
|
else
|
66
66
|
jenkins_obj = PWN::Plugins::Jenkins.connect(
|
67
67
|
ip: ip,
|
68
68
|
username: username,
|
69
|
-
|
69
|
+
api_key: api_key
|
70
70
|
)
|
71
71
|
end
|
72
72
|
|
data/bin/pwn_jenkins_useradd
CHANGED
@@ -20,8 +20,8 @@ OptionParser.new do |options|
|
|
20
20
|
opts[:admin_username] = auser
|
21
21
|
end
|
22
22
|
|
23
|
-
options.on('-
|
24
|
-
opts[:
|
23
|
+
options.on('-PKEY', '--admin-password=KEY', '<Required - Jenkins Admin API Key>') do |akey|
|
24
|
+
opts[:admin_api_key] = akey
|
25
25
|
end
|
26
26
|
|
27
27
|
options.on('-uNUSER', '--new-username=NUSER', '<Required - Jenkins Username to Create>') do |nuser|
|
@@ -50,7 +50,7 @@ ip = opts[:ip].to_s.scrub
|
|
50
50
|
port = opts[:port].to_i
|
51
51
|
|
52
52
|
admin_username = opts[:admin_username]
|
53
|
-
|
53
|
+
admin_api_key = opts[:admin_api_key]
|
54
54
|
|
55
55
|
new_username = opts[:new_username]
|
56
56
|
new_password = opts[:new_password]
|
@@ -62,13 +62,13 @@ if port.positive?
|
|
62
62
|
ip: ip,
|
63
63
|
port: port,
|
64
64
|
username: admin_username,
|
65
|
-
|
65
|
+
api_key: admin_api_key
|
66
66
|
)
|
67
67
|
else
|
68
68
|
jenkins_obj = PWN::Plugins::Jenkins.connect(
|
69
69
|
ip: ip,
|
70
70
|
username: admin_username,
|
71
|
-
|
71
|
+
api_key: admin_api_key
|
72
72
|
)
|
73
73
|
end
|
74
74
|
|
data/lib/pwn/plugins/jenkins.rb
CHANGED
@@ -15,8 +15,8 @@ module PWN
|
|
15
15
|
# ip: 'required host/ip of Jenkins Server',
|
16
16
|
# port: 'optional tcp port (defaults to 8080),
|
17
17
|
# username: 'optional username (functionality will be limited if ommitted)',
|
18
|
-
#
|
19
|
-
# identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/
|
18
|
+
# api_key: 'optional api_key (functionality will be limited if ommitted)'
|
19
|
+
# identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/api_key',
|
20
20
|
# ssl: 'optional connect over TLS (defaults to true),
|
21
21
|
# proxy: 'optional debug proxy rest api requests to jenkins (e.g. "http://127.0.0.1:8080")''
|
22
22
|
# )
|
@@ -30,7 +30,7 @@ module PWN
|
|
30
30
|
end
|
31
31
|
username = opts[:username].to_s.scrub
|
32
32
|
base_jenkins_api_uri = "https://#{ip}/ase/services".to_s.scrub
|
33
|
-
|
33
|
+
api_key = opts[:api_key].to_s.scrub
|
34
34
|
identity_file = opts[:identity_file].to_s.scrub
|
35
35
|
ssl_bool = if opts[:ssl] == true
|
36
36
|
opts[:ssl]
|
@@ -46,7 +46,7 @@ module PWN
|
|
46
46
|
end
|
47
47
|
|
48
48
|
@@logger.info("Logging into Jenkins Server: #{ip}")
|
49
|
-
if username == '' &&
|
49
|
+
if username == '' && api_key == ''
|
50
50
|
if identity_file == ''
|
51
51
|
jenkins_obj = JenkinsApi::Client.new(
|
52
52
|
server_ip: ip,
|
@@ -70,12 +70,12 @@ module PWN
|
|
70
70
|
)
|
71
71
|
end
|
72
72
|
else
|
73
|
-
|
73
|
+
api_key = PWN::Plugins::AuthenticationHelper.mask_password if api_key == ''
|
74
74
|
jenkins_obj = JenkinsApi::Client.new(
|
75
75
|
server_ip: ip,
|
76
76
|
server_port: port,
|
77
77
|
username: username,
|
78
|
-
|
78
|
+
api_key: api_key,
|
79
79
|
follow_redirects: true,
|
80
80
|
ssl: ssl_bool,
|
81
81
|
proxy_protocol: proxy_protocol,
|
@@ -455,8 +455,8 @@ module PWN
|
|
455
455
|
ip: 'required host/ip of Jenkins Server',
|
456
456
|
port: 'optional tcp port (defaults to 8080),
|
457
457
|
username: 'optional username (functionality will be limited if ommitted)',
|
458
|
-
|
459
|
-
identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/
|
458
|
+
api_key: 'optional api_key (functionality will be limited if ommitted)',
|
459
|
+
identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/api_key',
|
460
460
|
ssl: 'optional connect over TLS (defaults to true),
|
461
461
|
proxy: 'optional debug proxy rest api requests to jenkins (e.g. "http://127.0.0.1:8080")''
|
462
462
|
)
|
data/lib/pwn/version.rb
CHANGED
@@ -26,7 +26,7 @@ new_pass=`ruby -e "require 'yaml'; print YAML.load_file('${jenkins_vagrant_yaml}
|
|
26
26
|
new_fullname=`ruby -e "require 'yaml'; print YAML.load_file('${jenkins_vagrant_yaml}')['fullname']"`
|
27
27
|
new_email=`ruby -e "require 'yaml'; print YAML.load_file('${jenkins_vagrant_yaml}')['email']"`
|
28
28
|
|
29
|
-
pwn_jenkins_useradd -s 127.0.0.1 -d 8888 -u $new_user -p $new_pass -U admin -
|
29
|
+
pwn_jenkins_useradd -s 127.0.0.1 -d 8888 -u $new_user -p $new_pass -U admin --api-key $initial_admin_pwd -e $new_email
|
30
30
|
|
31
31
|
# Begin Creating Self-Update Jobs in Jenkins and Template-Based Jobs to Describe how to Intgrate PWN into Jenkins
|
32
32
|
printf "Creating Self-Update and PWN-Template Jobs ********************************************"
|
@@ -36,7 +36,7 @@ ls $jenkins_userland_root/jobs/*.xml | while read jenkins_xml_config; do
|
|
36
36
|
pwn_jenkins_create_job --ip 127.0.0.1 \
|
37
37
|
-d 8888 \
|
38
38
|
-U admin \
|
39
|
-
-
|
39
|
+
--api-key $initial_admin_pwd \
|
40
40
|
-j $job_name \
|
41
41
|
-c $jenkins_xml_config
|
42
42
|
done
|
@@ -51,7 +51,7 @@ if [[ $? == 0 ]]; then
|
|
51
51
|
pwn_jenkins_create_job --ip 127.0.0.1 \
|
52
52
|
-d 8888 \
|
53
53
|
-U admin \
|
54
|
-
-
|
54
|
+
--api-key $initial_admin_pwd \
|
55
55
|
-j $job_name \
|
56
56
|
-c $jenkins_xml_config
|
57
57
|
done
|
@@ -61,27 +61,27 @@ printf "Creating Jenkins Views *************************************************
|
|
61
61
|
pwn_jenkins_create_view --ip 127.0.0.1 \
|
62
62
|
-d 8888 \
|
63
63
|
-U admin \
|
64
|
-
-
|
64
|
+
--api-key $initial_admin_pwd \
|
65
65
|
-v 'PWN-Templates' \
|
66
66
|
-r '^pwntemplate-.+$'
|
67
67
|
|
68
68
|
pwn_jenkins_create_view --ip 127.0.0.1 \
|
69
69
|
-d 8888 \
|
70
70
|
-U admin \
|
71
|
-
-
|
71
|
+
--api-key $initial_admin_pwd \
|
72
72
|
-v 'Self-Update' \
|
73
73
|
-r '^selfupdate-.+$'
|
74
74
|
|
75
75
|
pwn_jenkins_create_view --ip 127.0.0.1 \
|
76
76
|
-d 8888 \
|
77
77
|
-U admin \
|
78
|
-
-
|
78
|
+
--api-key $initial_admin_pwd \
|
79
79
|
-v 'Pipeline' \
|
80
80
|
-r '^pipeline-.+$'
|
81
81
|
|
82
82
|
pwn_jenkins_create_view --ip 127.0.0.1 \
|
83
83
|
-d 8888 \
|
84
84
|
-U admin \
|
85
|
-
-
|
85
|
+
--api-key $initial_admin_pwd \
|
86
86
|
-v 'User-Land' \
|
87
87
|
-r '^userland-.+$'
|