pwn 0.4.549 → 0.4.551

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0d1670b553866c3340800ed557e77398ca60a533583bc63534332d6e5ab4043
4
- data.tar.gz: 6a36d5264d0d728a4fa348f4e5014b4638a94798781ddd8186da1b7377ebbb6d
3
+ metadata.gz: 37c116ff3072536f637e3b85299339fcff43cfae08fa907f51ef6db8f74bfeed
4
+ data.tar.gz: bf01ca52b18146da07b3aa882981be1484fc56a5fc72845415056a0d61438245
5
5
  SHA512:
6
- metadata.gz: a1bf0a013d812084b936c34f72d5547b8b3a8067f0f60bc23a316de61e5c4f96498ae857569d0e1a2154f52d1591176b03b248c6c5005819a72a914b95f88ef6
7
- data.tar.gz: 165057a3dfdc18c3f32b4cbcd9d002ddef46bfcc86cec92f0b7ba28180e626c16ef8e030f037a3701726262b1279b268243ab173ccefd9422f9bb94c9d381a38
6
+ metadata.gz: 4c4d7a6f950288b53d8850222c6a7f0ff22c54bf87de32cd7d842fde7ecef121374f1c1c6412f76fb26fb3fefc93b711b7b18e270d9b674c713e630f2174e381
7
+ data.tar.gz: 18553d6f48fe65b9a4885f17a912c58953539fa044da6e1f8d70a1d81bf860789cf8b8626f75b612ade3962dc7692714b1d15d857f657cf5f5770983d55cb3f8
data/Gemfile CHANGED
@@ -48,7 +48,7 @@ gem 'oily_png', '1.2.1'
48
48
  gem 'os', '1.1.4'
49
49
  gem 'packetfu', '1.1.13'
50
50
  gem 'pdf-reader', '2.10.0'
51
- gem 'pg', '1.4.3'
51
+ gem 'pg', '1.4.4'
52
52
  gem 'pry', '0.14.1'
53
53
  gem 'pry-doc', '1.3.0'
54
54
  gem 'rake', '13.0.6'
@@ -57,7 +57,7 @@ gem 'rbvmomi', '3.0.0'
57
57
  gem 'rdoc', '6.4.0'
58
58
  gem 'rest-client', '2.1.0'
59
59
  gem 'rex', '2.0.13'
60
- gem 'rmagick', '4.3.0'
60
+ gem 'rmagick', '5.0.0'
61
61
  gem 'rspec', '3.11.0'
62
62
  gem 'rtesseract', '3.1.2'
63
63
  gem 'rubocop', '1.36.0'
@@ -74,7 +74,7 @@ gem 'sinatra', '3.0.2'
74
74
  gem 'slack-ruby-client', '1.1.0'
75
75
  gem 'socksify', '1.7.1'
76
76
  gem 'spreadsheet', '1.3.0'
77
- gem 'sqlite3', '1.5.2'
77
+ gem 'sqlite3', '1.5.3'
78
78
  gem 'thin', '1.8.1'
79
79
  gem 'tty-prompt', '0.23.1'
80
80
  gem 'watir', '7.1.0'
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.549]:001 >>> PWN.help
40
+ pwn[v0.4.551]: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.1.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.549]:001 >>> PWN.help
55
+ pwn[v0.4.551]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn_phone CHANGED
@@ -46,7 +46,7 @@ OptionParser.new do |options|
46
46
  opts[:start_reporting_server] = s
47
47
  end
48
48
 
49
- options.on('-xRULES', '--source-num-rules=RULES', '<Optional - Comma-delimited list of rules for src_num format (i.e. self, same_country, same_area, and/or same_prefix [Defaults to random src_num w/ same length as target_num])>') do |x|
49
+ options.on('-xRULES', '--source-num-rules=RULES', '<Optional - Comma-delimited list of rules for src_num format (i.e. XXXXXXXXXX, self, same_country, same_area, and/or same_prefix [Defaults to random src_num w/ same length as target_num])>') do |x|
50
50
  opts[:src_num_rules] = x
51
51
  end
52
52
 
@@ -187,8 +187,8 @@ module PWN
187
187
  next unless File.exist?(screenlog_path)
188
188
 
