Skip to content

corysolovewicz/wp7_macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wp7_macos

Share your Mac's internet connection with a WiFi Pineapple MK7 on its default 172.16.42.0/24 subnet, and route all of that traffic through your VPN.

The problem

macOS Internet Connection Sharing (ICS) doesn't cooperate with the Pineapple out of the box:

  • It only shares on the 192.168.2.0/24 subnet, and the GUI won't let you change that.
  • It assigns addresses over DHCP, which conflicts with the MK7's default static IP.
  • It expects a different layout than the Pineapple's 172.16.42.1/24 interface.

VPNs make it worse. macOS won't route shared traffic through the tunnel on its own, and it has no built-in way to NAT traffic from a USB interface out through a VPN. Pineapple traffic ends up leaking straight out your normal uplink.

If you're running the Pineapple on a red team or wireless assessment and need everything tunneled, that's a real problem.

What the script does

Run it and it will:

  1. Find the Pineapple interface by its MAC prefix (00:13:37).
  2. Set your Mac to 172.16.42.42 on that interface.
  3. Enable IP forwarding.
  4. Find your default outbound interface, usually the VPN tunnel (utun0, ipsec0, and so on).
  5. Write pfctl NAT rules so the Pineapple's subnet routes out through that interface.
  6. Give you a menu to start and stop ICS.
  7. Refuse to run over a non-tunnel uplink unless you confirm the override prompt.

The Pineapple stays on its stock network the whole time, so you never touch the ICS GUI or run your own DHCP server. Client traffic won't go anywhere but the tunnel unless you say so.

Usage

chmod +x wp7_macos.sh
sudo ./wp7_macos.sh

The menu lets you start ICS, stop and undo everything, or quit.

Demo

wp7_macos.sh demo

When to use it

  • Wireless red teaming or penetration tests.
  • Running the MK7 as a rogue AP or MITM relay.
  • Any time you want clean setup and teardown without rebooting or hand-editing config.
  • macOS machines that have to route through a VPN.

Requirements

  • macOS (tested on Monterey, Ventura, Sonoma, and Sequoia).
  • A WiFi Pineapple MK7 on its default config.
  • Admin/root privileges.
  • Optional: any VPN that creates a tunnel interface (utunX, ipsecX).

Reverting

Run the script and choose [X] Stop / Undo ICS. That disables IP forwarding, removes the static IP from the Pineapple interface, flushes and disables pfctl, and deletes /etc/pf.anchors/com.pineapple.nat.

Links

About

No description, website, or topics provided.

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages