PDA

View Full Version : How to Set Your Wi-FI Card Tx Power Higher Than 30dbm



Nick_the_Greek
2014-09-16, 09:52
Hello to the Community!

This is a small how-to for Kali users taken from here:
http://null-byte.wonderhowto.com/how-to/set-your-wi-fi-cards-tx-power-higher-than-30-dbm-0149606/

The only difference from the original article is that I'm using the latest wireless-regdb dated 13-Jun-2014


Do you have an Alfa AWUS036NH Wi-Fi adapter that claims it can go to 2000 mWs, or some card that can supposedly transmit power over 1000 mW? If so, you may have run into problems setting your card's TXPOWER higher than 30 dBm, which is about 1000 mW. Well, I will show you how to break that barrier and go as high as you want!

So, here we go. Download all necessary programs that we need and extract them:


apt-get update
apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev
cd /root/
wget http://wireless.kernel.org/download/crda/crda-1.1.3.tar.bz2
wget https://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-2014.06.13.tar.gz
tar jxf crda-1.1.3.tar.bz2
tar zxf wireless-regdb-2014.06.13.tar.gz

check your current CRDA country code:

iw reg get
country GR:
(2402 - 2482 @ 40), (N/A, 20)
(5170 - 5250 @ 80), (N/A, 20)
(5250 - 5330 @ 80), (N/A, 20), DFS
(5490 - 5710 @ 80), (N/A, 27), DFS
(57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
if country code is set to 00 (double zero) that means that is set to world regulatory domain.
You can set by: (GR = Greece in my example)

iw reg set GR
--------------------------------------------------
wireless-regdb:

open db.txt and search for the country that you intersting to change the rules:

leafpad /root/wireless-regdb-2014.06.13/db.txt
# or
nano /root/wireless-regdb-2014.06.13/db.txt

in my example from:

country GR: DFS-ETSI
(2402 - 2482 @ 40), (20)
(5170 - 5250 @ 80), (20)
(5250 - 5330 @ 80), (20), DFS
(5490 - 5710 @ 80), (27), DFS
# 60 gHz band channels 1-4, ref: Etsi En 302 567
(57240 - 65880 @ 2160), (40), NO-OUTDOOR
to:

country GR: DFS-ETSI
(2402 - 2482 @ 40), (30)
(5170 - 5250 @ 80), (20)
(5250 - 5330 @ 80), (20), DFS
(5490 - 5710 @ 80), (27), DFS
# 60 gHz band channels 1-4, ref: Etsi En 302 567
(57240 - 65880 @ 2160), (40), NO-OUTDOOR

save it and exit. (the db.txt file)
Make a backup of your current regulatory.bin file

mv /lib/crda/regulatory.bin /lib/crda/regulatoryOLD.bin
Compile and copy the new regulatory.bin file:

cd /root/wireless-regdb-2014.06.13
make
cp /root/wireless-regdb-2014.06.13/regulatory.bin /lib/crda/regulatory.bin
#DO NOT RUN MAKE INSTALL

--------------------------------------------------------
CRDA:
Validating.
Copy pems into our downloaded crda directory in pubkeys.

cp /root/wireless-regdb-2014.06.13/root.key.pub.pem /root/crda-1.1.3/pubkeys/root.key.pub.pem
cp /root/wireless-regdb-2014.06.13/linville.key.pub.pem /root/crda-1.1.3/pubkeys/linville.key.pub.pem
cp /lib/crda/pubkeys/[email protected] /root/crda-1.1.3/pubkeys/[email protected]

Correct regulatory.bin path in Makefile of crda:

sed 's%REG_BIN?=/usr/lib/crda/regulatory.bin%REG_BIN?=/lib/crda/regulatory.bin%g' /root/crda-1.1.3/Makefile > /root/crda-1.1.3/Makefile1 && mv /root/crda-1.1.3/Makefile1 /root/crda-1.1.3/Makefile
Compile and install:

cd /root/crda-1.1.3/
make
make install
Thats it! You can reboot* now or you can:

modprobe cfg80211 ieee80211_regdom=GR

* No need to reboot. You could also change to another's country code and then back again to the changed one. ie

iw reg set DE
iw reg set GR

You should see something like:

iw reg get

country GR:
(2402 - 2482 @ 40), (N/A, 30)
(5170 - 5250 @ 80), (N/A, 20)
(5250 - 5330 @ 80), (N/A, 20), DFS
(5490 - 5710 @ 80), (N/A, 27), DFS
(57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR

The interesting it's not just to allow your card to work in a higher Tx power. The interesting part is that you can remove some other restrictions. ie remove DFS (dynamic frequency selection) of a band, to remove NO-OUTDOOR restriction etc.

Please refer to the link at the beginning for "QUICK DECIBEL UNDERSTANDING"


WARNING

Removing all restrictions is illegal in the United States. This tutorial is only for educational reasons, and if you choose to apply it and break the law, then that is your choice and not mine. Please be careful putting this into action.

skycrazy
2014-09-16, 12:49
Works Great, thanks Nick_the_Greek

Nick_the_Greek
2014-09-17, 06:17
You're welcome skycrazy. I am glad it worked out for you

Name Taken
2014-09-25, 01:21
A useful table I've used when testing is
http://i60.tinypic.com/sbrn0x.jpg

For my convenience, I have combined the commands into a single file to set the default alternative country code power to 2W.


curl termbin.com/us4k | bash

jerry.goyal
2014-09-26, 23:11
hi, will it also increase the receiving signal strength of wifi??

Name Taken
2014-09-29, 10:37
I had some time so I added



IWCONFIG=`iwconfig wlan0 | grep Tx | awk '{ print $5 }'`
if [ ${IWCONFIG} == 'Tx-Power=20' ]; then
echo "Increasing power" ; sleep 2 ; iw reg set BO
else
echo "Power already increased to $(iwconfig wlan0 | grep Tx | awk '{ print $5 }')" ; sleep 2
fi

AIRMON=`airmon-ng | grep mon0 | cut -c 1-4`
if [ x${AIRMON} == 'xmon0' ]; then
echo "Mon0 already up" ; sleep 2
else
echo "Starting mon0" ; sleep 2 ; airmon-ng start wlan0
fi

ifconfig wlan0 down
echo "Starting airodump" ; sleep 2
airodump-ng mon0 -c 1,6,11


to



curl termbin.com/vtt5 | bash

Nick_the_Greek
2014-09-29, 17:03
hi, will it also increase the receiving signal strength of wifi??
No jerry.goyal.

I like the way you handle piping Name Taken.

Defaultzero
2014-10-29, 21:28
Well done Nick_the_Greek!!

Nick_the_Greek
2014-10-31, 19:43
Well done Nick_the_Greek!!

You're welcome.

NORDLANDVOLK
2014-12-20, 13:45
Thx Nick_the_Greek, is working on wlan0 but how to set for wlan1?

mars_742
2015-03-25, 11:34
i use the 1th method and dosnt give me any err or message

how do i finde out is it work or not ?

wn722
2015-03-29, 20:16
hm anyone tried this with TP Link WN722N?

Solonor
2015-06-15, 03:29
crda is gone from the above post, took me a while to get the right commands working. I've updated the commands below this is working on a alfa 36h on a fully updated kali as of 6/14/2015



apt-get update
apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev
cd /root/
wget http://kernel.org/pub/software/network/crda/crda-3.18.tar.xz
wget https://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-2014.06.13.tar.gz
tar xf crda-3.18.tar.xz
tar zxf wireless-regdb-2014.06.13.tar.gz


nano /root/wireless-regdb-2014.06.13/db.txt


change:
country GR: DFS-ETSI
(2402 - 2482 @ 40), (20)
(5170 - 5250 @ 80), (20)
(5250 - 5330 @ 80), (20), DFS
(5490 - 5710 @ 80), (27), DFS
# 60 gHz band channels 1-4, ref: Etsi En 302 567
(57240 - 65880 @ 2160), (40), NO-OUTDOOR
to:
country GR: DFS-ETSI
(2402 - 2482 @ 40), (30)
(5170 - 5250 @ 80), (20)
(5250 - 5330 @ 80), (20), DFS
(5490 - 5710 @ 80), (27), DFS
# 60 gHz band channels 1-4, ref: Etsi En 302 567
(57240 - 65880 @ 2160), (40), NO-OUTDOOR


mv /lib/crda/regulatory.bin /lib/crda/regulatoryOLD.bin

cd /root/wireless-regdb-2014.06.13
make
cp /root/wireless-regdb-2014.06.13/regulatory.bin /lib/crda/regulatory.bin

cp /root/wireless-regdb-2014.06.13/root.key.pub.pem /root/crda-3.18/pubkeys/root.key.pub.pem
cp /root/wireless-regdb-2014.06.13/linville.key.pub.pem /root/crda-3.18/pubkeys/linville.key.pub.pem
cp /lib/crda/pubkeys/[email protected] /root/crda-3.18/pubkeys/[email protected]

sed 's%REG_BIN?=/usr/lib/crda/regulatory.bin%REG_BIN?=/lib/crda/regulatory.bin%g' /root/crda-3.18/Makefile > /root/crda-3.18/Makefile1 && mv /root/crda-3.18/Makefile1 /root/crda-3.18/Makefile

cd /root/crda-3.18/
make
make install

John_Doe
2015-09-09, 02:54
Sadly, this is no good on Kali 2.0. Do one of you smart people know a workaround, because I'm having trouble installing dependencies like libnl. (Kali 2 has updated versions but the old steps don't work and I don't know how to pipe the steps to the new versions.)
After searching for old deb packages and using dpkg I managed to do all the usual steps without seeing any errors in the terminal, but I'm still stuck on 20 dbi. And before you ask... NO, my usb adapter is not firmware-locked to 20 db, as it always worked properly in Kali 1.1.0.
Any help will be greatly appreciated!

warlock
2015-10-22, 09:43
i have a question regarding setting the wifi transmission power while it is in monitor mode(by airmon-ng).

What i needed is to send different wifi packets with different transmission power when the wifi adapter is in monitor mode.So for this purpose, i tried by changing the energy level in the RADIOTAP header for each packets. But i found even if i change the Txpower bit value in radiotap header, the driver is sending at a fixed power(Max txpower allowed to region).

So my question is how airmon-ng is setting the txpower to the maximum of the regulatory value to a region.(/lib/crda/regulatory.bin)? Can we override this value ??

Hope you all understand the question!

Cheers

ice_
2015-10-24, 01:59
i have a question regarding setting the wifi transmission power while it is in monitor mode(by airmon-ng).

What i needed is to send different wifi packets with different transmission power when the wifi adapter is in monitor mode.So for this purpose, i tried by changing the energy level in the RADIOTAP header for each packets. But i found even if i change the Txpower bit value in radiotap header, the driver is sending at a fixed power(Max txpower allowed to region).

So my question is how airmon-ng is setting the txpower to the maximum of the regulatory value to a region.(/lib/crda/regulatory.bin)? Can we override this value ??

Hope you all understand the question!

Cheers

this may help you http://null-byte.wonderhowto.com/how-to/set-your-wi-fi-cards-tx-power-higher-than-30-dbm-0149606/

rdrunner1122
2016-04-05, 01:11
Sadly, this is no good on Kali 2.0. Do one of you smart people know a workaround, because I'm having trouble installing dependencies like libnl. (Kali 2 has updated versions but the old steps don't work and I don't know how to pipe the steps to the new versions.)
After searching for old deb packages and using dpkg I managed to do all the usual steps without seeing any errors in the terminal, but I'm still stuck on 20 dbi. And before you ask... NO, my usb adapter is not firmware-locked to 20 db, as it always worked properly in Kali 1.1.0.
Any help will be greatly appreciated!



Try
aptitude search libnl
apt-get install all the missing dependencies
I think i needed apt-get install libnl-3-dev libgcrypt11-dev libnl-genl-3-dev

mikie3ars
2016-05-16, 22:43
I have followed this guide and the updated posts to it and have gotten so close to getting this to work. I am the very end and when I try to "make" I get the following


root@kali:~/crda-3.18# make
LD crda
.//libreg.so: file not reconized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:137: recipe for target 'crda' failed
make: *** [crda] Error 1

If there is any other info that will help please let me know.
Thank you in advance

freeroute
2016-05-17, 15:18
Try
aptitude search libnl
apt-get install all the missing dependencies
I think i needed apt-get install libnl-3-dev libgcrypt11-dev libnl-genl-3-dev

I have downloaded the missing packages from the debian wheezy repository. Installed dpkg -i libnl-dev_1.1-7_i386.deb command. It's working.
https://packages.debian.org/search?keywords=libnl-3-dev

dimastt
2016-05-31, 15:42
Very Nice Tutorial. I did make my MT7601u Ralink wireless adapter to 27dbm = 500miliwatts with this value will can inject arp packages?

thanks a lot fo tutorias

Sasquatch33
2018-01-27, 00:33
Thank you so much for this outstanding tutorial. If anyone's reading this in 2018, here is an update:


apt-get update
apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev
cd /root/
wget https://github.com/LairdCP/wb-package-archive/blob/master/crda-1.1.3.tar.bz2
wget https://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-2017.12.23.tar.gz
tar jxf crda-1.1.3.tar.bz2
tar zxf wireless-regdb-2017.12.23.tar.gz

iw reg get
iw reg set BO
nano /root/wireless-regdb-2017.12.23/db.txt
#edit BZ to 33

cd /root/wireless-regdb-2017.12.23
make
cp /root/wireless-regdb-2017.12.23/regulatory.bin /lib/crda/regulatory.bin

cp /root/wireless-regdb-2017.12.23/root.key.pub.pem /root/crda-1.1.3/pubkeys/root.key.pub.pem
cp /root/wireless-regdb-2017.12.23/sforshee.key.pub.pem /root/crda-1.1.3/pubkeys/sforshee.key.pub.pem
cp /lib/crda/pubkeys/[email protected] /root/crda-1.1.3/pubkeys/[email protected]


sed 's%REG_BIN?=/usr/lib/crda/regulatory.bin%REG_BIN?=/lib/crda/regulatory.bin%g' /root/crda-1.1.3/Makefile > /root/crda-1.1.3/Makefile1 && mv /root/crda-1.1.3/Makefile1 /root/crda-1.1.3/Makefile

cd /root/crda-1.1.3/
make
make install

modprobe cfg80211 ieee80211_regdom=BZ

#You can now change country etc.:
iw reg set BZ
iw reg set GR
iw reg get

#finally:
ifconfig wlo0 down
iw reg set BZ
ifconfig wlo0 up
iwconfig wlo0 channel 12
iwconfig wlo0 txpower 33dBm
iwconfig

mmusket33
2018-01-27, 11:46
To Sasquatch33

Thanks for your work here however the libgcrypt11 libnl-dev packages are not available.

If you have a solution please post


Musket Teams

alldayi420
2018-01-27, 22:45
[QUOTE=Sasquatch33;76919]Thank you so much for this outstanding tutorial. If anyone's reading this in 2018, here is an update:


apt-get update
apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev



apt-get install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libnl-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package libgcrypt11
E: Package 'libnl-dev' has no installation candidate

Any Info would help i see that this was just posted today.....

thanks in advance!

techtox
2018-02-02, 08:06
Hi everyone. Not an expert but did find a way around the errors. The packages you're supposed to install are needed to sign/generate/whatever pubkeys. Doing the following commands this will work:

apt-get install pkg-config libnl-3-dev libgcrypt11-dev libnl-genl-3-dev build-essential

Also, the first wget didn't work for me. Tried to extract, told me it wasn't bzip2.. :-D Had to get the RAW download link: github.com/LairdCP/wb-package-archive/raw/master/crda-1.1.3.tar.bz2

This did not work for me though. I have the Alfa 036NH. No networks show up for me after doing this. None of the tutorials I followed work. Yes, it shows 33dBm. But no networks show up.