Skip to content

Commit a71b097

Browse files
committed
Revert status iteration, since it doesn't work
Also.
1 parent 6b2a995 commit a71b097

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

modules/auxiliary/scanner/http/wordpress_content_injection.rb

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,14 @@ def do_list
8888

8989
tbl = Rex::Text::Table.new(
9090
'Header' => "Posts at #{full_uri} (REST API: #{get_rest_api})",
91-
'Columns' => %w{ID Title URL Status Password}
91+
'Columns' => %w{ID Title URL Password}
9292
)
9393

9494
posts_to_list.each do |post|
95-
if post[:status] == 'publish'
96-
status = 'Published'
97-
else
98-
status = post[:status].capitalize
99-
end
100-
10195
tbl << [
10296
post[:id],
10397
Rex::Text.html_decode(post[:title]),
10498
post[:url],
105-
status,
10699
post[:password] ? 'Yes' : 'No'
107100
]
108101
end
@@ -146,27 +139,24 @@ def do_update
146139
def list_posts
147140
posts = []
148141

149-
%w{publish future draft pending private}.each do |status|
150-
res = send_request_cgi({
151-
'method' => 'GET',
152-
'uri' => normalize_uri(get_rest_api, 'posts'),
153-
'vars_get' => {
154-
'status' => status,
155-
'per_page' => datastore['PostCount'],
156-
'search' => datastore['SearchTerm']
157-
}
158-
}, 3.5)
142+
res = send_request_cgi({
143+
'method' => 'GET',
144+
'uri' => normalize_uri(get_rest_api, 'posts'),
145+
'vars_get' => {
146+
'status' => status,
147+
'per_page' => datastore['PostCount'],
148+
'search' => datastore['SearchTerm']
149+
}
150+
}, 3.5)
159151

160-
if res && res.code == 200
161-
res.get_json_document.each do |post|
162-
posts << {
163-
id: post['id'],
164-
title: post['title']['rendered'],
165-
url: post['link'],
166-
status: status,
167-
password: post['content']['protected']
168-
}
169-
end
152+
if res && res.code == 200
153+
res.get_json_document.each do |post|
154+
posts << {
155+
id: post['id'],
156+
title: post['title']['rendered'],
157+
url: post['link'],
158+
password: post['content']['protected']
159+
}
170160
end
171161
end
172162

0 commit comments

Comments
 (0)