Jump to content

[Official] Portal Auth


sud0nick

Recommended Posts

10 hours ago, sud0nick said:

@SatchBoogie There's an Error Logs pane in the module that you have to expand.  If you don't see any logs in there then tell me what you were trying to clone and with what options.  If you do find an error log, paste its contents here.

Thanks. I fixed my issue by removing all links in /www/

Some of them were hidden files (starting with '.') that I uploaded to a portal I made, and maybe it created some error when starting the module.But I'm really not sure.

Link to comment
Share on other sites

  • Replies 293
  • Created
  • Last Reply

Hey team. I have dusted off the Nano and am working through the various EP and PA scenarios. So far I have yet to get a site to clone properly with PA. I have gone through a series of sites and injection sets to see if there is a commonality, to no avail. Here are my findings so far, I'm hoping you can help me get back on my feet.

Nano Firmware:1.1.3

All modules installed to sd.

Test site: http://www.wi-fi.org (tried to find a http site figuring https may be part of the issue)

Log out put:

/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 186, in cloneResources r = self.session.get(urlparse.urljoin(self.url, img.get(tag)), stream=True, verify=False) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", line 473, in get return self.request('GET', url, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", line 461, in request resp = self.send(prep, **send_kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", line 573, in send r = adapter.send(request, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/adapters.py", line 415, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

Link to comment
Share on other sites

@skimpniff I've tested PortalAuth with the site you provided and successfully cloned it three times (once over http to internal storage, once over http to sd, and once over https to sd).  I didn't receive any errors and got all of the files.  I also flashed my NANO to the newest firmware just before testing.  I'm really not sure what could be causing the problem for you.  Try cloning to internal storage (/root/portals/) and see if that helps (although it shouldn't make a difference I can't think of anything else to test at this point).  Let me know your results.

Link to comment
Share on other sites

I am having the same issues with my NANO.

I have also factory reset, wiped SD card, updated to latest FW. Same issues.

/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 197, in cloneResources fh = open(self.portalDirectory + css_file).read().decode('utf-8') File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 10: invalid start byte
/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 197, in cloneResources fh = open(self.portalDirectory + css_file).read().decode('utf-8') File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 10: invalid start byte
Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 23, in cloner.fetchPage(args.url) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 100, in fetchPage response = requests.get(url, verify=False) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/api.py", line 65, in get return request('get', url, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/api.py", line 49, in request response = session.request(method=method, url=url, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", line 447, in request prep = self.prepare_request(req) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", line 378, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/sd/modules/PortalAuth/includes/scripts/libs/requests/models.py", line 303, in prepare self.prepare_url(url, params) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/models.py", line 360, in prepare_url "Perhaps you meant http://{0}?".format(url)) requests.exceptions.MissingSchema: Invalid URL u'www.pinkfreewifi.com/en': No schema supplied. Perhaps you meant http://www.pinkfreewifi.com/en?

P.S. I have even symlinked /sd/portals to /root/portals. Still issues.

Somehow I have the feeling that with NANO there are issues in general with different modules. Why not at this point extend root to the sd card?! [1]

Anyone managed to fix the issue?

 

[1] https://wiki.openwrt.org/doc/howto/extroot

Link to comment
Share on other sites

@zibri according to the errors you received it looks like you didn't put in a valid URL (at least on the last log).  On the first two there was an encoding error which I would need to investigate myself.  You can ignore the InsecureRequest stuff as those are just warnings and not exceptions.

Link to comment
Share on other sites

About the wrong URL, was just an example, I got the same errors with others URLs. Which were opening fine in a browser (without even HTTP 302 redirect).

Out of curiosity, could be possible for you to send me your NANO's backup? :)

cd /tmp && dd if=/dev/mtd5 of=/tmp/sysbackup.bin

Curious to see if is a HW problem at this point.

Because otherwise I have already tried all possible combinations:

- Factory FW

- Latest FW

- Downgrade to the previous FW

- Portals into /root/portals

- Portals into /sd/portals

- Symlink between /root/portals and /sd/portals

Link to comment
Share on other sites

@sud0nick I am not sure what the final verdict ended up being but I am no longer experiencing the error I reported before. The only thing I did was to create a symlink for /root/portals to /sd/portals. Prior to the symlink I was getting the same error, created the symlink and tried again, no issues. Perhaps there was a storage issue on root that was contributing. Whatever the reason, I was able to successfully clone the page I provided for demo purposes. Thanks for taking the time to take a look at my issue, you and the rest of the team are pretty awesome and I appreciate all of your work. Been following Hak5 since the basement days in Va.

---------------------------------

EDIT: So, now that I have a successful clone (all the files seem to be present), I am only getting a blank page displayed. I hosed up my regular Nano landing page script (Config page), so it is now blank. Is there something required in that page for EP to work? I thought it was only for basic landing page stuff, which is why I didn't think too much about it when I cleared the script. I tried adding:

      <?php
      header("Location: /sd/portals/wifi/index.php", true, 301);
      exit();
      ?>

to test the theory and got the same results.

EDIT: Seems to be limited to that site. Our fav coffee site seems to be doing just fine.

Link to comment
Share on other sites

On 12/22/2016 at 9:33 AM, zibri said:

About the wrong URL, was just an example, I got the same errors with others URLs. Which were opening fine in a browser (without even HTTP 302 redirect).

Out of curiosity, could be possible for you to send me your NANO's backup? :)


cd /tmp && dd if=/dev/mtd5 of=/tmp/sysbackup.bin

Curious to see if is a HW problem at this point.

Because otherwise I have already tried all possible combinations:

- Factory FW

- Latest FW

- Downgrade to the previous FW

- Portals into /root/portals

- Portals into /sd/portals

- Symlink between /root/portals and /sd/portals

@sud0nick

1) Once you'' have time can you send me a backup of your NANO? Thanks mate :)
2) I just noticed you have a DEV branch on github. I'll try it asap.

 

