codewars Wifi

class codewars.wifi.Wifi(iAddr='eth0')[source]

Note

In order to use this module u need to provide the python application the right permissions. Most likly sudo. This is because scapy makes use of your network card. Therefor it needs permissions.

Warning

The error AttributeError: ‘L2ListenSocket’ object has no attribute ‘ins’ is a reaction to the note above. Not the right permissions.

info(packages=[])[source]

Look for information about a package

Parameters

packages – Type: scapy.Packet Default: Empty List Description: A list with packages founnd with the sniff method.

Returns

Type: List Content: Objects Description: Information of each package

Return type

List

sniff(totalResults=10)[source]

Sniff Network packages on the selected iAddr

Parameters

totalResults – Type: Int Default: 10 Description: The sniff amount.

Returns

Type: List Content: scapy.plist.PacketList Description: A list of network packages adresses that are discovered. Limited to the amount of the totalResults parameter.

Return type

List

sniff_forever(duration: int = 300)[source]

Sniffs forever and stores its data in self.__listener

Parameters

duration – Type: Int Default: 300 # 1 second * sniff time * 1 package Description: Sniff until duration reached 0

Note

Results can be fetched from self.sniff_history