189
189
  # Continuously consume contents of screenlog_path
190
- @session_data = File.readlines(screenlog_path)
191
- @session_data.delete_if do |line|
190
+ session_data = File.readlines(screenlog_path)
191
+ session_data.delete_if do |line|
192
192
  line.include?('ua: using best effort AF: af=AF_INET')
193
193
  end
194
194
  end
@@ -203,7 +203,7 @@ module PWN
203
203
  # session_data = PWN::Plugins::BareSIP.dump_session_data
204
204
 
205
205
  public_class_method def self.dump_session_data
206
- @session_data
206
+ session_data
207
207
  rescue StandardError => e
208
208
  raise e
209
209
  end
@@ -307,7 +307,7 @@ module PWN
307
307
  # Supported Method Parameters::
308
308
  # PWN::Plugins::BareSIP.apply_src_num_rules(
309
309
  # target_num: 'Required - destination number to derive source number',
310
- # src_num_rules: 'Optional - Comma-delimited list of rules for src_num format (i.e. self, same_country, same_area, and/or same_prefix [Defaults to random src_num w/ same length as target_num])'
310
+ # src_num_rules: 'Optional - Comma-delimited list of rules for src_num format (i.e. XXXXXXXXXX, self, same_country, same_area, and/or same_prefix [Defaults to random src_num w/ same length as target_num])'
311
311
  # )
312
312
 
313
313
  public_class_method def self.apply_src_num_rules(opts = {})
@@ -356,6 +356,7 @@ module PWN
356
356
  else
357
357
  raise "Target # should be 10-14 digits. Length is: #{target_num.to_s.length}"
358
358
  end
359
+ src_num_rules_arr.delete(:same_country)
359
360
 
360
361
  # > 799 for prefix leads to call issues when calling 800 numbers.
361
362
  # area = format('%0.3s', Random.rand(200..999))
@@ -363,14 +364,28 @@ module PWN
363
364
  area = target_num.to_s.chars[-10..-8].join if src_num_rules_arr.include?(
364
365
  :same_area
365
366
  )
367
+ src_num_rules_arr.delete(:same_area)
366
368
 
367
369
  prefix = format('%0.3d', Random.rand(200..999))
368
370
  prefix = target_num.to_s.chars[-7..-5].join if src_num_rules_arr.include?(
369
371
  :same_prefix
370
372
  )
373
+ src_num_rules_arr.delete(:same_prefix)
374
+
371
375
  suffix = format('%0.4d', Random.rand(0..9999))
376
+
377
+ # Defaults to Random Source Number
372
378
  src_num = "#{country}#{area}#{prefix}#{suffix}"
379
+
380
+ # Change to same as dest if :self is passed
373
381
  src_num = target_num if src_num_rules_arr.include?(:self)
382
+ src_num_rules_arr.delete(:self)
383
+
384
+ # Assume a custom number is passed if an element
385
+ # still exists in src_num_rules_arr
386
+ # Cast symbol to string, string to integer to massage input,
387
+ # and cast back to string.
388
+ src_num = src_num_rules_arr.first.to_s.to_i.to_s if src_num_rules_arr.any?
374
389
 
375
390
  # TODO: Update ~/.baresip/accounts to apply source number
376
391
  sip_accounts_path = "#{config_root}/accounts"
@@ -494,6 +509,8 @@ module PWN
494
509
  print "#{seconds_to_record}s to record - remaining: #{format('%-9.9s', countdown)}"
495
510
  print "\r"
496
511
 
512
+ # TODO: Fix known issue - if remote terminates call early
513
+ # all calls in thread pool will be stopped prematurely :-/
497
514
  if dump_session_data.select { |s| s.include?(terminated) }.length.positive?
498
515
  reason = 'call terminated by other party'
499
516
  break
@@ -514,14 +531,16 @@ module PWN
514
531
  call_resp_hash[:seconds_recorded] = seconds_recorded
515
532
  puts end_of_color
516
533
 
