@@ -41,9 +41,10 @@ def initialize(info={})
41
41
42
42
#
43
43
# Info-Only
44
- # Identify logged in user: /rfcode_reader/api/whoami.json?_dc=1369680704481
45
- # Capture list of users: /rfcode_reader/api/userlist.json?_dc=1370353972710
46
- # Interface configuration: /rfcode_reader/api/interfacestatus.json?_dc=1369678668067
44
+ # Identify logged in user: /rfcode_reader/api/whoami.json
45
+ # Capture list of users: /rfcode_reader/api/userlist.json
46
+ # Interface configuration: /rfcode_reader/api/interfacestatus.json
47
+ # Device platform details: /rfcode_reader/api/version.json
47
48
#
48
49
49
50
def run_host ( ip )
@@ -73,7 +74,14 @@ def run_host(ip)
73
74
# What's the point of running this module if the app actually isn't RFCode Reader?
74
75
#
75
76
def is_app_rfreader?
76
- res = send_request_raw ( { 'uri' => '/rfcode_reader/api/whoami.json?_dc=1369680704481' } )
77
+ res = send_request_cgi (
78
+ {
79
+ 'uri' => '/rfcode_reader/api/whoami.json' ,
80
+ 'vars_get' =>
81
+ {
82
+ '_dc' => '1369680704481'
83
+ }
84
+ } )
77
85
return ( res and res . code != 404 )
78
86
end
79
87
@@ -87,9 +95,13 @@ def is_auth_required?
87
95
88
96
res = send_request_cgi (
89
97
{
90
- 'uri' => '/rfcode_reader/api/whoami.json?_dc=1369680704481 ' ,
98
+ 'uri' => '/rfcode_reader/api/whoami.json' ,
91
99
'method' => 'GET' ,
92
- 'authorization' => basic_auth ( user , pass )
100
+ 'authorization' => basic_auth ( user , pass ) ,
101
+ 'vars_get' =>
102
+ {
103
+ '_dc' => '1369680704481'
104
+ }
93
105
} )
94
106
95
107
return ( res and res . body =~ /{ }/ ) ? false : true
@@ -104,9 +116,13 @@ def do_login(user, pass)
104
116
begin
105
117
res = send_request_cgi (
106
118
{
107
- 'uri' => '/rfcode_reader/api/whoami.json?_dc=1369680704481 ' ,
119
+ 'uri' => '/rfcode_reader/api/whoami.json' ,
108
120
'method' => 'GET' ,
109
- 'authorization' => basic_auth ( user , pass )
121
+ 'authorization' => basic_auth ( user , pass ) ,
122
+ 'vars_get' =>
123
+ {
124
+ '_dc' => '1369680704481'
125
+ }
110
126
} )
111
127
112
128
if not res or res . code == 401
@@ -145,9 +161,13 @@ def collect_info(user, pass)
145
161
146
162
res = send_request_cgi (
147
163
{
148
- 'uri' => '/rfcode_reader/api/version.json?_dc=1370460180056 ' ,
164
+ 'uri' => '/rfcode_reader/api/version.json' ,
149
165
'method' => 'GET' ,
150
- 'authorization' => basic_auth ( user , pass )
166
+ 'authorization' => basic_auth ( user , pass ) ,
167
+ 'vars_get' =>
168
+ {
169
+ '_dc' => '1370460180056'
170
+ }
151
171
} )
152
172
153
173
release_ver = JSON . parse ( res . body ) [ "release" ]
@@ -158,9 +178,13 @@ def collect_info(user, pass)
158
178
159
179
res = send_request_cgi (
160
180
{
161
- 'uri' => '/rfcode_reader/api/userlist.json?_dc=1370353972710 ' ,
181
+ 'uri' => '/rfcode_reader/api/userlist.json' ,
162
182
'method' => 'GET' ,
163
- 'authorization' => basic_auth ( user , pass )
183
+ 'authorization' => basic_auth ( user , pass ) ,
184
+ 'vars_get' =>
185
+ {
186
+ '_dc' => '1370353972710'
187
+ }
164
188
} )
165
189
166
190
userlist = JSON . parse ( res . body )
@@ -169,9 +193,13 @@ def collect_info(user, pass)
169
193
170
194
res = send_request_cgi (
171
195
{
172
- 'uri' => '/rfcode_reader/api/interfacestatus.json?_dc=1369678668067 ' ,
196
+ 'uri' => '/rfcode_reader/api/interfacestatus.json' ,
173
197
'method' => 'GET' ,
174
- 'authorization' => basic_auth ( user , pass )
198
+ 'authorization' => basic_auth ( user , pass ) ,
199
+ 'vars_get' =>
200
+ {
201
+ '_dc' => '1369678668067'
202
+ }
175
203
} )
176
204
177
205
eth0_info = JSON . parse ( res . body ) [ "eth0" ]
0 commit comments