Skip to content

Commit d50e2a0

Browse files
authored
Merge pull request #732 from ninp0/master
PWN::Plugins::JiraServer module - #bugfixes in #rest_call method
2 parents 96083c3 + 4f43542 commit d50e2a0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ cd /opt/pwn
3737
$ ./install.sh
3838
$ ./install.sh ruby-gem
3939
$ pwn
40-
pwn[v0.5.296]:001 >>> PWN.help
40+
pwn[v0.5.297]:001 >>> PWN.help
4141
```
4242

4343
[![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.4.4@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.5.296]:001 >>> PWN.help
55+
pwn[v0.5.297]:001 >>> PWN.help
5656
```
5757

5858
If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
6262
$ rvmsudo gem uninstall --all --executables pwn
6363
$ rvmsudo gem install --verbose pwn
6464
$ pwn
65-
pwn[v0.5.296]:001 >>> PWN.help
65+
pwn[v0.5.297]:001 >>> PWN.help
6666
```
6767

6868
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:

lib/pwn/plugins/jira_server.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module JiraServer
6464
if http_body.is_a?(Hash)
6565
if http_body.key?(:multipart)
6666
headers[:content_type] = 'multipart/form-data'
67-
headers[:x_atlassian_token] => 'no-check'
67+
headers[:x_atlassian_token] = 'no-check'
6868
else
6969
http_body = http_body.to_json
7070
end
@@ -82,7 +82,10 @@ module JiraServer
8282
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
8383
end
8484

85-
JSON.parse(response, symbolize_names: true)
85+
jira_response = response if response.is_a?(RestClient::Response) && response.code == 204
86+
jira_response = JSON.parse(response, symbolize_names: true) if response.is_a?(RestClient::Response) && response.code != 204
87+
88+
jira_response
8689
rescue RestClient::ExceptionWithResponse => e
8790
if e.response
8891
puts "HTTP BASE URL: #{base_api_uri}"

lib/pwn/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PWN
4-
VERSION = '0.5.296'
4+
VERSION = '0.5.297'
55
end

0 commit comments

Comments
 (0)