Jump to content

"Could not connect to internet." When Installing Depentencies


astinomia

Recommended Posts

Once I've installed the Evil Portal Module, I select the module and I am prompted to install missing dependencies but even though I am connected to a WiFi network, I get the following error message: "Could not connect to internet."

Screenshot-2020-09-18-Wi-Fi-Pineapple.pn

Screenshot-2020-09-18-Wi-Fi-Pineapple.pn

Is anyone else getting this issue?

 

 

Link to comment
Share on other sites

Hey @astinomia this is probably happening because your pineapples clock hasnt been synced yet causing there to be certificate errors when trying to install dependencies.

To check this, if you can open up the terminal and run `opkg update`. If that succeeds then you should be good to installing the dependencies. If it fails you can either wait for ntp to sync up your clock (should be every few minutes) or manually make it sync by running `/etc/init.d/ntpd stop && /etc/init.d/ntpd start`

Let me know if this solves your problem

Link to comment
Share on other sites

The `opkg update` command seem to work fine.

When I run `/etc/init.d/ntpd stop && /etc/init.d/ntpd start`, it says "bash: /etc/init.d/ntpd: No such file or directory".

Sometimes before the Dependencies window has time to load I see this error: "dial unix /tmp/modules/evilportal.sock: connect: resource temporarily unavailable". I'm guessing that is because I'm missing the dependencies or because it hasn't fully loaded?.

Also, its probably meaningless but I'm only seeing two rows instead of three of the "Could not connect to internet." error now. Restating doesn't seem to help.

Link to comment
Share on other sites

Works fine.

root@mk7:/pineapple# ping google.com
PING google.com (172.217.1.174): 56 data bytes
64 bytes from 172.217.1.174: seq=0 ttl=114 time=33.915 ms
64 bytes from 172.217.1.174: seq=1 ttl=114 time=41.330 ms
64 bytes from 172.217.1.174: seq=2 ttl=114 time=28.066 ms
64 bytes from 172.217.1.174: seq=3 ttl=114 time=29.491 ms
64 bytes from 172.217.1.174: seq=4 ttl=114 time=29.997 ms
64 bytes from 172.217.1.174: seq=5 ttl=114 time=27.758 ms
64 bytes from 172.217.1.174: seq=6 ttl=114 time=30.324 ms
64 bytes from 172.217.1.174: seq=7 ttl=114 time=28.259 ms
64 bytes from 172.217.1.174: seq=8 ttl=114 time=29.914 ms
64 bytes from 172.217.1.174: seq=9 ttl=114 time=28.570 ms
^C
--- google.com ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 27.758/30.762/41.330 ms
Link to comment
Share on other sites

Can you hit example.com specifically? This is what the module is using to try to determine if there is an internet connection.

If that does work then create a file on your pineapple called `internet_check.py` and paste this in it

from pineapple.helpers import network_helpers

print(network_helpers.check_for_internet())

save it then run `python3 ./internet_check.py`

If its able to connect it should print True otherwise it will print False.

If it does say false, edit the second line to look like this:

print(network_helpers.check_for_internet(timout=5))

(Make sure you don't spell `timeout` correctly.. I just noticed a typo I made in the library lol)

Run the script again: `python3 ./internet_check.py`

If that still says False, then for some reason the pineapple is having an issue resolving example.com. Change the line to look like this and try again:

print(network_helpers.check_for_internet(url='http://www.google.com', timout=5))

 

Link to comment
Share on other sites

root@mk7:/pineapple# ping example.com
ping: bad address 'example.com'

Running the first & second version :

root@mk7:/pineapple# python3 ./internet_check.py 
False

Running the third version (url='http://www.google.com', timout=5)):

root@mk7:/pineapple# python3 ./internet_check.py 
True

Weird...

Link to comment
Share on other sites

20 minutes ago, astinomia said:

root@mk7:/pineapple# ping example.com
ping: bad address 'example.com'

Running the first & second version :


root@mk7:/pineapple# python3 ./internet_check.py 
False

Running the third version (url='http://www.google.com', timout=5)):


root@mk7:/pineapple# python3 ./internet_check.py 
True

Weird...

Seems like something might be going on with your internet connection then. Are you able to get to http://example.com in your web browser?

A temporary fix for your issue - just to get you up and running - is to edit this file: `/usr/lib/pineapple/pineapple/helpers/network_helpers.py`

 Change `http://www.example.com` in the following line to `http://www.google.com`

def check_for_internet(url: str = 'http://www.example.com', timout: int = 1, logger: Optional[Logger] = None) -> bool:

 

Link to comment
Share on other sites

1 minute ago, newbi3 said:

Seems like something might be going on with your internet connection then. Are you able to get to http://example.com in your web browser?

A temporary fix for your issue - just to get you up and running - is to edit this file: `/usr/lib/pineapple/pineapple/helpers/network_helpers.py`

 Change `http://www.example.com` in the following line to `http://www.google.com`


def check_for_internet(url: str = 'http://www.example.com', timout: int = 1, logger: Optional[Logger] = None) -> bool:

 

Yes, I can open http://example.com in my browser, it seems to not work only on the pineapple. I changed it in the helper method, and it worked!

 

Link to comment
Share on other sites

Glad to hear!

This isn't is a permit solution but will work fine for now. We might pull this url out into a text file or make editable through the web interface in a future version of the firmware.

 

Link to comment
Share on other sites

On 9/30/2020 at 3:06 PM, Melroy said:

I had connection problems installing dependencies and with opkg but clients could access the internet normaly.

