pwn 0.4.553 → 0.4.554

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: f6a9cf9077f04af8d1f05263ebf389014fc8d61847a2cc20d9e6f047c6c01c46
4
- data.tar.gz: a70a0943345f3a5b4b1ee18f12d4fda080e1580dbf45af8a3dde677661d9fad7
3
+ metadata.gz: 5845a117a0a0e7c58a9bee3b8def4d40d5459079dba07ced63445bd79165d5fb
4
+ data.tar.gz: b52393e4b3361dc2bce767583ccfcd17be00cf0bb8283f8b5349141015b82650
5
5
  SHA512:
6
- metadata.gz: 2fdd15710865e4d378a779ba5800f4483723b8b5a512abfb9d98a888a4d2ccc06a1bf9bffe279b84dd6e186df83ea7eec92f1f0200f28a042eef16b63d009511
7
- data.tar.gz: b9bdf91a136054cd20b8f5aa6b12e49a8302c6812656a3bc031f157459522e5c49a395c141e4f16974472b0a45e3b9460bbba0644f7c26b45e668545a7296a28
6
+ metadata.gz: 50e687553229086fb9f38753cc29a40a496deafed3d6491aa115fa42ba6b4b1380407f2cc325ae5bf5cd7765d7209cc8d9f5e9cf572c0cbe94a171dc9a3257c5
7
+ data.tar.gz: d81f50b569dfeb6c2dd438f0cc2eba17ba99378216360260130f470c1f9d2301888a47d8d9e3b9ea8c8b94d7f09ef710d7ef521edc25f441d770f5a1ceb978aa
data/Gemfile CHANGED
@@ -18,7 +18,7 @@ gem 'aws-sdk', '3.1.0'
18
18
  gem 'bettercap', '1.6.2'
19
19
  gem 'brakeman', '5.3.1'
20
20
  gem 'bson', '4.15.0'
21
- gem 'bundler', '>=2.3.23'
21
+ gem 'bundler', '>=2.3.24'
22
22
  gem 'bundler-audit', '0.9.1'
23
23
  gem 'bunny', '2.19.0'
24
24
  gem 'colorize', '0.8.1'
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.553]:001 >>> PWN.help
40
+ pwn[v0.4.554]: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.553]:001 >>> PWN.help
55
+ pwn[v0.4.554]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -143,10 +143,6 @@ module PWN
143
143
  '-v'
144
144
  )
145
145
 
146
- baresip_obj[:session_thread] = init_session_thread(
147
- baresip_obj: baresip_obj
148
- )
149
-
150
146
  ok = 'registered successfully'
151
147
  gone = 'account: No SIP accounts found'
152
148
  forb = '403 Forbidden'
@@ -154,7 +150,13 @@ module PWN
154
150
  # TODO: Make this faster.
155
151
  print 'Starting baresip...'
156
152
  loop do
157
- break if @session_data.select { |s| s.include?(ok) }.length.positive?
153
+ next unless File.exist?(screenlog_path)
154
+
155
+ dump_session_data = File.readlines(screenlog_path)
156
+ dump_session_data.delete_if do |line|
157
+ line.include?('ua: using best effort AF: af=AF_INET')
158
+ end
159
+ break if dump_session_data.select { |s| s.include?(ok) }.length.positive?
158
160
 
159
161
  next unless dump_session_data.select { |s| s.include?(gone) }.length.positive?
160
162
  next unless dump_session_data.select { |s| s.include?(forb) }.length.positive?
@@ -170,53 +172,6 @@ module PWN
170
172
  raise e
171
173
  end
172
174
 
