How To: The Ultimate Guide to Upping Tx-Power in Kali Linux 2.0

The Ultimate Guide to Upping Tx-Power in Kali Linux 2.0

Yes, I understand some people may consider this a repost. However, I have been searching for this answer for 3 weeks and after reading numerous reddit post, Kali Forums post and Null byte post I finally have gotten it to work for me. I would like to compile and share this information with you guys.

Also, this guide addresses the
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
Makefile:76: Cannot find development files for any supported version of libnl. Stop.
Note there is one more asterisk, but the website formatting messes it up

Error, If your only looking for a fix to that, scroll to the Troubleshooting area.

WAIT

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.

Lets begin.

Prerequisites (Requirements)

Luckily, there are not many and if your looking at this post, you probably have them.

  • Some form of Linux (I will be using Kali)
  • Basic Linux Skills
  • Run 'sudo apt-get update' before trying guide.

Step 1: Dependencies (Required Files)

To begin, you must first install the required dependencies to your Linux Distro.

Simply open up a terminal, copy and paste this command:

apt-get install libnl-3-dev libgcrypt11-dev libnl-genl-3-dev

I already have it installed, so it should look somewhat similar to what the pic says.

Note: If you are not root then you need to add 'sudo' before apt-get Ex.: sudo apt-get install .... this will ask you for your password. Simply type it in (it will not pop up) and press enter.

Step 2: Download and Extract Required Files

Download

We need to download two files, CRDA and wireless-regdb . (Click the file names to navigate to the websites to download them.) Be sure to download the <filename>.tar.xz version of the wireless-regdb file. Ensure you download the latest. For CRDA select CRDA-3.18 (Remember a new version could be out) and for wireless-regdb scroll to the very bottom and select the newest.

Move these to your desktop.

Extract

Open a terminal, navigate to your desktop and run these commands:

  • unxz crda-3.18.tar.xz
  • unxz wireless-regdb-2015.12.14.tar.xz

Copy & Paste may not work, be sure to change the filename to what you downloaded

Then Run:

  • tar -xf crda-3.18.tar
  • tar -xf wireless-regdb-2015.12.14.tar

Same as previous note

Now you should have the two files fully extracted on your desktop. Delete the old tar files.

Step 3: Editing Wireless-Regdb

Change Directory to the wireless-regdb folder,

cd ~/Desktop/wireless-regdb-2015.12.14

Then type:

ls

You should see a file named 'db.txt' We want to edit that file.

sudo nano db.txt
If you are not root, you must use sudo are your changes will not be saved

The first entry we see 'country 00' That is the world domain. This is what your card is first set to.

We are going to edit Bolivia. In the db file, it is known as BO. Scroll down till you see BO.

Here you can see BO's tx power is maxed at '20.' You can push this as far as your card can go, but we are going with 30, which is usually a safe number.

Change the 20 to 30 and hit CTRL-X, Y, and Enter.

Running an antenna with this power can possibly be a health hazard. Easily avoid this by not placing the antenna directly on or in you.

Step 4: Update Old CRDA with New CRDA.

Inside the wireless-regdb-2015.12.14 folder, type the command:

  • sudo make

This creates new files inside the folder.

Now, we change to the soon-to-be old CRDA folder.

  • cd /lib/crda

List the files

  • ls

Now change the 'regulatory.bin' file to 'regulatoryOLD.bin'

  • sudo mv regulatory.bin regulatoryOLD.bin

Now change back to the wireless-regdb-2015.12.14 folder on your desktop.

  • cd ~/Desktop/wireless-regdb-2015.12.14

Copy new regulatory.bin to crda folder

  • sudo cp regulatory.bin /lib/crda

Now, change back to /lib/crda and type: ls
Ensure it contains 'regulatory.bin'

Step 5: Copying PEM Files to Validate

Change to ~/Desktop/wireless-regdb-2015.12.14

Type this command:

  • sudo cp (asterisk).pem ~/Desktop/crda-3.18/pubkeys

