Files
wifite2/py/Client.py
derv82 1f2ebc9914 Setting up Client, Target, and Airodump wrappers
Fixed bugs in Process and other related classes.
2015-05-27 20:26:30 -07:00

42 lines
1.3 KiB
Python

#!/usr/bin/python
class Client(object):
'''
Holds details for a "Client" - a wireless device (e.g. computer)
that is associated with an Access Point (e.g. router)
'''
def __init__(self, fields):
'''
Initializes & stores client info based on fields.
Args:
Fields - List of strings
INDEX KEY
0 Station MAC (client's MAC address)
1 First time seen,
2 Last time seen,
3 Power,
4 # packets,
5 BSSID, (Access Point's MAC address)
6 Probed ESSIDs
'''
self.station = fields[0].strip()
self.power = int(fields[3].strip())
self.packets = int(fields[4].strip())
self.bssid = fields[5].strip()
def __str__(self):
''' String representation of a Client '''
result = ''
for (key,value) in self.__dict__.iteritems():
result += key + ': ' + str(value)
result += ','
return result
if __name__ == '__main__':
fields = '54:35:30:23:62:8E, 2015-05-27 19:43:47, 2015-05-27 19:43:47, -67, 2, (not associated) ,HOME-1102'.split(',')
c = Client(fields)
print c