wifi_lab
Clone
https://git.tahinli.com/Tahinli/wifi_lab.git
0 watching0 forksRust2.1 MiBb265998Tahinli1 month ago27 commits
| 1 | //! Deauthentication/disassociation frame blaster (active attack). |
| 2 | //! |
| 3 | //! Unicast targets get both directions (ap→sta *and* sta→ap); a broadcast |
| 4 | //! target only gets the AP-side broadcasted deauth — there is no sane |
| 5 | //! reverse direction for the broadcast address. |
| 6 | |
| 7 | use ; |
| 8 | use sleep; |
| 9 | use Duration; |
| 10 | |
| 11 | use ; |
| 12 | use Sender; |
| 13 | |
| 14 | use crate; |
| 15 | use cratebuild_deauth; |
| 16 | use crateINJECT_HDR; |
| 17 | use crateRawSocket; |
| 18 | |
| 19 | pub const REASON_CLASS3: u16 = 7; |
| 20 | |
| 21 | /// Pacing between frames: 15 ms ≈ 64 frames/s. |
| 22 | const PACE: Duration = from_millis; |
| 23 | /// Emit [`Event::DeauthSent`] after every this many frames. |
| 24 | const REPORT_EVERY: u64 = 32; |
| 25 | |
| 26 | /// Rewards: `Some(frame_with_radiotap)` queues for TX. |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | /// Send `count` deauth rounds against `target` via `sock` (`sock` is bound |
| 45 | /// to a monitor-mode interface by the caller). Rate-limited to ~64 pps with |
| 46 | /// a [`Event::DeauthSent`] progress event every 32 sent frames. |
| 47 | /// |
| 48 | /// Retries briefly on EAGAIN (driver TX ring full); any other error aborts. |
| 49 | /// `stop` is checked per round: when set, the blast breaks cleanly — a |
| 50 | /// long blast must not block the service command loop on scan restart. |
| 51 | /// Returns frames actually written to the wire. |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 |