pwn 0.4.775 → 0.4.777

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c10eec4ac3e1712691c0031a5883fc2a2e11398748f1823a8d49b6b210e50aff
4
- data.tar.gz: 289ca6ece7d3ae829aba16e87e8515e89a1e21e1bbdd2e9eef1aa3b631200f63
3
+ metadata.gz: f010f6946026fa35eaba80996d2f554e92a7e28c5df3c57231ce2e55a96afc21
4
+ data.tar.gz: 273fc93801ef7cbdb98d5d1aa0b546253035fdceae8931eb6f25d3460a980c17
5
5
  SHA512:
6
- metadata.gz: a0ac4410338cc0601beca35c142484a4bfadd7ea197b23e24338bd68e8f989c1e233a03d80a26e6dd35ac8169e7053fa039d259a7416bb2037280bff200d6908
7
- data.tar.gz: a6289daeb468bf6255fb3594bf43c7fe61e7cb3c009d6b68ef19105675ed6f3e90466a3360b6632ee7709100ef8bd1dbd0c65fe8389c8e84baaf05cbfffb3f63
6
+ metadata.gz: 07b0a422d6ac663b8fdf49eeb2bfbbdf8c95972bdbe2b4eb989af7446a39003a39f165b605ffc1cce25be4f7acd99aedd8c5c9ddf4d63f4a7e31725ea07ffc79
7
+ data.tar.gz: 050fe7af93b7660565632a89edf77a9e5554103c4b1c28099cf327e246d87b615673e142e1de6b8a4c447fd68dc5a87d6e330cd3f7fe67aa8481112f76a9b7ab
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.775]:001 >>> PWN.help
40
+ pwn[v0.4.777]: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.775]:001 >>> PWN.help
55
+ pwn[v0.4.777]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -20,8 +20,8 @@ OptionParser.new do |options|
20
20
  opts[:username] = user
21
21
  end
22
22
 
23
- options.on('-PPASS', '--password=PASS', '<Optional - Jenkins Password (Will Prompt if Flag Undetected)>') do |pass|
24
- opts[:password] = pass
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
- password = opts[:password]
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
- password: password
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
- password: password
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('-PPASS', '--password=PASS', '<Required - Jenkins Password>') do |pass|
24
- opts[:password] = pass
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
- password = opts[:password]
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
- password: password
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
- password: password
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('-PPASS', '--password=PASS', '<Required - Jenkins Password>') do |pass|
24
- opts[:password] = pass
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
- password = opts[:password]
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
- password: password
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
- password: password
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('-PPASS', '--password=PASS', '<Required - Jenkins Password>') do |pass|
24
- opts[:password] = pass
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
- password = opts[:password]
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
- password: password
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
- password: password
69
+ api_key: api_key
70
70
  )
71
71
  end
72
72
 
@@ -20,8 +20,8 @@ OptionParser.new do |options|
20
20
  opts[:admin_username] = auser
21
21
  end
22
22
 
23
- options.on('-PAPASS', '--admin-password=APASS', '<Required - Jenkins Admin Password>') do |apass|
24
- opts[:admin_password] = apass
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
- admin_password = opts[:admin_password]
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
- password: admin_password
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
- password: admin_password
71
+ api_key: admin_api_key
72
72
  )
73
73
  end
74
74
 
@@ -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
- # password: 'optional password (functionality will be limited if ommitted)'
19
- # identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/password',
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
- password = opts[:password].to_s.scrub
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 == '' && password == ''
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
- password = PWN::Plugins::AuthenticationHelper.mask_password if password == ''
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
- password: password,
78
+ password: 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
- password: 'optional password (functionality will be limited if ommitted)',
459
- identity_file: 'optional ssh private key path to AuthN w/ Jenkins PREFERRED over username/password',
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.775'
4
+ VERSION = '0.4.777'
5
5
  end
@@ -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 -P $initial_admin_pwd -e $new_email
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
- -P $initial_admin_pwd \
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
- -P $initial_admin_pwd \
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
- -P $initial_admin_pwd \
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
- -P $initial_admin_pwd \
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
- -P $initial_admin_pwd \
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
- -P $initial_admin_pwd \
85
+ --api-key $initial_admin_pwd \
86
86
  -v 'User-Land' \
87
87
  -r '^userland-.+$'
@@ -46,7 +46,7 @@ jenkins_obj = PWN::Plugins::Jenkins.connect(
46
46
  ip: '127.0.0.1',
47
47
  port: 8888,
48
48
  username: userland_user,
49
- password: userland_pass
49
+ api_key: userland_pass
50
50
  )
51
51
 
52
52
  if jenkins_userland_config.include?('jenkins_job_credentials') &&
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.775
4
+ version: 0.4.777
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.