After I disabled IPv6 advertisements on my firewall (so the pineapple only had IPv4). The problem was solved.

Was this happening on the 1.0.1 Beta 3 version of the firmware?

Link to comment
Share on other sites

3 hours ago, newbi3 said:

Was this happening on the 1.0.1 Beta 3 version of the firmware?

Hey @newbi3,

I wasn't able to get EvilPortal running on 1.0.1 BETA (reverting back to 1.0.0 worked later). It would install, but would skip the "Install Dependencies" page, and hang (with constant loading circles). I tried to pull from the log you mentioned, but it didn't exist... I even ran a search (find) and manually went through all the directories. Ended up flashing the firmware back to 1.0.0 and it then worked again.

I forgot to mention. I originally flashed the recovery firmware because after uninstalling and then reinstalling the module it caused the exact same issue that I originally wrote to you about. It also made it so the portals couldn't be activated, previewed, etc... along with hanging of the "Start web server".

Wish I had logs to give to you. If I encounter these issues again I'll make sure to dump them for you.

Thank you for your hard work!

Link to comment
Share on other sites

5 hours ago, newbi3 said:

Was this happening on the 1.0.1 Beta 3 version of the firmware?

Tested with the 1.0 en 1.01 beta. I use SophosXG 18 as firewall. And i only use IPv6 internally.

On WAN of the firewall i have IPv4 only.

Link to comment
Share on other sites

9 hours ago, Void-Byte said:

...

I wasn't able to get EvilPortal running on 1.0.1 BETA (reverting back to 1.0.0 worked later). It would install, but would skip the "Install Dependencies" page, and hang (with constant loading circles). I tried to pull from the log you mentioned, but it didn't exist... I even ran a search (find) and manually went through all the directories. Ended up flashing the firmware back to 1.0.0 and it then worked again.

I forgot to mention. I originally flashed the recovery firmware because after uninstalling and then reinstalling the module it caused the exact same issue that I originally wrote to you about. It also made it so the portals couldn't be activated, previewed, etc... along with hanging of the "Start web server".

...

Hi,

This was caused by a missing SSL dependency required by a recent change to the Python module API/Framework. It's been fixed in 1.0.1 Beta 4. Thanks for reporting this!

 

Link to comment
Share on other sites

  • 3 months later...

Hi,

So I recently got a Pineapple Mk VII and the setup went pretty smooth up until i tried to install some dependencies for the modules MDK4, Evil Portal, and NMap. So for some background I am running on Beta version 1.0.2 (beta.2020111816551). I have the same issues using the stable 1.0.1. I have the Pineapple setup in wireless client mode. I have an active internet connection from my home router over wifi using WPA2-PSK. I can ping "google.com" "example.com" and "downoads.hak5.org" with no issues from the console so im not sure its DNS related. I can get the news and download the modules fine but when the alert shows up telling me I need to install dependencies for Evil Portal and I click install I get an error message stating "Could not connect to internet.Could not connect to internet.Could not connect to internet.Could not connect to internet.Could not connect to internet.Could not connect to internet." This is the same with MDK4 and NMap with the error message "Could not connect to internet." I also keep getting a time misconfiguration warning in the top right. I'm also getting notifications saying "could not connect to internet" from MDK4 and NMAP. I'm assuming this is my issue. I read thru the other suggested fixes and I ran the command "opkg update" with no errors. But I cannot seem to find the ntp daemon to restart it. It is not listed under /etc/init.d/ like the suggestion says. I have tried clicking the sync browser time button and I get the green check mark next to "User Management & Time" but the install still fails. Here is the Evil Portal log. https://pastebin.com/hZa7msCD . At this point I cannot find any more documentation on my issue and everything links me back to this thread. So I am going to post it here and hopefully someone has some advice. I see others had very similar issues using older versions of the firmware, and they seemed to somehow resolve them but none of the suggestions work for me or I'm not doing something right.

Link to comment
Share on other sites

I was having the exact same problem as Voizdev the last two days. The fix I'm using right now is to perform the fix where you change "https://example.com" in /usr/lib/pineapple/pineapple/helpers/network_helpers.py to "https://google.com." Then run "opkg update" from the shell, then reboot from the dot menu in pineAP. Once I reconnect, my modules seem to download just fine.

 

I'm not sure exactly what I'm doing, or why this works, but it did.

Link to comment
Share on other sites

7 hours ago, ColossalFossil said:

I was having the exact same problem as Voizdev the last two days. The fix I'm using right now is to perform the fix where you change "https://example.com" in /usr/lib/pineapple/pineapple/helpers/network_helpers.py to "https://google.com." Then run "opkg update" from the shell, then reboot from the dot menu in pineAP. Once I reconnect, my modules seem to download just fine.

 

I'm not sure exactly what I'm doing, or why this works, but it did.

So for me when I went to change the url in the network_helpers.py file and found the url was not what was listed above as "example.com". I found it pointing to "https://downloads.hak5.org/internet". I changed that line to "https://www.google.com" and this did not fix the issue for me. I then decided to try it without ssl  and changed the url to "http://www.google.com" and still it did not work. I noticed in the network_helpers.py script there was a test for if the url had https in it so i figured maybe ssl was the issue. But after that i found a fix that worked to let me install all the dependencies. I went into each modules folder from the console and manually ran each module.py script for each module i was currently installing the dependencies for. This allowed the install them and I could watch it all print to the console. After this I would have to restart the pineapple for all the sockets to be open again and then everything worked fine. I did continue to see the time misconfiguration errors. But now a day later that error seems to not be happening anymore as I have not seen that message in the top right once after hours of messing with it.

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...