pwn 0.4.697 → 0.4.698

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: 2572514219bb53ad28d5bdb441d795b192a4f18b8bcf371652ef8661be793d06
4
- data.tar.gz: 6afc53d56f23965bebfed008a7e7819457e6fc0face0daa5c4dd21110e1d7c9a
3
+ metadata.gz: 1876724f8a6e17d3f41247dc8bc4daea0f8fadaf433a99883ed67b016c45205d
4
+ data.tar.gz: f5f93dd5ed24f7d8e3d880bcd05d183d3105c10f3515302cf88a8db256e5fdf1
5
5
  SHA512:
6
- metadata.gz: 986d271d939c0652a3c8c8ba943a51c56884e95102faad3ee36393f0e3c275af78c3edcdb8cde327424ab487dcc60fd87522010e6e2f587132d88fbd384fc573
7
- data.tar.gz: 5158e21c12952017324123711dfb88776bc802c10a6cc5519cf10bff9607a8147bf452cae98f9769971c6f7e77510899d37376aba95bbf8d19b1fcf23089488a
6
+ metadata.gz: f8703953cf8b45c61a0de488246dd9ee19d213d3c7577e43f756d26283f49842fc45371aeddcc00e734f730f9b89146a8df3363f47e9c9476de1c77f53078383
7
+ data.tar.gz: 5403587ece0718fa16fb20a053c37b12a32470cca9c97b0dade132d1ad321a4326253e7826458fbbc9fd50933e7f4fc4def891f8856b38658cf18d0e32297fce
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.697]:001 >>> PWN.help
40
+ pwn[v0.4.698]: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.697]:001 >>> PWN.help
55
+ pwn[v0.4.698]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'netaddr'
3
4
  require 'pty'
4
5
 
5
6
  module PWN
@@ -77,6 +78,7 @@ module PWN
77
78
  # ip: 'optional - IP address to listen (default: 127.0.0.1)',
78
79
  # port: 'optional - socks port to listen (default: 1024-65535)',
79
80
  # ctrl_port: 'optional - tor control port to listen (default: 1024-65535)',
81
+ # net: 'optional - CIDR notation to accept connections (default: 127.0.0.0.1/32)',
80
82
  # data_dir: 'optional - directory to keep tor session data (default: /tmp/tor_pwn-TIMESTAMP)'
81
83
  # )
82
84
 
@@ -92,6 +94,11 @@ module PWN
92
94
  break if ctrl_port != port
93
95
  end
94
96
  end
97
+
98
+ net = opts[:net]
99
+ net ||= "#{ip}/32"
100
+ acl_net = NetAddr.parse_net(net)
101
+
95
102
  timestamp = Time.now.strftime('%Y-%m-%d_%H-%M-%S.%N%z')
96
103
  data_dir = opts[:data_dir]
97
104
  data_dir ||= "/tmp/tor_pwn-#{timestamp}"
@@ -115,7 +122,11 @@ module PWN
115
122
  'ControlPort',
116
123
  ctrl_port.to_s,
117
124
  'CookieAuthentication',
118
- '1'
125
+ '1',
126
+ 'SocksPolicy',
127
+ "accept #{acl_net}",
128
+ 'SocksPolicy',
129
+ 'reject *'
119
130
  ) do |stdout, _stdin, pid|
120
131
  File.write(pid_file, pid)
121
132
  stdout.each do |line|
@@ -201,6 +212,7 @@ module PWN
201
212
  ip: 'optional - IP address to listen (default: 127.0.0.1)',
202
213
  port: 'optional - socks port to listen (default: 9050)',
203
214
  ctrl_port: 'optional - tor control port to listen (default: 9051)',
215
+ net: 'optional - CIDR notation to accept connections (default: 127.0.0.1/32)',
204
216
  data_dir: 'optional - directory to keep tor session data (default: /tmp/tor_pwn-TIMESTAMP)'
205
217
  )
206
218
 
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.697'
4
+ VERSION = '0.4.698'
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.697
4
+ version: 0.4.698
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-15 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport