Jump to content
sud0nick

[Official] Portal Auth

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@Foxtrot It's also utf_32_be.py, ascii.py, and idna.py. I was able to get past the utf-8 and all the other ones except for the inda error by just adding them to that directory, but for some reason adding inda.py there doesn't fix the error.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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'))

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...