Last active
December 24, 2017 10:12
-
-
Save yangl1996/69e56316efdbef12f6dd15ac7b7666d8 to your computer and use it in GitHub Desktop.
802.11 CSI Tool Injecting Mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Useage: ./setinj <device name> <channel> <bandwidth> | |
| Example: ./setinj wlan1 3 HT20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sudo /bin/bash | |
| ifconfig $1 2>/dev/null 1>/dev/null | |
| while [ $? -ne 0 ] | |
| do | |
| ifconfig $1 2>/dev/null 1>/dev/null | |
| done | |
| iw $1 set bitrates legacy-2.4 1 | |
| iw dev $1 interface add mon0 type monitor | |
| iw mon0 set channel $2 $3 2>/dev/null 1>/dev/null | |
| channel_set=$? | |
| while [ $channel_set -ne 0 ]; do | |
| ip link set $1 down 2>/dev/null 1>/dev/null | |
| iw dev $1 set type monitor 2>/dev/null 1>/dev/null | |
| ip link set $1 up | |
| iw dev mon0 set channel $2 $3 | |
| channel_set=$? | |
| if [ $channel_set -eq 0 ]; then | |
| echo "Channel set" | |
| fi | |
| done | |
| ifconfig mon0 up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment