Friday, September 24, 2010

Lab 3: Building Aircrack-ng RPM from Source

Intro:
This lab focuses on grabbing a source rpm of any Linux command line application (in this case I chose to work with Aircrack-NG). The platform I will be working on is Fedora 13 x86_64.

Aircrack-ng is a set of tools to retrieve and manipulate the 802.11 WEP and WPA-PSK protocol packets in order to test your network for security (or gain unauthorized access).

Preparation:
Install rpm developer tools needed to prepare and build the final .rpm files.
$ yum install rpmdevtools

Setup the correct directory structure using rpmdev-setuptree. Running this command directly will create a folder called rpmbuild in your home directory.
$ rpm-setuptree
$ ll
total 24
drwxrwxr-x. 3 bccp32 bccp32 4096 Sep 24 08:49 BUILD
drwxr-xr-x. 2 bccp32 bccp32 4096 Sep 24 08:49 BUILDROOT
drwxrwxr-x. 3 bccp32 bccp32 4096 Sep 24 08:49 RPMS
drwxrwxr-x. 3 bccp32 bccp32 4096 Sep 24 08:46 SOURCES
drwxrwxr-x. 2 bccp32 bccp32 4096 Sep 24 04:38 SPECS
drwxrwxr-x. 2 bccp32 bccp32 4096 Sep 24 08:49 SRPMS


Download and install the source rpm of aircrack
$ yumdownloader --source aircrack-ng
$ rpm -i aircrack-ng-*.src.rpm

Unpack the source tarball located in the ~/rpmbuild/SOURCES
$ cd ~/rpmbuild/SOURCES
$ tar zxvf aircrack-ng-1.0.tar.gz
$
$ ll *       # Checks the untarred files
-rw-r--r--. 1 bccp32 bccp32 433 Sep 16 2009 aircrack-ng-1.0-define.patch
-rw-r--r--. 1 bccp32 bccp32 1147 Sep 16 2009 aircrack-ng-1.0-oui-path.patch
-rw-rw-r--. 1 bccp32 bccp32 1506412 Sep 16 2009 aircrack-ng-1.0.tar.gz
-rw-r--r--. 1 bccp32 bccp32 396 Feb 24 2009 aircrack-ng-parallel_make.patch


aircrack-ng-1.0:
total 128
-rwxrwxr-x. 1 bccp32 bccp32 44 Feb 26 2008 AUTHORS
-rwxrwxr-x. 1 bccp32 bccp32 39046 Sep 7 2009 ChangeLog
-rwxrwxr-x. 1 bccp32 bccp32 1604 Sep 1 2009 common.mak
-rwxrwxr-x. 1 bccp32 bccp32 442 Sep 21 2008 evalrev
-rwxrwxr-x. 1 bccp32 bccp32 2183 Sep 1 2009 INSTALLING
-rwxrwxr-x. 1 bccp32 bccp32 18011 Feb 26 2008 LICENSE
-rwxrwxr-x. 1 bccp32 bccp32 6279 Feb 26 2008 LICENSE.OpenSSL
-rwxrwxr-x. 1 bccp32 bccp32 1009 Jul 24 2009 Makefile
drwxrwxr-x. 2 bccp32 bccp32 4096 Sep 1 2009 manpages
drwxrwxr-x. 2 bccp32 bccp32 4096 Sep 1 2009 packages
-rwxrwxr-x. 1 bccp32 bccp32 3147 Feb 26 2008 patchchk
drwxrwxr-x. 3 bccp32 bccp32 4096 Sep 1 2009 patches
-rwxrwxr-x. 1 bccp32 bccp32 5160 Sep 1 2009 README
drwxrwxr-x. 4 bccp32 bccp32 4096 Sep 7 2009 scripts
drwxrwxr-x. 4 bccp32 bccp32 4096 Sep 1 2009 src
drwxrwxr-x. 2 bccp32 bccp32 4096 Sep 1 2009 test
-rwxrwxr-x. 1 bccp32 bccp32 3 Sep 1 2009 VERSION


$ cd ../SPECS
$ less *.spec
# To check for build dependencies. Look for the line that starts with BuildRequires. This will tell you what packages you need in order to build aircrack-ng
BuildRequires: sqlite-devel openssl-devel

Install the dependencies:

$ yum install openssl-devel sqlite-devel 


Building the rpm:

$ # Compile and build the rpm
$ rpmbuild -ba aircrack-ng.spec


At the end of the build you should see this (if everything worked without errors):
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/bash /bin/sh /usr/bin/env libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libcrypto.so.10()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit) libsqlite3.so.0()(64bit) libssl.so.10()(64bit) libz.so.1()(64bit) rtld(GNU_HASH)
Processing files: aircrack-ng-debuginfo-1.0-1.fc13.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/bccp32/rpmbuild/BUILDROOT/aircrack-ng-1.0-1.fc13.x86_64
Wrote: /home/bccp32/rpmbuild/SRPMS/aircrack-ng-1.0-1.fc13.src.rpm
Wrote: /home/bccp32/rpmbuild/RPMS/x86_64/aircrack-ng-1.0-1.fc13.x86_64.rpm
Wrote: /home/bccp32/rpmbuild/RPMS/x86_64/aircrack-ng-debuginfo-1.0-1.fc13.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.W7eTpm
+ umask 022
+ cd /home/bccp32/rpmbuild/BUILD
+ cd aircrack-ng-1.0
+ rm -rf /home/bccp32/rpmbuild/BUILDROOT/aircrack-ng-1.0-1.fc13.x86_64
+ exit 0



The final rpm files will be located in the ~/rpmbuild/RPMS/* directory
$ ls ~/rpmbuild/RPMS/*
aircrack-ng-1.0-1.fc13.x86_64.rpm aircrack-ng-debuginfo-1.0-1.fc13.x86_64.rpm


Comments:
This was a straight forward build with only 2 dependencies. Enjoy the final product!

Friday, September 10, 2010

Lab 1: Building NLED and GAMMU on Fedora 12

Compiling and Installing NLed.
NLed is a lightweight text editor developed at Seneca. The compile and install process is very straight forward.

To install NLED on your Fedora box follow the following steps:
1. Download nled tarball
$ wget http://cdot.senecac.on.ca/software/nled/nled_2_52_src.tgz

2. Untar
$ tar -xvz nled_2_52_src.tgz

3. Install Development Libraries
$ su -
# yum groupinstall "Development Tools" "Development Libraries"
# exit


4. Compile and Install NLED
$ make
$ make install


That's it for NLED. Very straight forward!

Compiling Gammu and Wammu GTK from source.
Gammu is a command line GSM phone management tool. Wammu is a front end to gammu and will assist newer users to automatically configure gammu to work with their phone.

$ cd ~/Downloads
$ wget https://sourceforge.net/projects/gammu/files/gammu/1.28.90/gammu-1.28.90.tar.bz2/download
$ wget https://sourceforge.net/projects/gammu/files/wammu/0.34/wammu-0.34.tar.bz2/download

$ tar jxvf gammu-1.28.90.tar.bz2
$ tar jxvf wammu-0.34.tar.bz2
$ yum install libdbi python-gammu wxBase wxGTK wxGTK-gl wxGTK cmake


$ cd gammu-1.28.90
$ cmake
$ make
$ make install

$ cd ../wammu-0.34
$ python setup.py build
$ su - 
# python setup.py install
# exit

Run Wammu
$ wammu

Thursday, September 9, 2010

Week 1: Communication Lab

Welcome to my SBR600 Blog Page!

Hi! 
My name is Yauheni Khabian. However, I prefer that people call me Eugene or simply Gene. I am a CTY student completing my 6th semester at Seneca@York.


My FAS2 Page: https://fedoraproject.org/wiki/User:Ykhabian
My Seneca Wiki: http://zenit.senecac.on.ca/wiki/index.php/User:Ykhabian


Setting up IRC:
I chose to use Xchat because I already had some previous experience with it. Here is how I installed Xchat on Ubuntu 9.10 (Karmic Koala).

First open terminal: press ALT+F2 and type in "gnome-terminal" into the empty field followed by Return.
Next check what packages are available (you might have to add some sources to your /etc/apt/sources.list):


bccp@bccp-laptop:~$ sudo apt-cache search xchat
[sudo] password for bccp:
xchat-gnome - a new frontend to the popular X-Chat IRC client
xchat-gnome-common - a new frontend to the popular X-Chat IRC client
bleachbit - delete unnecessary files from the system
pidgin-plugin-pack - Collection of Pidgin plugins
xchat - IRC client for X similar to AmIRC
xchat-common - Common files for X-Chat
xchat-gnome-indicator - XChat-GNOME Indicator Plugin
xchat-guile - Guile scripting plugin for XChat
xchat-indicator - XChat Indicator Plugin
xchat-otr - Off-the-Record Messaging Plugin for X-Chat
xchat-xsys - x-chat plugin that can display your current system statistics
xul-ext-ubuntu-it-menu - Firefox extension for a quick browse of Ubuntu-it community


Now install xchat-gnome:
bccp@bccp-laptop:~$ sudo apt-get install xchat-gnome

Go into Applications>Internet>XChat IRC and set your username, nickname, real name and select the server you want to join. In this case FreeNode.
At the channel popup box type in seneca to join #seneca channel and click Connect.

Chat away!


IRC Chat Log:
 
* Now talking on #seneca

* Topic for #seneca is: A channel for students and others learning about open source development. | Learning materials at http://zenit.senecac.on.ca/wiki | http://tinyurl.com/seneca-planet | http://cdot.senecac.on.ca - Centre for Development of Open Technology | Off-topic -> #seneca-social | See also irc://irc.mozilla.org/#seneca

* Topic for #seneca set by ctyler!~chris@global.proximity.on.ca at Tue Mar 30 14:29:23 2010
<ykhabian> hello there, doing my week 1 communication lab for SBR600 :)
<atpruteanu> heh
<kweber1> hey
<kweber1> me too
<ykhabian> nice, pretty straight forward lab but i can see how this course can cause some headaches
<atpruteanu> true but that usually means we're learning something
<ykhabian> yup, no pain no gain
* Marina has quit (Quit: I'm not here right now.)
* Marina_Y (~chatzilla@CPE0022b0b53b33-CM00159a64d6be.cpe.net.cable.rogers.com) has joined #seneca
* vbluzmans has quit (Quit: leaving)
<ykhabian> so what irc client is everyone using here?