Link to comment
Share on other sites

20 hours ago, zibri said:

@sud0nick

1) Once you'' have time can you send me a backup of your NANO? Thanks mate :)
2) I just noticed you have a DEV branch on github. I'll try it asap.

I use the same firmware you use so that's not the issue.  I'd be surprised if it's a hardware problem.  Can you post the URL you are using (or send in a PM if you don't want to post it).  I'll try to clone it myself and see what the problem is.  My guess is there is a non-ASCII character in one of the CSS files which is causing the crash at line 197 in my Python script:

# Open the CSS file and get the contents
fh = open(self.portalDirectory + css_file).read().decode('utf-8')

But I'll need to verify this with my own tests.

Link to comment
Share on other sites

On 11/18/2016 at 8:38 AM, sud0nick said:

@JohnnyQuestVenture your first two problems have nothing to do with PortalAuth.  They are limitations of Evil Portal.  Currently you have to browse to a site using HTTP in order for the portal to appear.  HTTPS will just bypass the portal altogether.  Your 3rd issue, again, has nothing to do with PortalAuth.  It is an issue with your payload that could be the result of not including the keys in the exe or simply not having the right version of .NET on the target.  If you have more trouble with the payload or CursedScreech in general please post your questions in the official support thread for that module.  From this point forward I will not respond to off topic questions in support threads.

Hi have watched the video from beginning to end, step by step, double/triple/quadrupled check... basically every other day to copy the video....still same issues.

Im taking a break from this, too much of a constant headache. Maybe VM issues, certain settings idk. But i can promise you if the video is correct then its on my end, So if any ideas what else (PC configs) might be causing issues please let me know.

 

Thanks 

Link to comment
Share on other sites

On 12/29/2016 at 5:37 AM, sud0nick said:

I use the same firmware you use so that's not the issue.  I'd be surprised if it's a hardware problem.  Can you post the URL you are using (or send in a PM if you don't want to post it).  I'll try to clone it myself and see what the problem is.  My guess is there is a non-ASCII character in one of the CSS files which is causing the crash at line 197 in my Python script:


# Open the CSS file and get the contents
fh = open(self.portalDirectory + css_file).read().decode('utf-8')

But I'll need to verify this with my own tests.

A little update... Out of curiosity I wanted to try what Zylla suggested...

Sadly using the USB as /sd and also symlinking /root/portals to /sd/portals DID NOT solve much:

With your https://www.starbucks.com/coffeehouse/wireless-internet  or http://www.starbucks.pl or http://www.starbucks.de PortalAuth process starts... and successfully finish.  

But with the following ones, I get errors...:

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", 
line 23, in cloner.fetchPage(args.url) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", 
line 100, in fetchPage response = requests.get(url, verify=False) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/api.py", 
line 65, in get return request('get', url, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/api.py", 
line 49, in request response = session.request(method=method, url=url, **kwargs) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", 
line 447, in request prep = self.prepare_request(req) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/sessions.py", 
line 378, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/sd/modules/PortalAuth/includes/scripts/libs/requests/models.py", 
line 303, in prepare self.prepare_url(url, params) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/models.py", 
line 360, in prepare_url "Perhaps you meant http://{0}?".format(url)) requests.exceptions.MissingSchema: Invalid URL u'www.mcdonalds.it': No schema supplied. Perhaps you meant http://www.mcdonalds.it?

Instead for http://www.investlithuania.com/ and http://www.delfi.lt I get the unicode error... 

/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", 
line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", 
line 197, in cloneResources fh = open(self.portalDirectory + css_file).read().decode('utf-8') File "/usr/lib/python2.7/encodings/utf_8.py", 
line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 10: invalid start byte

 

 

Link to comment
Share on other sites

More errors:

Errors with http://www.kfc.lt

 
Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 206, in cloneResources checkedName = self.checkFileName(fname) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 85, in checkFileName while os.path.exists(path): File "/usr/lib/python2.7/genericpath.py", 
line 18, in exists os.stat(path) UnicodeEncodeError: 'ascii' codec can't encode characters in position 56-57: ordinal not in range(128) 

 

Errors with http://www.cili.lt


 

/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) /sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py:747: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", 
line 24, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", 
line 124, in cloneResources self.downloadFile(r,fname) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", 
line 56, in downloadFile with open(self.resourceDirectory + name, 'wb') as out_file: IOError: [Errno 21] Is a directory: '/root/portals/cili/resources/'

 

Link to comment
Share on other sites

It's obvious you are getting encoding errors from Lithuanian sites due to the characters required for their language.  As I've said already, I'll look into it when I have time.  There is no need to keep posting the same errors for different sites.

That last error is because it didn't pick up a file name and tried to open the resources directory for writing (which isn't possible.  This probably happened because it couldn't decode the characters in the file's name.

Link to comment
Share on other sites

Actually I was posting here for reference.
I have tried many different countries from EU with strange charsets... and so far only Lithuanian creates issues.

At this point, I guess I will start look deeper at our code, since, as you noticed as well, the main issue is this one. ;]

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

Hi

Im newbie using wifi pineapple, and im testing the portal auth module with http://www.starbucks.es/coffeehouse/wireless-internet, but when i hit the clone button it take a long time in "Cloning Portal..." and them said  "An error has occurred.  Check the logs for details." i tried this many times with the same result and there is no log in the error logs. 

Does anybody know what happens?

 

Ty

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...