pwn 0.5.127 → 0.5.129
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 +4 -4
- data/Gemfile +0 -1
- data/README.md +3 -3
- data/lib/pwn/banner/f_society.rb +1 -0
- data/lib/pwn/plugins/irc.rb +133 -0
- data/lib/pwn/plugins.rb +1 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/plugins/irc_spec.rb +15 -0
- metadata +4 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 041b60ff7e7d85926a01fe639e900d83cf1e95a702960a14ca652af48cc8249b
|
4
|
+
data.tar.gz: dbba29721fc429bdc2a65ded91498486afe70810d26223023c8aadc61a4444eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48e7d733e857094fcf3a4495d0b8e4fdd8da1c0202ea71704439e85da8722700eb6c43584918c4c960da79649526d3d1874328416e1b0ba101cbba558e6072f
|
7
|
+
data.tar.gz: a658d909e8b85644f637ddc66eb8cc97d1eefdfe8e40335cbb6b0a5f76620e76497675ea8bb6d673e1c4695f152f7e1be3b13511200221ef44ca17b66f29f074
|
data/Gemfile
CHANGED
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.
|
40
|
+
pwn[v0.5.129]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
55
|
+
pwn[v0.5.129]: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.
|
65
|
+
pwn[v0.5.129]: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:
|
data/lib/pwn/banner/f_society.rb
CHANGED
@@ -0,0 +1,133 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'openssl'
|
4
|
+
|
5
|
+
module PWN
|
6
|
+
module Plugins
|
7
|
+
# This plugin was created to interact with IRC protocols
|
8
|
+
module IRC
|
9
|
+
@@logger = PWN::Plugins::PWNLogger.create
|
10
|
+
|
11
|
+
# Supported Method Parameters::
|
12
|
+
# irc_obj = PWN::Plugins::IRC.connect(
|
13
|
+
# host: 'required - host or ip (defaults to "127.0.0.1")',
|
14
|
+
# port: 'required - host port (defaults to 6667)',
|
15
|
+
# nick: 'required - nickname',
|
16
|
+
# real: 'optional - real name (defaults to value of nick)',
|
17
|
+
# chan: 'required - channel',
|
18
|
+
# tls: 'optional - boolean connect to host socket using TLS (defaults to false)'
|
19
|
+
# )
|
20
|
+
|
21
|
+
public_class_method def self.connect(opts = {})
|
22
|
+
host = opts[:host] ||= '127.0.0.1'
|
23
|
+
port = opts[:port] ||= 6667
|
24
|
+
nick = opts[:nick].to_s.scrub
|
25
|
+
real = opts[:real] ||= nick
|
26
|
+
chan = opts[:chan].to_s.scrub
|
27
|
+
tls = opts[:tls] || false
|
28
|
+
|
29
|
+
irc_obj = PWN::Plugins::Sock.connect(
|
30
|
+
target: host,
|
31
|
+
port: port,
|
32
|
+
tls: tls
|
33
|
+
)
|
34
|
+
|
35
|
+
send(irc_obj: irc_obj, message: "NICK #{nick}")
|
36
|
+
send(irc_obj: irc_obj, message: "USER #{nick} #{host} #{host} :#{real}")
|
37
|
+
send(irc_obj: irc_obj, message: "JOIN #{chan}")
|
38
|
+
send(irc_obj: irc_obj, message: "PRIVMSG #{chan} :#{nick} joined.")
|
39
|
+
|
40
|
+
irc_obj
|
41
|
+
rescue StandardError => e
|
42
|
+
irc_obj = disconnect(irc_obj: irc_obj) unless irc_obj.nil?
|
43
|
+
raise e
|
44
|
+
end
|
45
|
+
|
46
|
+
# Supported Method Parameters::
|
47
|
+
# PWN::Plugins::IRC.listen(
|
48
|
+
# irc_obj: 'required - irc_obj returned from #connect method'
|
49
|
+
# )
|
50
|
+
|
51
|
+
public_class_method def self.listen(opts = {})
|
52
|
+
irc_obj = opts[:irc_obj]
|
53
|
+
|
54
|
+
loop do
|
55
|
+
message = irc_obj.gets
|
56
|
+
@@logger.info(message)
|
57
|
+
next unless block_given?
|
58
|
+
|
59
|
+
# Extract the message text from the message
|
60
|
+
message_text = message.split[3..-1].join(' ')[1..-1]
|
61
|
+
yield message_text
|
62
|
+
end
|
63
|
+
rescue StandardError => e
|
64
|
+
raise e
|
65
|
+
ensure
|
66
|
+
disconnect(irc_obj: irc_obj)
|
67
|
+
end
|
68
|
+
|
69
|
+
public_class_method def self.send(opts = {})
|
70
|
+
irc_obj = opts[:irc_obj]
|
71
|
+
message = opts[:message].to_s.scrub
|
72
|
+
|
73
|
+
irc_obj.puts message
|
74
|
+
# Wait for a response from the server
|
75
|
+
# This is a hack to ensure the message is processed by the server
|
76
|
+
# before sending another message
|
77
|
+
irc_obj.gets
|
78
|
+
irc_obj.flush
|
79
|
+
rescue StandardError => e
|
80
|
+
raise e
|
81
|
+
end
|
82
|
+
|
83
|
+
# Supported Method Parameters::
|
84
|
+
# PWN::Plugins::IRC.disconnect(
|
85
|
+
# irc_obj: 'required - irc_obj returned from #connect method'
|
86
|
+
# )
|
87
|
+
|
88
|
+
public_class_method def self.disconnect(opts = {})
|
89
|
+
irc_obj = opts[:irc_obj]
|
90
|
+
PWN::Plugins::Sock.disconnect(sock_obj: irc_obj) unless irc_obj.nil?
|
91
|
+
rescue StandardError => e
|
92
|
+
raise e
|
93
|
+
end
|
94
|
+
|
95
|
+
# Author(s):: 0day Inc. <support@0dayinc.com>
|
96
|
+
|
97
|
+
public_class_method def self.authors
|
98
|
+
"AUTHOR(S):
|
99
|
+
0day Inc. <support@0dayinc.com>
|
100
|
+
"
|
101
|
+
end
|
102
|
+
|
103
|
+
# Display Usage for this Module
|
104
|
+
|
105
|
+
public_class_method def self.help
|
106
|
+
puts "USAGE:
|
107
|
+
irc_obj = #{self}.connect(
|
108
|
+
host: 'required - host or ip',
|
109
|
+
port: 'required - host port',
|
110
|
+
nick: 'required - nickname',
|
111
|
+
chan: 'required - channel',
|
112
|
+
tls: 'optional - boolean connect to host socket using TLS (defaults to false)'
|
113
|
+
)
|
114
|
+
|
115
|
+
#{self}.listen(
|
116
|
+
irc_obj: 'required - irc_obj returned from #connect method'
|
117
|
+
)
|
118
|
+
|
119
|
+
#{self}.send(
|
120
|
+
irc_obj: 'required - irc_obj returned from #connect method',
|
121
|
+
message: 'required - message to send'
|
122
|
+
)
|
123
|
+
|
124
|
+
irc_obj = #{self}.disconnect(
|
125
|
+
irc_obj: 'required - irc_obj returned from #connect method'
|
126
|
+
)
|
127
|
+
|
128
|
+
#{self}.authors
|
129
|
+
"
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
data/lib/pwn/plugins.rb
CHANGED
@@ -32,6 +32,7 @@ module PWN
|
|
32
32
|
autoload :HackerOne, 'pwn/plugins/hacker_one'
|
33
33
|
autoload :IBMAppscan, 'pwn/plugins/ibm_appscan'
|
34
34
|
autoload :IPInfo, 'pwn/plugins/ip_info'
|
35
|
+
autoload :IRC, 'pwn/plugins/irc'
|
35
36
|
autoload :Jenkins, 'pwn/plugins/jenkins'
|
36
37
|
autoload :JiraServer, 'pwn/plugins/jira_server'
|
37
38
|
autoload :JSONPathify, 'pwn/plugins/json_pathify'
|
data/lib/pwn/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe PWN::Plugins::IRC do
|
6
|
+
it 'should display information for authors' do
|
7
|
+
authors_response = PWN::Plugins::IRC
|
8
|
+
expect(authors_response).to respond_to :authors
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should display information for existing help method' do
|
12
|
+
help_response = PWN::Plugins::IRC
|
13
|
+
expect(help_response).to respond_to :help
|
14
|
+
end
|
15
|
+
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.5.
|
4
|
+
version: 0.5.129
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 2.22.0
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: cinch
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 2.3.4
|
160
|
-
type: :runtime
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 2.3.4
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: colorize
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1819,6 +1805,7 @@ files:
|
|
1819
1805
|
- lib/pwn/plugins/hacker_one.rb
|
1820
1806
|
- lib/pwn/plugins/ibm_appscan.rb
|
1821
1807
|
- lib/pwn/plugins/ip_info.rb
|
1808
|
+
- lib/pwn/plugins/irc.rb
|
1822
1809
|
- lib/pwn/plugins/jenkins.rb
|
1823
1810
|
- lib/pwn/plugins/jira_server.rb
|
1824
1811
|
- lib/pwn/plugins/json_pathify.rb
|
@@ -2150,6 +2137,7 @@ files:
|
|
2150
2137
|
- spec/lib/pwn/plugins/hacker_one_spec.rb
|
2151
2138
|
- spec/lib/pwn/plugins/ibm_appscan_spec.rb
|
2152
2139
|
- spec/lib/pwn/plugins/ip_info_spec.rb
|
2140
|
+
- spec/lib/pwn/plugins/irc_spec.rb
|
2153
2141
|
- spec/lib/pwn/plugins/jenkins_spec.rb
|
2154
2142
|
- spec/lib/pwn/plugins/jira_server_spec.rb
|
2155
2143
|
- spec/lib/pwn/plugins/json_pathify_spec.rb
|