173
- # Supported Method Parameters::
174
- # session_thread = init_session_thread(
175
- # serial_conn: 'required - SerialPort.new object'
176
- # )
177
-
178
- private_class_method def self.init_session_thread(opts = {})
179
- baresip_obj = opts[:baresip_obj]
180
-
181
- session_root = baresip_obj[:session_root]
182
- screenlog_path = baresip_obj[:screenlog_path]
183
-
184
- # Spin up a baresip_obj session_thread
185
- Thread.new do
186
- loop do
187
- next unless File.exist?(screenlog_path)
188
-
189
- # Continuously consume contents of screenlog_path
190
- @session_data = File.readlines(screenlog_path)
191
- @session_data.delete_if do |line|
192
- line.include?('ua: using best effort AF: af=AF_INET')
193
- end
194
- end
195
- end
196
- rescue StandardError => e
197
- session_thread&.terminate
198
-
199
- raise e
200
- end
201
-
202
- # Supported Method Parameters::
203
- # session_data = PWN::Plugins::BareSIP.dump_session_data
204
-
205
- public_class_method def self.dump_session_data
206
- @session_data
207
- rescue StandardError => e
208
- raise e
209
- end
210
-
211
- # Supported Method Parameters::
212
- # session_data = PWN::Plugins::BareSIP.flush_session_data
213
-
214
- public_class_method def self.flush_session_data
215
- @session_data.clear
216
- rescue StandardError => e
217
- raise e
218
- end
219
-
220
175
  # Supported Method Parameters::
221
176
  # cmd_resp = PWN::Plugins::BareSIP.baresip_exec(
222
177
  # baresip_obj: 'Required - baresip obj returned from #start method',
@@ -244,13 +199,8 @@ module PWN
244
199
 
245
200
  public_class_method def self.stop(opts = {})
246
201
  baresip_obj = opts[:baresip_obj]
247
- session_thread = baresip_obj[:session_thread]
248
202
  screen_session = baresip_obj[:screen_session]
249
203
 
250
- flush_session_data
251
-
252
- session_thread.terminate
253
-
254
204
  puts "STOPPING #{baresip_obj[:screen_session]}"
255
205
  cmd_resp = baresip_exec(
256
206
  baresip_obj: baresip_obj,
@@ -509,24 +459,23 @@ module PWN
509
459
  print "#{seconds_to_record}s to record - remaining: #{format('%-9.9s', countdown)}"
510
460
  print "\r"
511
461
 
512
- # TODO: Fix known issue - if remote terminates call early
513
- # all calls in thread pool will be stopped prematurely :-/
514
- # This likely has something to do w/ data scoping issues in dump_session_data
462
+ dump_session_data = File.readlines(screenlog_path)
463
+ dump_session_data.delete_if do |line|
464
+ line.include?('ua: using best effort AF: af=AF_INET')
465
+ end
466
+
515
467
  if dump_session_data.select { |s| s.include?(terminated) }.length.positive?
516
468
  reason = 'call terminated by other party'
517
- flush_session_data
518
469
  break
519
470
  end
520
471
 
521
472
  if dump_session_data.select { |s| s.include?(unavail) }.length.positive?
522
473
  reason = 'SIP 503 (service unavailable)'
523
- flush_session_data
524
474
  break
525
475
  end
526
476
 
527
477
  if dump_session_data.select { |s| s.include?(not_found) }.length.positive?
528
478
  reason = 'SIP 404 (not found)'
529
- flush_session_data
530
479
  break
531
480
  end
532
481
 
@@ -720,8 +669,6 @@ module PWN
720
669
  screen_session: 'Optional name of screen session (Defaults baresip)'
721
670
  )
722
671
 
723
- session_data_arr = #{self}.dump_session_data
724
-
725
672
  cmd_resp = #{self}.baresip_exec(
726
673
  baresip_obj: 'Required - baresip obj returned from #start method',
727
674
  cmd: 'Required - command to send to baresip HTTP daemon'
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.553'
4
+ VERSION = '0.4.554'
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.553
4
+ version: 0.4.554
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-13 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 2.3.23
117
+ version: 2.3.24
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 2.3.23
124
+ version: 2.3.24
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler-audit
127
127
  requirement: !ruby/object:Gem::Requirement