Jump to content

[Official] Portal Auth


sud0nick
 Share

Recommended Posts

On 8/21/2019 at 2:13 PM, arcturus said:

LookupError: unknown encoding: utf-8

I think I figured out the error. If you go to the /usr/lib/python2.7/encodings directory, there's no utf_8.py which is included in normal python installations. I don't really know how to fix it but that's why the error pops up.

Link to comment
Share on other sites

1 hour ago, JimmyCashew said:

I think I figured out the error. If you go to the /usr/lib/python2.7/encodings directory, there's no utf_8.py which is included in normal python installations. I don't really know how to fix it but that's why the error pops up.

Thanks for pointing this out, I'll try to resolve this in the next update.

Link to comment
Share on other sites

HI Folks,

I wanted to share an issue i'm having trying to clone any website/captive portal. I have tried i think everything in this thread set to resolve but for some other reason it continues to provide an error. I have tried the following fixes/resolvers;

USB extension cable, Clone and move from GH direct to SD. Upgraded the SD card to high speed sandisk, CHMOD  files on the SD. Formatted the pineapple a couple of times. only install portauth nothing else and so on and so on...

One thing I couldnt figure out how to do was link the root/sd folders/drives via a shortcut - I cant mind the technical name - I wasnt sure exactly how to do this. So if anyone could give me a steer to a site that outlines the steps i would be grateful.

Evil portal also was not working correctly until I installed this directly to the Pineapple unit. It now works as expected.

