Skip to content

About

Bully Reloaded is an unofficial, actively-modified fork of Bully, the WPS brute-force/pixie-dust attack tool originally written by Brian Purcell and was maintained by AAnarchYY.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bully Reloaded License

Bully Reloaded is an unofficial, actively-modified fork of Bully, the WPS brute-force/pixie-dust attack tool originally written by Brian Purcell and currently maintained by AAnarchYY. It is not affiliated with, and should not be taken as endorsed by, the original authors — see Attribution below for exactly who wrote what.

The fork exists to bring an otherwise excellent, lean C implementation up to date: a stale pixiewps integration, channel control on a deprecated kernel API, and no fallback for chipsets/drivers where raw monitor-mode packet injection simply doesn't work reliably. See "What's different from upstream Bully" below for what's landed so far.

Like upstream Bully, it exploits the well-known design flaw in the WPS specification, runs on Linux, and is built to work on embedded systems (OpenWrt, etc.) with minimal dependencies.

You must already have Wiire's Pixiewps installed. The latest version can be found here: https://github.com/wiire-a/pixiewps (the original wiire/pixiewps was archived 2022-04-19; wiire-a is the active fork).

What's different from upstream Bully

  • Fixed pixiewps invocation: no longer forces a full 1970-to-now brute-force search on every single attempt (--force is now a fallback after repeated clean misses, not the default); now passes -b/--e-bssid; warns (non-fatally) if the installed pixiewps is older than the version this fork is tested against.
  • M5/M7 Encrypted Settings attack path: captures the raw M5/M7 Encrypted Settings attribute and passes it to pixiewps -7/-5, a separate mode-3 attack surface from the E-Hash1/E-Hash2 path above that bully never attempted before. Only sent when actually captured — never sent empty.
  • Channel control via iw instead of the deprecated Wireless Extensions (WEXT) ioctl API. Deliberately does not fall back to the legacy ioctl if iw fails — that path was confirmed, on real hardware, to trigger a kernel NULL-pointer dereference on at least one out-of-tree driver, so exiting cleanly is safer than risking a kernel panic.
  • A null-PIN pre-attempt before the normal search begins, since some AP implementations wrongly accept an empty WPS PIN regardless of their real configured one.
  • Algorithmic default-PIN pre-attempts for five vendor-formula algorithms (D-Link, the generic 24-bit-of-BSSID formula seen across several vendors, Vodafone EasyBox/Arcadyan, ASUS, and Airocon Realtek), tried right after the null-PIN attempt and before the real search — each is a single extra WPS exchange, same cost as the null-PIN attempt.
  • MAC changer (-k/--mac-changer, on by default): rotates the source MAC address on every attempt (configurable interval, -k 0 disables it), so repeated attempts don't look like the same client retrying to a WPS implementation that rate-limits or locks out per MAC. This only ever changes the source-address field of the frames bully crafts and sends itself — the real network interface's hardware MAC is never read, written, or otherwise touched, so there's no interface-level state that could ever be left in a different state than it started in, no matter how the process exits.
  • A second attack transport (-X/--transport) that drives wpa_supplicant directly instead of raw monitor-mode injection. auto (the default) tries raw injection first and falls back automatically after repeated injection failures — tunable via --injection-threshold — for chipsets/drivers where raw injection is unreliable; raw disables the fallback entirely.
  • More robust to corrupted local state: a truncated or garbled pin file under ~/.bully/ is regenerated automatically instead of the tool refusing to run. The per-AP resume file goes further — it's now written as a single record, atomically (temp file + fsync + rename, never a partial write no matter when the process dies), with one backup generation kept specifically to recover from corruption that isn't this process's own fault (disk issues, hand-editing). Only falls back to restarting that target's search from scratch if both the current file and its backup are unusable.