I cant type the asterisk due to the website formatting This is what it is suppose to be

Then this:

  • cd /lib/crda/pubkeys
  • sudo cp benh@debian.org.key.pub.pem ~/Desktop/crda-3.18/pubkeys

These commands copy .pem files used to validate the regulatory.bin

Step 6: Editing Makefile to Fit Kali 2.0

  • cd ~/Desktop/crda-3.18
  • sudo nano Makefile

Change the 3rd line from: REGBIN?=/usr/lib/crda/regulatory.bin to REGBIN?=/lib/crda/regulatory.bin

See the difference? Simply remove the '/usr' from the path.

Step 7: Installing

Be sure you are in the crda directory. cd ~/Desktop/crda-3.18

Run:

  • sudo make
  • sudo make install

If you have an issue here, look in the troubleshooting section.

<PIC>

If our screens match, your good.

Step 8: Amping TXPower

Reboot your pc and type in these commands:

  • sudo ifconfig <wireless adapter> down

Repeat this step for all wifi adapters you have

  • sudo iw reg set BO
  • sudo ifconfig <wireless adapter> up

Repeat this step for all wifi adapters you have

  • sudo iwconfig <your adapter, in my case wlan1> txpower 30

Now type: sudo iwconfig

and you should see your adapter with TXPower: 30

<PICS>

Finished

Awesome! If everything worked for you, good job! If not, look at the troubleshooting area down below. Please leave a comment and kudos if I helped you :)

------------------------------------------------------------------------------

Step 9: Troubleshooting

I will add to this part if any other problems arise

Cannot Find Development Files for Any Supported Version of Libnl. Stop

Arises: In the final step when typing: make and make install in the new crda directory.

Full Error:

Also, this guide addresses the
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
Makefile:76: Cannot find development files for any supported version of libnl. Stop.
Note there is one more asterisk, but the website formatting messes it up

Solution:
Download Synaptic and run apt-get update

  • sudo apt-get update
  • sudo apt-get install synaptic

Run synaptic:

  • sudo synaptic

Select Search

Type: universe

Under all select: universe

Scroll to the bottom and select all packages with 'lib' in it.

<pic>

Hit apply and wait, process generally takes a bit.

Reboot and retry step.

TX Power Not Changing/Iw Reg Not Changing.

Arises: When your adapters location has been hard coded.

Solution:

Type:

  • sudo iw reg get

What ever country code pops up go back into the db.txt and change the txpower max similar to how it was done to BO (Bolivia)

---------------------------------------------------------------

Sources:

All articles and post that helped me create this guide.

Old TX Power post by Eight Four One

Post by P4nT4N30

Post by Prag

Reddit post helping with Troubleshooting

39 Comments

Thank you :) took me a while

Very comprehensive guide, will definitely be referring back to this. Thank you.
Cheers,
Washu

Why exactly is it illegal to increase your wifi strength..

Well, the US's laws say your not allowed to exceed 20 dBm (20 Tx Power). My guess (which could be completely wrong) is that these laws are in place to keep networks from overpowering each other. Mostly for malicious reasons, which is why most people are looking to up their TX Power. It doesn't stop many people from doing it though. I imagine it would be pretty hard to get caught unless you start doing it in public areas or try to crack the wrong people. Ill look more into it later.

Update:

For anyone curious, I also thought it was notable that it can be a health hazard having your TX Power so high for a lengthy amount of time close to your body. (Just dont be on top of it basically.)

I use the ALFA AWUS036NHA with the German: GE-AR9271 Chipset

here are my outputs:

uZer@Qu4ntum:~$ sudo ifconfig wlan0 down
uZer@Qu4ntum:~$ sudo iw reg set BO
uZer@Qu4ntum:~$ sudo iwconfig wlan0 txpower 30
uZer@Qu4ntum:~$ sudo ifconfig wlan0 up
uZer@Qu4ntum:~$ sudo iwconfig
eth0 no wireless extensions.

wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

lo no wireless extensions.

and the output of db.txt for Germany (BO was set to 33 dbm too)

# Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from

#

# For the 5GHz range also see

# http://www.bundesnetzagentur.de/cae/servlet/contentblob/38216/publicationFile/6579/WLAN5GHzVfg7_2010_28042010pdf.pdf

# The values have been reduced by a factor of 2 (3db) for non TPC devices
# (in other words: devices with TPC can use twice the tx power of this table).
# Note that the docs do not require TPC for 5150--5250; the reduction to
# 100mW thus is not strictly required -- however the conservative 100mW
# limit is used here as the non-interference with radar and satellite
# apps relies on the attenuation by the building walls only in the
# absence of DFS; the neighbour countries have 100mW limit here as well.

country DE: DFS-ETSI
# entries 279004 and 280006
(2400 - 2483.5 @ 40), (1000 mW)< changed from 100 to 1000 dbm
# entry 303005
(5150 - 5250 @ 80), (1000 mW), NO-OUTDOOR, AUTO-BW
# entries 304002 and 305002
(5250 - 5350 @ 80), (1000 mW), NO-OUTDOOR, DFS, AUTO-BW
# entries 308002, 309001 and 310003
(5470 - 5725 @ 160), (500 mW), DFS
# 60 GHz band channels 1-4, ref: Etsi En 302 567
(57000 - 66000 @ 2160), (40)

i have no idea what i have to do hope anyone could help me

thanks so much !

Sorry for late reply.

After typing this:
uZer@Qu4ntum:~$ sudo ifconfig wlan0 down
uZer@Qu4ntum:~$ sudo iw reg set BO
uZer@Qu4ntum:~$ sudo iwconfig wlan0 txpower 30
uZer@Qu4ntum:~$ sudo ifconfig wlan0 up
uZer@Qu4ntum:~$ sudo iwconfig

type:

sudo iw reg get

Tell me what it puts out. Thanks.

anybody know how to get this to work with Kali 2016.1 Rolling?
i get this error:
root@localhost:~/Desktop/crda-3.18# make
GEN keys-gcrypt.c

Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/benh@debian.org.key.pub.pem pubkeys/sforshee.key.pub.pem

CC libreg.so
reglib.c:28:20: fatal error: gcrypt.h: No such file or directory
compilation terminated.
Makefile:118: recipe for target 'libreg.so' failed
make: * libreg.so Error 1

Very sorry for my late reply, I have been very busy. Did you ever find a fix?

I found This.

Might be worth checking it out but from what I saw, you need to run these commands:

apt-get install libgcrypt11-dev
debuild -i -uc -us -b

To solve it I used your first command and I got the problem mentioned below which was actually solved with the solution provided below by another user

Great in depth tutorial, unfortunately was unsuccessful on my system. However changing the regulatory options which are packed inside the driver packages successfully allowed a txpower increase of over 20dBm on my system.

Hi, could you elaborate a bit on your solution? I have the same problem. Thanks in advances.

I cant make CRDA in Kali 2016.2

sudo make
LD crda
.//libreg.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:138: recipe for target 'crda' failed
make: ** crda Error 1

I have this same error, Do some one know how to fix this ?

I had the exact same error. My solution:

Go to the directory:
cd ~/Desktop/crda-3.18
Edit the file:
nano Makefile
Press CTRL + W (search for a string) and type:
-Werror
Simply remove to switch -Werror and save the file:
Press CTRL + O and then hit enter
Press CTRL + X to leave the editor
Now we need to enter:
make clean
And then:
make

We have told the compiler to stop treating warnings as errors.
This may fix this issue.

I have the same error too someone help please

same error :( Pls help

What is the error?

LD crda .//libreg.so: file not recognized: File format not recognized collect2: error: ld returned 1 exit status Makefile:136: recipe for target 'crda' failed make: ** crda Error 1

this is my output when i use make in crda directory...

root@kali:~/Desktop/crda-3.18# make
GEN keys-gcrypt.c

Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/benh@debian.org.key.pub.pem pubkeys/sforshee.key.pub.pem

CC libreg.so
keys-gcrypt.c:176:32: error: 'keys' defined but not used -Werror=unused-const-variable=
static const struct key_params keys = {
^~~~
cc1: all warnings being treated as errors
Makefile:118: recipe for target 'libreg.so' failed
make: ** libreg.so Error 1

I am getting this error when I run 'sudo make'

LD crda
.//libreg.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:137: recipe for target 'crda' failed
make: ** crda Error 1

Please help!

The solution is above

Go to the directory:
cd ~/Desktop/crda-3.18
Edit the file:
nano Makefile
Press CTRL + W (search for a string) and type:
-Werror
Simply remove to switch -Werror and save the file:
Press CTRL + O and then hit enter
Press CTRL + X to leave the editor
Now we need to enter:
make clean
And then:
make

Hi people, I cannot manage to increase TX Power to 30
I have done all the steps succesfully but when I do "iw reg set BO" and bring the interface up the change is not done.

When I do "iw reg get" I am still in the global one, so I went to the troubleshooting and saw that I should change the db.txt again. Here is my doubt after changing it, do I have to generate a new .bin, update the CRDA and copy the PEMS? Or just changing the db.txt should work?

And when changing the db.txt in the global part, do I only need to change the 2402-2472 to 30, or should I change everything to 30?

Many thanks buddies!
(Pd: My Network Card is Alfa Network AWUS036H)

Sorry guys I just figured it out, just remake the whole process from scratch and just in case, I edited both BO and 00 to 30. In any case I dont know why but now I was able to switch to BO what I couldnt before(stuck in 00). After switchin to BO I automatically switched to 30 so I didnt have to run the "iwconfig wlan1 txpower 30" command.

So I guess it's all cool now!

Everything went accordingly now I'm stuck in troubleshoot section. When I do the step to run synaptic manager to make lib changes

the apply is not clickable. Please help

Everything went beautifully except for last step. I got this error:

root@kali:~/Desktop/crda-3.18# make
GEN keys-gcrypt.c

Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/benh@debian.org.key.pub.pem pubkeys/sforshee.key.pub.pem

CC libreg.so
keys-gcrypt.c:176:32: warning: 'keys' defined but not used -Wunused-const-variable=
static const struct key_params keys = {
^~~~
CC crda.o
LD crda
CC intersect.o
LD intersect
CC regdbdump.o
LD regdbdump
CC db2rd.o
LD db2rd
CC optimize.o
LD optimize
CHK
Usage: ./regdbdump <regulatory-binary-file>
Makefile:157: recipe for target 'verify' failed
make: ** verify Error 234

Can you help me out please?

So i figured out what i did wrong. In Makefile in crda-3.18 the third line of code should be: REG_BIN?=/lib/crda/regulatory.bin

instead of:
REGBIN?=/lib/crda/regulatory.bin

Very good, thank you for sharing! Well, certainly worked like a charm on my very 'old school' NetGear WG111v3 (Realtek RTL8187B chipset), which I currently have cranked up to 33dBm (originally set to 20dBm).

Unfortunately, cranking up the Tx-P by +13dBm made very little difference to AP signal strengths, beacon nos. or deauth/injection effectiveness. But that may be because this old bugger (the dongle, not me) doesn't sport an external aerial.

I'm curious, though, how high could we (theoretically, of course) crank the Tx-P on these things? Would it make a meaningful difference? Has anyone gone beyond 33dBm? Is there a built-in hardware limit? If anyone knows or has mucked around with this I'd be interested to hear from you.

/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
Makefile:76: Cannot find development files for any supported version of libnl. Stop.

you don't have to install synaptic and install everything under universe search that has *.lib in it
just install pkg-config
apt-get install pkg-config

Hello, I followed this tutorial for my Alfa AWUS036NHR (RTL8188RU) but I can't increase or decrease txpower, it is fixed at 20dBm (latest version of kali).

What can I do?

Thank you

Hey Harry, if everything 'worked' in making/installing the new CRDA dB and you reg set the TX Power to BO (check with iw reg get) but still find yourself stuck on 20dBM, then try the process again, this time ensuring you increase the TX to, say, 30dBm, for (1) the global region (top of the list) and (2) your country region. I found that my WiFi reg would be set back to either global or AU (I'm Aussie) by some SYS settings and other apps so I just went nuts and replaced the 00 (global) and AU (my country) with 33dBm. I also replaced like BO with 35dBm, UK with 36, US with 37 etc etc. So I now have a virtual TX Power 'dial' which I can turn up and down with 'is reg set XX', depending on how much cancer I want to give my cat. Also note that some cheap China WiFi dongles just don't exceed 20dBm no matter what. 2/3 of my WiFi cards work with this trick but one super cheap Chinese one I've got won't cooperate. Start with ensuring TX is 30 for 00 global and your home region and see if that works first. Good luck mate!

Hi, thank you for reply.

I have already tried more than once what you said, but I can't change the value.
The weird thing is that I cannot decrease it (i.e. to 18dBm or to 15dBm) too.

Linux and Windows drivers of this antenna are really bad.

The only problem I had in "make", is this:

root@kali:~/Desktop/crda-3.18# make
GEN keys-gcrypt.c

Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/benh@debian.org.key.pub.pem pubkeys/sforshee.key.pub.pem

CC libreg.so
keys-gcrypt.c:176:32: error: 'keys' defined but not used -Werror=unused-const-variable=
static const struct key_params keys = {
^~~~
cc1: all warnings being treated as errors
Makefile:118: recipe for target 'libreg.so' failed
make: ** libreg.so Error 1

which I solved adding

-Wno-error -Wno-unused-const-variable

in the Makefile.

Thank you anyway for your help.

Hey Harry,

as stupid as it sounds, did you put down your <wlan0> interface with ifconfig <wlan0> down? :)

I had all the errors above with libnl (install pkg-config ) and "-Werror" (removed it from the Makefile and entered "make clean" "make" and "make install" again).

Everything worked, except i could not change the txpower . Even the "iw reg get" showed Bolivia (BO) with the correct values i entered in the db.txt file.

The simple solution was to bring down the interface first before changing the tx power (which makes sense if you think about it :) ).

Machine is a VM on a mac with the bleeding edge kali , updated a few minutes ago, wireless card is an Alfa AWUS036H with no hardcoded region.

KR

Hi, I already tried with no success, but I found that I can get 30dBm without this mod on Ubuntu 14.04, just with iw reg set BO.

Alfa AWUS036H and AWUS036NHR have different chipsets (RTL8187L and RTL8188RU).. I had an AWUS036H, which was better, but a lightning has burned it :(

Thank you for helping

so I got it all working, but figured it would be okay to set the BO to 35 and then set the interface to 33, but I can't get it back down to 33. Tried redoing the steps to no avail. any help?

_LD crda
.//libreg.so: file not recognized: Berkas format tidak dikenal
collect2: error: ld returned 1 exit status
Makefile:137: recipe for target 'crda' failed
make: ** crda Error 1_

#help mi?

GEN keys-gcrypt.c

Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/benh@debian.org.key.pub.pem pubkeys/sforshee.key.pub.pem

CC libreg.so
keys-gcrypt.c:176:32: warning: 'keys' defined but not used -Wunused-const-variable=
static const struct key_params keys = {
^~~~
CC crda.o
LD crda
CC intersect.o
LD intersect
CC regdbdump.o
LD regdbdump
CC db2rd.o
LD db2rd
CC optimize.o
LD optimize
CHK
Usage: ./regdbdump <regulatory-binary-file>
Makefile:157: recipe for target 'verify' failed
make: ** verify Error 234

Please help!

Share Your Thoughts

  • Hot
  • Latest