pwn 0.5.137 → 0.5.138

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: 0bedf6cda56027f5e6eddf96da4d189e88661216e06686506132bb75c9e2fa50
4
- data.tar.gz: 8f2aeb827cb5c86fb77e89f8000cae7d45f22a13e6731a09bd0d1a51b3525d5a
3
+ metadata.gz: 52633169927156baba018bd23eb58869959ef65968fe2687bdbddc498817ebff
4
+ data.tar.gz: 7d5e5c159101c49ddc02d062f7d254985542eed8e1338c592115e057906a952b
5
5
  SHA512:
6
- metadata.gz: e3dbf22bfcb9aae550741c161f3184be90226269aba826165156db38cb3e00f5217fee71bed7d5e47161a1c8f2c1ff1aff48135b88cf8ddb66653942db93bea0
7
- data.tar.gz: d0d008faac027711f9acc293b00aba1563e0543733964f0fd8d857636abc29f14c12593ad52ccb2cc3d865455504d1f11dcb892e146c68db2dae6f76b2599274
6
+ metadata.gz: a7a2ab34be2207b516a26b7cf63d3de2a098c71c4665d74ba8dd6659427e1658d1e39397e875eaf5fb814fd08005a19862c0dd5f5c00fe45e5c523ddc64a7a45
7
+ data.tar.gz: 7652bbd1d71c0535c567029cd4beb4f1d8e517ed994353ff9bbb2b4ef8af7f5d1f4ca4926de9915357580101157af303928bc66c78271703144c9303b0e1b436
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.137]:001 >>> PWN.help
40
+ pwn[v0.5.138]: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.3.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.137]:001 >>> PWN.help
55
+ pwn[v0.5.138]: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.3.1@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.137]:001 >>> PWN.help
65
+ pwn[v0.5.138]: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:
@@ -14,7 +14,6 @@ module PWN
14
14
  # port: 'required - host port (defaults to 6667)',
15
15
  # nick: 'required - nickname',
16
16
  # real: 'optional - real name (defaults to value of nick)',
17
- # chan: 'required - channel',
18
17
  # tls: 'optional - boolean connect to host socket using TLS (defaults to false)'
19
18
  # )
20
19
 
@@ -23,7 +22,6 @@ module PWN
23
22
  port = opts[:port] ||= 6667
24
23
  nick = opts[:nick].to_s.scrub
25
24
  real = opts[:real] ||= nick
26
- chan = opts[:chan].to_s.scrub
27
25
  tls = opts[:tls] || false
28
26
 