Portauth Error from the error log....

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 4, in from PortalCloner import PortalCloner File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 12, in import requests File "/sd/modules/PortalAuth/includes/scripts/libs/requests/__init__.py", line 53, in from .packages.urllib3.contrib import pyopenssl File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/__init__.py", line 63, in load_module __import__(name) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/__init__.py", line 10, in from .connectionpool import ( File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py", line 37, in from .request import RequestMethods File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/request.py", line 6, in from .filepost import encode_multipart_formdata File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/filepost.py", line 10, in writer = codecs.lookup('utf-8')[3] LookupError: unknown encoding: utf-8

Link to comment
Share on other sites

On 8/9/2019 at 12:23 AM, kevtheskin said:

Thanks peeps. Just and an old guy trying to learn something new cheers Kev

 

On 5/9/2019 at 12:38 AM, mrjeff said:

Solved, but seems that is not working with https right?

i was following your video : Using Portal Auth, Evil Portal, Papers, and Cursed Screech to access systems

when i got to the point in the video when i needed to use PortalAuth when i put in the website link and hit clone it gives me the folloing error.

i have a wifipineapple nano the moduals are on an external sd card and have the latest wifi pine apple firmware also im doing this on windows os so if i have to get some thing from github 

some one needs to explain to me how to go through with the whole thing and add it to my moduals on the wifi pineapple

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 4, in from PortalCloner import PortalCloner File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 12, in import requests File "/sd/modules/PortalAuth/includes/scripts/libs/requests/__init__.py", line 53, in from .packages.urllib3.contrib import pyopenssl File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/__init__.py", line 63, in load_module __import__(name) File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/__init__.py", line 10, in from .connectionpool import ( File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py", line 37, in from .request import RequestMethods File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/request.py", line 6, in from .filepost import encode_multipart_formdata File "/sd/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/filepost.py", line 10, in writer = codecs.lookup('utf-8')[3] LookupError: unknown encoding: utf-8

Link to comment
Share on other sites

  • 2 weeks later...

I managed to solve the encoding and tinycss errors by changing the symlink in /usr/bin/python to point to /sd/usr/bin/python2.7 

Now I can clone my Unifi captive portal using the command

python portalclone.py --portalName "unifi" --portalArchive "/sd/portals/" --url "http://example.com" --injectSet "Blank"

But if I try to clone it from the module It takes a really long time to detect the portal and a really long time to attempt to clone it. It successfully makes the folder in /root/portals but with only a small resources file and gives me the error: 

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 24, in cloner.fetchPage(args.url) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 100, in fetchPage response = requests.get(url, headers=self.uas, 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 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.', error(145, 'Operation timed out'))

Link to comment
Share on other sites

  • 3 months later...

Version 2.0 is available now from my GitHub!  I'll submit a PR for the module manager soon.

Here is the changelog:

Dec 26, 2019

- Fixed libcurl4 dependency issue
- Fixed tinycss issue (again?)
- Updated jQuery to 3.4.1 for injection sets

The libcurl4 dependency issue in particular was preventing the module from detecting portals.  Somehow the tinycss issue reared its ugly head again although it should have been fixed in a previous release.  Anyway, it's fixed now.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hey there, i'm trying to clone a portal both with default settings and with custom.

But all i get is this error

ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/lib/python2.7/hashlib.py", line 147, in File "/usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor ValueError: unsupported hash type sha512 Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 4, in from PortalCloner import PortalCloner File "/pineapple/modules/PortalAuth/includes/scripts/PortalCloner.py", line 12, in import requests File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/__init__.py", line 58, in from . import utils File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/utils.py", line 26, in from .compat import parse_http_list as _parse_list_header File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/compat.py", line 94, in from .packages.urllib3.packages.ordered_dict import OrderedDict File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/__init__.py", line 83, in load_module raise ImportError("No module named '%s'" % (name,)) ImportError: No module named 'requests.packages.urllib3'

 

Any tips?

Link to comment
Share on other sites

  • 2 months later...

I was able to clone successfully with PortalAuth 2.0 and opkg install python-codecs  for Pineapple Tetra. When I try to update the nano its states;

* verify_pkg_installable: Only have 312kb available on filesystem /overlay, pkg python-codecs needs 723
 * opkg_install_cmd: Cannot install package python-codecs.
 

I have all my modules installed located on the sd card. Any thoughts on how to correct this? 

Link to comment
Share on other sites

  • 1 month later...

Hi all somewhat new with hak5 gear.

I am having issues with portalAuth and cloning sites. I have tried all injection sets with various target sites and I continually get the same error.

clone_error_01_59_55.txt

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 4, in from PortalCloner import PortalCloner File "/pineapple/modules/PortalAuth/includes/scripts/PortalCloner.py", line 12, in import requests File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/__init__.py", line 53, in from .packages.urllib3.contrib import pyopenssl File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/__init__.py", line 63, in load_module __import__(name) File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/__init__.py", line 10, in from .connectionpool import ( File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py", line 37, in from .request import RequestMethods File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/request.py", line 6, in from .filepost import encode_multipart_formdata File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/filepost.py", line 10, in writer = codecs.lookup('utf-8')[3] LookupError: unknown encoding: utf-8

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 5 weeks later...
On 6/23/2020 at 5:33 PM, VividGlitch said:

I was getting the same error message. The log referenced the codec lookup error. I fixed it by using opkg to install python-codecs.


$ opkg update
$ opkg install python-codecs

Cloning works perfectly now. 

Thanks for providing the solution here.  I'll get it added when I have time to update the module.

Link to comment
Share on other sites

  • 3 weeks later...

Hey everyone, I've decided that I'm not going to maintain this module any longer.  I feel there are too many limitations on the current firmware which make keeping it up to date too time consuming.  I may revisit building a similar module in the future but only if I see a couple changes: 1. Python 3 replacing version 2 by default in the firmware, and 2. Module support for modern Angular + NodeJS (or some other backend) rather than AngularJS.  Both Python 2 and AngularJS are deprecated and no longer supported.  I just feel it doesn't make sense for me to support a module that keeps breaking on dead languages.

Also, I've had a pull request in for this and my other two modules since December of 2019 and it's yet to be merged.  So some of the problems people are facing are due to running old versions they downloaded from the module manager.  I'm leaving the code in my GitHub and I've added the fix for the python-codecs dependency so if you want the latest please grab it from there.

Link to comment
Share on other sites

  • 5 months later...

Hey everybody,

I know that this is an old topic, but I cracked the code on the big error here involving utf-8. This is the error:

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 4, in from PortalCloner import PortalCloner File "/pineapple/modules/PortalAuth/includes/scripts/PortalCloner.py", line 12, in import requests File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/__init__.py", line 53, in from .packages.urllib3.contrib import pyopenssl File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/__init__.py", line 63, in load_module __import__(name) File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/__init__.py", line 10, in from .connectionpool import ( File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/connectionpool.py", line 37, in from .request import RequestMethods File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/request.py", line 6, in from .filepost import encode_multipart_formdata File "/pineapple/modules/PortalAuth/includes/scripts/libs/requests/packages/urllib3/filepost.py", line 10, in writer = codecs.lookup('utf-8')[3] LookupError: unknown encoding: utf-8

 

If you're having encoding problems, there's no need for a symlink. Follow these steps.

Factory Reset

Use gparted to reformated your sd card to ext4.

Boot up the pineapple and update your packages with opkg update. 

Install python codecs with opkg install python-codecs (DO NOT INSTALL THEM TO YOUR SD CARD!!!!). You should enough free space just for the updates and for codecs.  I spent 2 days trying to figure that out. If you install them to your sd card, PortalAuth will not be able to find them in /usr/bin/python

Now install python to your sd card with opkg install python -d sd

Now log into the web gui and install PortalAuth through the module manager. The latest version is on there. 

Install Evil Portal.

Install dependencies.

Change the Portal Archive to /sd/portals/ 

Clone your site.

Link to comment
Share on other sites

But I've run into another error that maybe somebody could help me with.

Traceback (most recent call last): File "/pineapple/modules/PortalAuth/includes/scripts/portalclone.py", line 25, in cloner.cloneResources() File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 199, in cloneResources self.css_urls[_key] = self.parseCSS(urlparse.urljoin(self.url, img.get(tag))) File "/sd/modules/PortalAuth/includes/scripts/PortalCloner.py", line 65, in parseCSS r = requests.get(url, headers=self.uas) 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 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 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)

Not sure how to remedy this. Thanks!

Link to comment
Share on other sites

  • 7 months later...
  • 1 month later...

Hello, I watched the youtube video explainging how to use portal auth, and maybe i missed how to do it or i just dont fully understand but, within the video you stated you could clone a web application itself without having a payload. I know the blank setting allow you to do that, but I am unable to acutally clone a site using the url. I put the url in the test site location. the clone portal comes up and choose blank but i keep getting an error. Any help would be awesome. I dont want to inject a payload or anything just clone the site. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...