macchanger: increment entire mac, not just last byte
This commit is contained in:
parent
f575031605
commit
0c299e9f67
|
@ -34,6 +34,7 @@
|
||||||
#include "cracker.h"
|
#include "cracker.h"
|
||||||
#include "pixie.h"
|
#include "pixie.h"
|
||||||
#include "utils/vendor.h"
|
#include "utils/vendor.h"
|
||||||
|
#include "utils/endianness.h"
|
||||||
|
|
||||||
void update_wpc_from_pin(void) {
|
void update_wpc_from_pin(void) {
|
||||||
/* update WPC file with found pin */
|
/* update WPC file with found pin */
|
||||||
|
@ -68,14 +69,16 @@ static void extract_uptime(const struct beacon_management_frame *beacon)
|
||||||
globule->uptime = end_le64toh(timestamp);
|
globule->uptime = end_le64toh(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_next_mac() {
|
static void set_next_mac() {
|
||||||
unsigned char newmac[6];
|
unsigned char newmac[6];
|
||||||
|
uint32_t l4b;
|
||||||
memcpy(newmac, get_mac(), 6);
|
memcpy(newmac, get_mac(), 6);
|
||||||
/* increments by 1 and preventing the last byte from being 0 and or 255 */
|
memcpy(&l4b, newmac+2, 4);
|
||||||
do {
|
l4b = end_be32toh(l4b);
|
||||||
++newmac[5];
|
do ++l4b;
|
||||||
} while ((newmac[5] & 0xff) == 0 || (newmac[5] & 0xff) == 0xff);
|
while ((l4b & 0xff) == 0 || (l4b & 0xff) == 0xff);
|
||||||
|
l4b = end_htobe32(l4b);
|
||||||
|
memcpy(newmac+2, &l4b, 4);
|
||||||
set_mac(newmac);
|
set_mac(newmac);
|
||||||
cprintf(WARNING, "[+] Using MAC %s\n", mac2str(get_mac(), ':'));
|
cprintf(WARNING, "[+] Using MAC %s\n", mac2str(get_mac(), ':'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
#define DISPLAY_PIN_COUNT 5
|
#define DISPLAY_PIN_COUNT 5
|
||||||
#define TIME_FORMAT "%F %T"
|
#define TIME_FORMAT "%F %T"
|
||||||
|
|
||||||
void set_next_mac();
|
|
||||||
void crack();
|
void crack();
|
||||||
void advance_pin_count();
|
void advance_pin_count();
|
||||||
void display_status(float pin_count, time_t start_time);
|
void display_status(float pin_count, time_t start_time);
|
||||||
|
|
Loading…
Reference in New Issue