29
27
  irc_obj = PWN::Plugins::Sock.connect(
@@ -40,14 +38,74 @@ module PWN
40
38
  irc_obj.gets
41
39
  irc_obj.flush
42
40
 
43
- join(irc_obj: irc_obj, chan: chan)
44
-
45
41
  irc_obj
46
42
  rescue StandardError => e
47
43
  irc_obj = disconnect(irc_obj: irc_obj) unless irc_obj.nil?
48
44
  raise e
49
45
  end
50
46
 
47
+ # Supported Method Parameters::
48
+ # PWN::Plugins::IRC.ping(
49
+ # irc_obj: 'required - irc_obj returned from #connect method',
50
+ # message: 'required - message to send'
51
+ # )
52
+ public_class_method def self.ping(opts = {})
53
+ irc_obj = opts[:irc_obj]
54
+ message = opts[:message].to_s.scrub
55
+
56
+ send(irc_obj: irc_obj, message: "PING :#{message}")
57
+ irc_obj.gets
58
+ irc_obj.flush
59
+ rescue StandardError => e
60
+ raise e
61
+ end
62
+
63
+ # Supported Method Parameters::
64
+ # PWN::Plugins::IRC.pong(
65
+ # irc_obj: 'required - irc_obj returned from #connect method',
66
+ # message: 'required - message to send'
67
+ # )
68
+ public_class_method def self.pong(opts = {})
69
+ irc_obj = opts[:irc_obj]
70
+ message = opts[:message].to_s.scrub
71
+
72
+ send(irc_obj: irc_obj, message: "PONG :#{message}")
73
+ irc_obj.gets
74
+ irc_obj.flush
75
+ rescue StandardError => e
76
+ raise e
77
+ end
78
+
79
+ # Supported Method Parameters::
80
+ # PWN::Plugins::IRC.privmsg(
81
+ # irc_obj: 'required - irc_obj returned from #connect method',
82
+ # chan: 'required - channel to send message',
83
+ # message: 'required - message to send',
84
+ # )
85
+ public_class_method def self.privmsg(opts = {})
86
+ irc_obj = opts[:irc_obj]
87
+ chan = opts[:chan].to_s.scrub
88
+ message = opts[:message].to_s.scrub
89
+ nick = opts[:nick].to_s.scrub
90
+
91
+ message_newline_tot = message.split("\n").length
92
+ if message_newline_tot.positive?
93
+ message.split("\n") do |message_chunk|
94
+ this_message = "PRIVMSG #{chan} :#{message_chunk}"
95
+ if message_chunk.length.positive?
96
+ PWN::Plugins::IRC.send(
97
+ irc_obj: irc_obj,
98
+ message: this_message
99
+ )
100
+ end
101
+ end
102
+ else
103
+ send(irc_obj: irc_obj, message: "PRIVMSG #{chan} :#{message}")
104
+ end
105
+ rescue StandardError => e
106
+ raise e
107
+ end
108
+
51
109
  # Supported Method Parameters::
52
110
  # PWN::Plugins::IRC.join(
53
111
  # irc_obj: 'required - irc_obj returned from #connect method',
@@ -63,7 +121,7 @@ module PWN
63
121
  irc_obj.gets
64
122
  irc_obj.flush
65
123
 
66
- send(irc_obj: irc_obj, message: "PRIVMSG #{chan} :#{nick} joined.")
124
+ privmsg(irc_obj: irc_obj, message: "#{nick} joined.")
67
125
  irc_obj.gets
68
126
  irc_obj.flush
69
127
  rescue StandardError => e
@@ -135,7 +193,7 @@ module PWN
135
193
  # irc_obj: 'required - irc_obj returned from #connect method',
136
194
  # message: 'required - message to send',
137
195
  # )
138
- public_class_method def self.send(opts = {})
196
+ private_class_method def self.send(opts = {})
139
197
  irc_obj = opts[:irc_obj]
140
198
  message = opts[:message].to_s.scrub
141
199
 
@@ -183,6 +241,22 @@ module PWN
183
241
  chan: 'required - channel to join'
184
242
  )
185
243
 
244
+ #{self}.ping(
245
+ irc_obj: 'required - irc_obj returned from #connect method',
246
+ message: 'required - message to send'
247
+ )
248
+
249
+ #{self}.pong(
250
+ irc_obj: 'required - irc_obj returned from #connect method',
251
+ message: 'required - message to send'
252
+ )
253
+
254
+ #{self}.privmsg(
255
+ irc_obj: 'required - irc_obj returned from #connect method',
256
+ chan: 'required - channel to send message',
257
+ message: 'required - message to send'
258
+ )
259
+
186
260
  #{self}.part(
187
261
  irc_obj: 'required - irc_obj returned from #connect method',
188
262
  chan: 'required - channel to part',
@@ -199,11 +273,6 @@ module PWN
199
273
  verbose: 'optional - boolean to enable verbose output (defaults to false)'
200
274
  )
201
275
 
202
- #{self}.send(
203
- irc_obj: 'required - irc_obj returned from #connect method',
204
- message: 'required - message to send',
205
- )
206
-
207
276
  irc_obj = #{self}.disconnect(
208
277
  irc_obj: 'required - irc_obj returned from #connect method'
209
278
  )
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.137'
4
+ VERSION = '0.5.138'
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.137
4
+ version: 0.5.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.