Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
derv82
GitHub Repository: derv82/wifite2
Path: blob/master/wifite/model/wep_result.py
412 views
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
from ..util.color import Color
5
from .result import CrackResult
6
7
import time
8
9
class CrackResultWEP(CrackResult):
10
def __init__(self, bssid, essid, hex_key, ascii_key):
11
self.result_type = 'WEP'
12
self.bssid = bssid
13
self.essid = essid
14
self.hex_key = hex_key
15
self.ascii_key = ascii_key
16
super(CrackResultWEP, self).__init__()
17
18
def dump(self):
19
if self.essid:
20
Color.pl('{+} ESSID: {C}%s{W}' % self.essid)
21
Color.pl('{+} BSSID: {C}%s{W}' % self.bssid)
22
Color.pl('{+} Encryption: {C}%s{W}' % self.result_type)
23
Color.pl('{+} Hex Key: {G}%s{W}' % self.hex_key)
24
if self.ascii_key:
25
Color.pl('{+} Ascii Key: {G}%s{W}' % self.ascii_key)
26
27
def print_single_line(self, longest_essid):
28
self.print_single_line_prefix(longest_essid)
29
Color.p('{G}%s{W}' % 'WEP'.ljust(5))
30
Color.p(' ')
31
Color.p('Hex: {G}%s{W}' % self.hex_key.replace(':', ''))
32
if self.ascii_key:
33
Color.p(' (ASCII: {G}%s{W})' % self.ascii_key)
34
Color.pl('')
35
36
def to_dict(self):
37
return {
38
'type' : self.result_type,
39
'date' : self.date,
40
'essid' : self.essid,
41
'bssid' : self.bssid,
42
'hex_key' : self.hex_key,
43
'ascii_key' : self.ascii_key
44
}
45
46
if __name__ == '__main__':
47
crw = CrackResultWEP('AA:BB:CC:DD:EE:FF', 'Test Router', '00:01:02:03:04', 'abcde')
48
crw.dump()
49
crw.save()
50
51
52