pwn 0.5.127 → 0.5.129

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: a48eb64d6b60c7d703bf51915a4ab652027a070a04eedf44ac9155c34df161bd
4
- data.tar.gz: a1a298f9710a1162ebcddc006aa0a93f6d392e7d72b24ac559aa6aa06365a013
3
+ metadata.gz: 041b60ff7e7d85926a01fe639e900d83cf1e95a702960a14ca652af48cc8249b
4
+ data.tar.gz: dbba29721fc429bdc2a65ded91498486afe70810d26223023c8aadc61a4444eb
5
5
  SHA512:
6
- metadata.gz: 5f47a7dbec9b9c6439edee6fd7bc93b7d4c00387b9063d1fcda59f87b72ba4d727cb88debf6a3afa24f292061b9b2ebdcc39e68f6b915206cdadfa40355d3e35
7
- data.tar.gz: 52daf9816e032f0c23f482ddeac6e7d230b5796a1c952191bc93cd5c3268a79805e8eaa7fc3c5173df3966f6827c9682979a74a658766defd3cbaeca45117e30
6
+ metadata.gz: f48e7d733e857094fcf3a4495d0b8e4fdd8da1c0202ea71704439e85da8722700eb6c43584918c4c960da79649526d3d1874328416e1b0ba101cbba558e6072f
7
+ data.tar.gz: a658d909e8b85644f637ddc66eb8cc97d1eefdfe8e40335cbb6b0a5f76620e76497675ea8bb6d673e1c4695f152f7e1be3b13511200221ef44ca17b66f29f074
data/Gemfile CHANGED
@@ -22,7 +22,6 @@ gem 'bson', '5.0.0'
22
22
  gem 'bundler', '>=2.5.10'
23
23
  gem 'bundler-audit', '0.9.1'
24
24
  gem 'bunny', '2.22.0'
25
- gem 'cinch', '2.3.4'
26
25
  gem 'colorize', '1.1.0'
27
26
  gem 'credit_card_validations', '6.2.0'
28
27
  gem 'eventmachine', '1.2.7'
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.127]:001 >>> PWN.help
40
+ pwn[v0.5.129]: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.127]:001 >>> PWN.help
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.127]:001 >>> PWN.help
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:
@@ -32,6 +32,7 @@ module PWN
32
32
  ⣿⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠁⠀⠀⠀⠀⣿
33
33
  ⣿⠀⠀⠀⠀⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⣿
34
34
  ⠛⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠛⠛⠛⠉⠉⠛⠛⠛⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠛
35
+ ⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛
35
36
  '.red
36
37
  rescue StandardError => e
37
38
  raise e
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.127'
4
+ VERSION = '0.5.129'
5
5
  end
@@ -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.127
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-21 00:00:00.000000000 Z
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