| 13 | |
| 14 | |
| 15 | class Wifite(object): |
| 16 | |
| 17 | def __init__(self): |
| 18 | ''' |
| 19 | Initializes Wifite. Checks for root permissions and ensures dependencies are installed. |
| 20 | ''' |
| 21 | |
| 22 | self.print_banner() |
| 23 | |
| 24 | Configuration.initialize(load_interface=False) |
| 25 | |
| 26 | if os.getuid() != 0: |
| 27 | Color.pl('{!} {R}error: {O}wifite{R} must be run as {O}root{W}') |
| 28 | Color.pl('{!} {R}re-run with {O}sudo{W}') |
| 29 | Configuration.exit_gracefully(0) |
| 30 | |
| 31 | from .tools.dependency import Dependency |
| 32 | Dependency.run_dependency_check() |
| 33 | |
| 34 | |
| 35 | def start(self): |
| 36 | ''' |
| 37 | Starts target-scan + attack loop, or launches utilities dpeending on user input. |
| 38 | ''' |
| 39 | from .model.result import CrackResult |
| 40 | from .model.handshake import Handshake |
| 41 | from .util.crack import CrackHelper |
| 42 | |
| 43 | if Configuration.show_cracked: |
| 44 | CrackResult.display() |
| 45 | |
| 46 | elif Configuration.check_handshake: |
| 47 | Handshake.check() |
| 48 | |
| 49 | elif Configuration.crack_handshake: |
| 50 | CrackHelper.run() |
| 51 | |
| 52 | else: |
| 53 | Configuration.get_monitor_mode_interface() |
| 54 | self.scan_and_attack() |
| 55 | |
| 56 | |
| 57 | def print_banner(self): |
| 58 | '''Displays ASCII art of the highest caliber.''' |
| 59 | Color.pl(r' {G} . {GR}{D} {W}{G} . {W}') |
| 60 | Color.pl(r' {G}.´ · .{GR}{D} {W}{G}. · `. {G}wifite {D}%s{W}' % Configuration.version) |
| 61 | Color.pl(r' {G}: : : {GR}{D} (¯) {W}{G} : : : {W}{D}automated wireless auditor{W}') |
| 62 | Color.pl(r' {G}`. · `{GR}{D} /¯\ {W}{G}´ · .´ {C}{D}https://github.com/derv82/wifite2{W}') |
| 63 | Color.pl(r' {G} ` {GR}{D}/¯¯¯\{W}{G} ´ {W}') |
| 64 | Color.pl('') |
| 65 | |
| 66 | |
| 67 | def scan_and_attack(self): |
| 68 | ''' |
| 69 | 1) Scans for targets, asks user to select targets |
| 70 | 2) Attacks each target |
| 71 | ''' |
| 72 | from .util.scanner import Scanner |