pwn 0.5.302 → 0.5.303

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: f1fbd47d7c9374e09b1e1d6478921b0e06074db6ba2a9397d4cc4c2ce002dc37
4
- data.tar.gz: 7439dd249821d50724cd0170bf12aad128e7fef806a7ff690edcbfec9cb21534
3
+ metadata.gz: c05b6705a2d4cb4d1e2fbccc6eff8e9752df2660610d577bc62397d116e4164a
4
+ data.tar.gz: 8d9f9ec925222a6c8650ebb9e637a71264f258581e138ee650199699fbd81751
5
5
  SHA512:
6
- metadata.gz: b53a71b82e5693e00de4ab453594e46c405cff6ff55eff71962ad6ea25f8d0dec2ec27706ca6826d215e15aa62fb9a268b6fba53aeff5961fc3d488222c388e8
7
- data.tar.gz: 4a4719c806c9637161d7dfcbade0e0d7a4366525b9224b00217a5527d55cbff32fad3aa96b9576aa0ceeda392cf58db542f71d49fd9168ad95533db8af0f1eb6
6
+ metadata.gz: 5f0aa077f65377bc75d46a4fc5a60eb200b142075f0d4d1c3eb78caa05d54c8abdf50f1f64855ff86ef993c178e415f8865fbdb2a26086a2a5dff73ea67248dc
7
+ data.tar.gz: c02c7cdc07bda2ecd0790af222f6e5eccff0219c87e61edd66d596c53817f23a6e07b3dae2e959fe0028b866a8f10ae4a478b825dbb98899ff0e9051541df5d3
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
37
37
  $ ./install.sh
38
38
  $ ./install.sh ruby-gem
39
39
  $ pwn
40
- pwn[v0.5.302]:001 >>> PWN.help
40
+ pwn[v0.5.303]: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.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.302]:001 >>> PWN.help
55
+ pwn[v0.5.303]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
  If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.302]:001 >>> PWN.help
65
+ pwn[v0.5.303]:001 >>> PWN.help
66
66
  ```
67
67
 
68
68
  PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
@@ -43,7 +43,7 @@ if (( $# == 3 )); then
43
43
  latest_gem=$(ls pkg/*.gem)
44
44
  if [[ $latest_gem != "" ]]; then
45
45
  echo "Pushing ${latest_gem} to RubyGems.org..."
46
- rvmsudo gem push $latest_gem --debug
46
+ rvmsudo gem push $latest_gem
47
47
  fi
48
48
 
49
49
  if [[ $tag_this_version_bool == 'true' ]]; then
@@ -282,10 +282,9 @@ module PWN
282
282
  rest_call: 'issue',
283
283
  http_body: http_body
284
284
  )
285
+ issue = issue_resp[:key]
285
286
 
286
287
  if attachments.any?
287
- issue = issue_resp[:key]
288
-
289
288
  attachments.each do |attachment|
290
289
  raise "ERROR: #{attachment} not found." unless File.exist?(attachment)
291
290
 
@@ -305,22 +304,20 @@ module PWN
305
304
  end
306
305
 
307
306
  if comment
308
- issue = issue_resp[:key]
309
-
310
- http_body = {
311
- body: comment
312
- }
313
-
314
- rest_call(
315
- http_method: :post,
307
+ issue_comment(
316
308
  base_api_uri: base_api_uri,
317
309
  token: token,
318
- rest_call: "issue/#{issue}/comment",
319
- http_body: http_body
310
+ issue: issue,
311
+ comment_action: :add,
312
+ comment: comment
320
313
  )
321
314
  end
322
315
 
323
- issue_resp
316
+ get_issue(
317
+ base_api_uri: base_api_uri,
318
+ token: token,
319
+ issue: issue
320
+ )
324
321
  rescue StandardError => e
325
322
  raise e
326
323
  end
@@ -351,7 +348,7 @@ module PWN
351
348
 
352
349
  http_body = fields
353
350
 
354
- issue_resp = rest_call(
351
+ rest_call(
355
352
  http_method: :put,
356
353
  base_api_uri: base_api_uri,
357
354
  token: token,
@@ -378,7 +375,11 @@ module PWN
378
375
  end
379
376
  end
380
377
 
381
- issue_resp
378
+ get_issue(
379
+ base_api_uri: base_api_uri,
380
+ token: token,
381
+ issue: issue
382
+ )
382
383
  rescue StandardError => e
383
384
  raise e
384
385
  end
@@ -390,6 +391,7 @@ module PWN
390
391
  # issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)',
391
392
  # comment_action: 'required - action to perform on the issue comment (e.g. :delete, :add, :update - Defaults to :add)',
392
393
  # comment_id: 'optional - comment ID to delete or update (e.g. 10000)',
394
+ # author: 'optional - author of the comment (e.g. "jane.doe")',
393
395
  # comment: 'optional - comment to add or update in the issue (e.g. "This is a comment")'
394
396
  # )
395
397
 
@@ -410,6 +412,7 @@ module PWN
410
412
  comment_id = opts[:comment_id]
411
413
  raise 'ERROR: comment_id cannot be nil when comment_action is :delete or :update.' unless %i[delete update].include?(comment_action) || comment_id.nil?
412
414
 
415
+ author = opts[:author]
413
416
  comment = opts[:comment].to_s.scrub
414
417
 
415
418
  case comment_action
@@ -417,6 +420,7 @@ module PWN
417
420
  http_method = :post
418
421
  rest_call = "issue/#{issue}/comment"
419
422
  http_body = { body: comment }
423
+ http_body[:author] = author if author
420
424
  when :delete
421
425
  http_method = :delete
422
426
  rest_call = "issue/#{issue}/comment/#{comment_id}"
@@ -425,6 +429,7 @@ module PWN
425
429
  http_method = :put
426
430
  rest_call = "issue/#{issue}/comment/#{comment_id}"
427
431
  http_body = { body: comment }
432
+ http_body[:author] = author if author
428
433
  end
429
434
 
430
435
  rest_call(
@@ -434,6 +439,12 @@ module PWN
434
439
  rest_call: rest_call,
435
440
  http_body: http_body
436
441
  )
442
+
443
+ get_issue(
444
+ base_api_uri: base_api_uri,
445
+ token: token,
446
+ issue: issue
447
+ )
437
448
  rescue StandardError => e
438
449
  raise e
439
450
  end
@@ -534,7 +545,8 @@ module PWN
534
545
  description: 'optional - description of the issue',
535
546
  epic_name: 'optional - name of the epic',
536
547
  additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)',
537
- attachment: 'optional - attachment path to upload to the issue (e.g. \"/path/to/file1.txt\")'
548
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/tmp/file1.txt\", \"/tmp/file2.txt\"])',
549
+ comment: 'optional - comment to add to the issue (e.g. \"This is a comment\")'
538
550
  )
539
551
 
540
552
  issue_resp = #{self}.update_issue(
@@ -542,7 +554,7 @@ module PWN
542
554
  token: 'required - personal access token',
543
555
  issue: 'required - issue to update (e.g. Bug, Issue, Story, or Epic ID)',
544
556
  fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
545
- attachment: 'optional - attachment path to upload to the issue (e.g. \"/path/to/file1.txt\")'
557
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/tmp/file1.txt\", \"/tmp/file2.txt\"])'
546
558
  )
547
559
 
548
560
  issue_resp = #{self}.issue_comment(
@@ -551,6 +563,7 @@ module PWN
551
563
  issue: 'required - issue to comment on (e.g. Bug, Issue, Story, or Epic ID)',
552
564
  comment_action: 'required - action to perform on the issue comment (e.g. :delete, :add, :update - Defaults to :add)',
553
565
  comment_id: 'optional - comment ID to delete or update (e.g. 10000)',
566
+ author: 'optional - author of the comment (e.g. \"jane.doe\")',
554
567
  comment: 'optional - comment to add or update in the issue (e.g. \"This is a comment\")'
555
568
  )
556
569
 
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.5.302'
4
+ VERSION = '0.5.303'
5
5
  end
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.5.302
4
+ version: 0.5.303
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.