Link Search Menu Expand Document

WiFi Pineapple Python Network Helpers

Table of contents

  1. Introduction
  2. Functions

Introduction

Python API

Functions

def check_for_internet(url: str = 'https://downloads.hak5.org/internet', timout: int = 10, logger: Optional[Logger] = None) -> bool
Attempt to connect to a given url. If a connection was established then assume there is an internet connection.
If the connection fails to establish or times out then assume there is not internet. Run a command and pipe it to grep for some output.

Parameters

  • url: The url to attempt to connect to. Default is https://downloads.hak5.org/internet.
  • timeout: The amount of time in seconds to wait before giving up. Default is 10.
  • logger: An optional instance of Logger use to log any exceptions while trying to establish a connection.

Returns

  • bool: True if there is an internet connection, False if there is not.

def get_interfaces() -> List[str]
Get a list of current network interfaces.

Returns

  • List[str]: A list of network interfaces available on the device.