517
- call_stopped = Time.now.strftime('%Y-%m-%d_%H.%M.%S')
518
- puts "\n#{green}#{call_stopped} >>> #{reason} #{target_num}#{end_of_color}"
519
- call_resp_hash[:call_stopped] = call_stopped
520
- call_resp_hash[:reason] = reason
521
- puts "call termination reason: #{reason}"
534
+ # Move to ensure block?
535
+ # call_stopped = Time.now.strftime('%Y-%m-%d_%H.%M.%S')
536
+ # puts "\n#{green}#{call_stopped} >>> #{reason} #{target_num}#{end_of_color}"
537
+ # call_resp_hash[:call_stopped] = call_stopped
538
+ # call_resp_hash[:reason] = reason
539
+ # puts "call termination reason: #{reason}"
522
540
 
523
- stop(baresip_obj: baresip_obj)
524
- FileUtils.rm_rf(config_root_for_target_num)
541
+ # stop(baresip_obj: baresip_obj)
542
+ # FileUtils.rm_rf(config_root_for_target_num)
543
+ # End of ensure block
525
544
 
526
545
  absolute_recording = ''
527
546
  relative_recording = ''
@@ -600,6 +619,16 @@ module PWN
600
619
  call_resp_hash
601
620
  rescue StandardError => e
602
621
  raise e
622
+ ensure
623
+ # Ensure baresip session is stopped
624
+ call_stopped = Time.now.strftime('%Y-%m-%d_%H.%M.%S')
625
+ puts "\n#{green}#{call_stopped} >>> #{reason} #{target_num}#{end_of_color}"
626
+ call_resp_hash[:call_stopped] = call_stopped
627
+ call_resp_hash[:reason] = reason
628
+ puts "call termination reason: #{reason}"
629
+
630
+ stop(baresip_obj: baresip_obj)
631
+ FileUtils.rm_rf(config_root_for_target_num)
603
632
  end
604
633
 
605
634
  # Supported Method Parameters::
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.549'
4
+ VERSION = '0.4.551'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.549
4
+ version: 0.4.551
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-05 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -520,14 +520,14 @@ dependencies:
520
520
  requirements:
521
521
  - - '='
522
522
  - !ruby/object:Gem::Version
523
- version: 1.4.3
523
+ version: 1.4.4
524
524
  type: :runtime
525
525
  prerelease: false
526
526
  version_requirements: !ruby/object:Gem::Requirement
527
527
  requirements:
528
528
  - - '='
529
529
  - !ruby/object:Gem::Version
530
- version: 1.4.3
530
+ version: 1.4.4
531
531
  - !ruby/object:Gem::Dependency
532
532
  name: pry
533
533
  requirement: !ruby/object:Gem::Requirement
@@ -646,14 +646,14 @@ dependencies:
646
646
  requirements:
647
647
  - - '='
648
648
  - !ruby/object:Gem::Version
649
- version: 4.3.0
649
+ version: 5.0.0
650
650
  type: :runtime
651
651
  prerelease: false
652
652
  version_requirements: !ruby/object:Gem::Requirement
653
653
  requirements:
654
654
  - - '='
655
655
  - !ruby/object:Gem::Version
656
- version: 4.3.0
656
+ version: 5.0.0
657
657
  - !ruby/object:Gem::Dependency
658
658
  name: rspec
659
659
  requirement: !ruby/object:Gem::Requirement
@@ -884,14 +884,14 @@ dependencies:
884
884
  requirements:
885
885
  - - '='
886
886
  - !ruby/object:Gem::Version
887
- version: 1.5.2
887
+ version: 1.5.3
888
888
  type: :runtime
889
889
  prerelease: false
890
890
  version_requirements: !ruby/object:Gem::Requirement
891
891
  requirements:
892
892
  - - '='
893
893
  - !ruby/object:Gem::Version
894
- version: 1.5.2
894
+ version: 1.5.3
895
895
  - !ruby/object:Gem::Dependency
896
896
  name: thin
897
897
  requirement: !ruby/object:Gem::Requirement
@@ -2032,7 +2032,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2032
2032
  - !ruby/object:Gem::Version
2033
2033
  version: '0'
2034
2034
  requirements: []
2035
- rubygems_version: 3.3.22
2035
+ rubygems_version: 3.3.23
2036
2036
  signing_key:
2037
2037
  specification_version: 4
2038
2038
  summary: Automated Security Testing for CI/CD Pipelines & Beyond