Analyzes .cap file(s) for handshake
()
| 198 | |
| 199 | @staticmethod |
| 200 | def check(): |
| 201 | ''' Analyzes .cap file(s) for handshake ''' |
| 202 | from ..config import Configuration |
| 203 | if Configuration.check_handshake == '<all>': |
| 204 | Color.pl('{+} checking all handshakes in {G}"./hs"{W} directory\n') |
| 205 | try: |
| 206 | capfiles = [os.path.join('hs', x) for x in os.listdir('hs') if x.endswith('.cap')] |
| 207 | except OSError as e: |
| 208 | capfiles = [] |
| 209 | if len(capfiles) == 0: |
| 210 | Color.pl('{!} {R}no .cap files found in {O}"./hs"{W}\n') |
| 211 | else: |
| 212 | capfiles = [Configuration.check_handshake] |
| 213 | |
| 214 | for capfile in capfiles: |
| 215 | Color.pl('{+} checking for handshake in .cap file {C}%s{W}' % capfile) |
| 216 | if not os.path.exists(capfile): |
| 217 | Color.pl('{!} {O}.cap file {C}%s{O} not found{W}' % capfile) |
| 218 | return |
| 219 | hs = Handshake(capfile, bssid=Configuration.target_bssid, essid=Configuration.target_essid) |
| 220 | hs.analyze() |
| 221 | Color.pl('') |
| 222 | |
| 223 | |
| 224 | if __name__ == '__main__': |