3

I'm using the Cloudtrax HTTP Authentication API to create a custom logic for router authentication that has a captive portal.

When the router asks for a status request, the server responds the following:

"CODE" "ACCEPT"
"RA" "1c65684265a2bb1a7c87e4d9565c2b18"
"SECONDS" "3600"
"DOWNLOAD" "2000"
"UPLOAD" "800"

Which should be de correct format of an answer to login the user. The problem is that the captive portal is still present.

I don't know what could be the problem and I can't find a log on the router or cloudtrax to see what could be wrong.

Edit:

I am processing the RA string on django (python):

import hashlib

def calculate_ra(request, response):
    code = response.get('CODE')
    if not code:
        return ''

    previus_ra = request.GET.get('ra')

    if not previus_ra:
        return ''

    if len(previus_ra) != 32:
        return ''

    previus_ra = previus_ra.decode('hex')

    m = hashlib.md5()
    m.update('{}{}{}'.format(code, previus_ra, SECRET))

    response['RA'] = m.hexdigest()
hc_
  • 2,558
  • 1
  • 15
  • 19
ignacio.munizaga
  • 1,633
  • 1
  • 21
  • 28

1 Answers1

0

Use SSH to log into the router and enable debug mode by sending these commands:

uci set http_portal.general.syslog=debug
uci commit
/etc/init.d/underdogsplash restart

Then use logread -f to view logs in realtime.

Don't forget to disable the debug mode when you're done:

uci set http_portal.general.syslog=err
uci commit
/etc/init.d/underdogsplash restart
Jan Klan
  • 51
  • 1
  • 5