Nothing above changes the compiled binary's name, existing command-line flags' meaning, its ~/.bully/ session-file location, or its exit behavior on success/failure — existing scripts and integrations (including Wifite2's --bully backend) keep working unmodified.

Requirements

apt-get -y install build-essential libpcap-dev aircrack-ng pixiewps iw wpa_supplicant

(iw is required for channel control — see "What's different from upstream Bully" above for why this fork no longer falls back to the legacy ioctl method if it's missing. wpa_supplicant is only actually invoked if --transport=auto's fallback engages — almost every Linux install already has it for ordinary networking, so this is rarely a real addition.)

Setup

Download

Clone this repository (this fork's own remote — check git remote -v if unsure which one you have).

Build

cd bully*/
cd src/
make

Install

sudo make install

Usage

  usage: bully <options> interface

  Required arguments:

      interface      : Wireless interface in monitor mode (root required)

      -b, --bssid macaddr    : MAC address of the target access point
   Or
      -e, --essid string     : Extended SSID for the access point

  Optional arguments:

      -c, --channel N[,N...] : Channel number of AP, or list to hop [b/g]
      -i, --index N          : Starting pin index (7 or 8 digits)  [Auto]
      -l, --lockwait N       : Seconds to wait if the AP locks WPS   [43]
      -o, --outfile file     : Output file for messages          [stdout]
      -p, --pin N            : Starting pin number (7 or 8 digits) [Auto]
      -s, --source macaddr   : Source (hardware) MAC address      [Probe]
      -v, --verbosity N      : Verbosity level 1-4, 1 is quietest     [3]
      -w, --workdir path     : Location of pin/session files  [~/.bully/]
      -5, --5ghz             : Hop on 5GHz a/n default channel list  [No]
      -B, --bruteforce       : Bruteforce the WPS pin checksum digit [No]
      -F, --force            : Force continue in spite of warnings   [No]
      -S, --sequential       : Sequential pins (do not randomize)    [No]
      -T, --test             : Test mode (do not inject any packets) [No]

  Advanced arguments:

      -d, --pixiewps         : Attempt to use pixiewps               [No]
      -k, --mac-changer N    : Randomize crafted src MAC every N tries [1]
                               (packet-crafting only -- never touches the real NIC; 0=off)
      -r, --retries N        : Resend packets N times when not acked  [2]
      -1, --pin1delay M,N    : Delay M seconds every Nth nack at M5 [0,1]
      -2, --pin2delay M,N    : Delay M seconds every Nth nack at M7 [5,1]
      -A, --noacks           : Disable ACK check for sent packets    [No]
      -C, --nocheck          : Skip CRC/FCS validation (performance) [No]
      -D, --detectlock       : Detect WPS lockouts unreported by AP  [No]
      -E, --eapfail          : EAP Failure terminate every exchange  [No]
      -L, --lockignore       : Ignore WPS locks reported by the AP   [No]
      -M, --m57nack          : M5/M7 timeouts treated as WSC_NACK's  [No]
      -N, --nofcs            : Packets don't contain the FCS field [Auto]
      -P, --probe            : Use probe request for nonbeaconing AP [No]
      -R, --radiotap         : Assume radiotap headers are present [Auto]
      -W, --windows7         : Masquerade as a Windows 7 registrar   [No]
      -X, --transport T      : auto|raw (auto: raw first, falls back  [auto]
                               to wpa_supplicant after repeated injection failures)
      --injection-threshold N: Raw-injection failures before auto falls back [10]
      -Z, --suppress         : Suppress packet throttling algorithm  [No]
      -V, --version          : Print version info and exit
      -h, --help             : Display this help information

  Deprecated arguments (accepted for compatibility with older scripts,
  no effect on current behavior):

      -a, --acktime N        : Deprecated/ignored                  [Auto]
      -m, --m13time N        : Deprecated/ignored                  [Auto]
      -t, --timeout N        : Deprecated/ignored                  [Auto]

Always up to date straight from the binary: bully --help.

-d // --pixiewps

The -d option performs an offline attack, Pixie Dust (pixiewps), by automatically passing the PKE, PKR, E-Hash1, E-Hash2, E-Nonce, Authkey, and (as of this fork) E-BSSID. pixiewps will then try to attack Ralink, Broadcom and Realtek chipsets. This fork also warns if your installed pixiewps predates the version it's tested against, and no longer forces a full-range time search on every single Realtek (mode 3) attempt — see "What's different from upstream Bully" above.

-v // --verbosity

The -v option specifies the verbosity of bully. -v 4 now prints all the collected hashes and outputs the pixiewps command run. Default runlevel is 3.

-k // --mac-changer

On by default (interval 1, i.e. every attempt): before each attempt, bully generates a new random, locally-administered MAC address and uses it as the source address on every frame it crafts for that attempt — deauth, auth, (re)assoc, EAPOL, the works — so an AP that rate-limits or locks out WPS registration per client MAC sees a run of one-off clients instead of the same one retrying repeatedly. -k N changes the rotation interval (every Nth attempt); -k 0 disables it, restoring the original single fixed source MAC for the whole run (either the real interface's, or whatever -s/--source was given).

This is a packet-crafting-only feature. It rewrites the source-address field bully already puts into the raw 802.11 frames it builds and injects itself — it never touches the real network interface's hardware MAC (no ip link set address, no driver reconfiguration of any kind). That also means the interface's actual MAC can never be left changed if bully exits uncleanly (crash, kill -9, power loss) — there is nothing to restore, because nothing at the interface level was ever altered in the first place.

Development

src/fuzz/ has a fuzz harness for the vendored WPS attribute parser (wps_parse_msg(), the code that runs directly against bytes received over the air) — see src/fuzz/README.md for the three build modes (plain replay with no extra tooling, libFuzzer, AFL++). make fuzz/make fuzz-asan build the always-available plain-replay mode; neither is part of make all/make install.

Attribution

This fork stands on the work of, and is grateful to:

Who Role
Brian Purcell (purcell.briand@gmail.com) Original author of Bully (2012) — the core tool this entire project is built on
AAnarchYY (aanarchyy@gmail.com) Added the original pixiewps integration; maintains the current upstream project at github.com/aanarchyy/bully
Jouni Malinen (j@w1.fi) Author of wpa_supplicant/hostapd, substantial parts of which are vendored into this project's src/common, src/crypto, src/tls, and src/wps directories for WPS message handling and cryptography. Official project home: w1.fi/wpa_supplicant (git://w1.fi/hostap.git)
wiire (wi7ire@gmail.com) Author of pixiewps, the external offline pixie-dust attack tool this project depends on and shells out to. Active fork: github.com/wiire-a/pixiewps (original github.com/wiire/pixiewps, archived 2022)
Gary S. Brown 1986 public CRC32 implementation used in src/crc32.c
t6_x, DataHead, Soxrok2212 Credited by the original author for help along the way (see upstream project history)
Craig Heffner (devttys0) Reverse-engineered the D-Link default WPS-PIN algorithm this fork ports (default_pin_dlink(), src/bully.c) — original writeup (devttys0.com itself is gone; recovered from web.archive.org)
Stefan Viehböck / SEC Consult Vulnerability Lab Discovered and published the Vodafone EasyBox/Arcadyan default WPS-PIN algorithm this fork ports (default_pin_easybox(), src/bully.c) — advisory 20130805-0 (also recovered from web.archive.org — no longer on sec-consult.com)
stascorp / binarymaster Author of the 3WiFi WPS-PIN-prediction database, whose wpspin.php was used to independently cross-check the D-Link/24-bit ports above and is the only source found for the ASUS/Airocon Realtek formulas (default_pin_asus()/default_pin_airocon(), src/bully.c) — see the comments at each function for exactly what's verified against what

None of the above should be assumed to have reviewed, endorsed, or be responsible for the changes made in this fork. Bug reports and complaints about this fork's changes belong here, not on the upstream projects.

About

Bully Reloaded is an unofficial, actively-modified fork of Bully, the WPS brute-force/pixie-dust attack tool originally written by Brian Purcell and was maintained by AAnarchYY.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages