Sunday, May 12, 2013

HOWTO : BeEF and Metasploit Integration on Ubuntu Desktop 12.04 LTS

Step 1 :

nano beef/extensions/metasploit/config.yaml

Make change to "host", "callback_host" and "msf_path". Where the last entry at "msf_path" should be the path of the Metasploit.

It will look like this :



Remarks : you are not required to change the "host", you can keep it as 127.0.0.1. However, you need to change the "callback_host" as it is the reverse connection IP address and it should be a public IP address.

Step 2 :

nano beef/config.yaml

Go to "extension:" and change the "false" to "true" under "metasploit".

It will look like this.



Step 3 :

Start Metasploit :

sudo /etc/init.d/metasploit start
cd /opt/metasploit/app
sudo msfconsole
db_connect


Under the msfconsole :

load msgrpc ServerHost=127.0.0.1 Pass=abc123

Start BeEF :

cd beef
./beef


Point your Firefox to the following url :

http://192.168.1.102:3000/ui/panel

Enter username and password for both "beef" to login.

Remarks :

Please note that the above IP address (192.168.1.102) is just an example.



The BeEF site has a tutorial for browser autopwn with Metasploit. You can refer to here.

That's all! See you.

Saturday, May 11, 2013

HOWTO : Joomscan on Ubuntu Desktop 12.04 LTS

Joomscan is OWASP Joomla Vulnerability Scanner.

Joomla! is probably the most widely-used CMS out there due to its flexibility, user-friendlinesss, extensibility to name a few. So, watching its vulnerabilities and adding such vulnerabilities as KB to Joomla scanner takes ongoing activity.It will help web developers and web masters to help identify possible security weaknesses on their deployed Joomla! sites.

However, it is not up-to-date. The latest version of vulnerability database is on October 22, 2012 (at the time of this writing).

Step 1 :

sudo apt-get install libwww-perl libwww-mechanize-perl

Joomscan is written in Perl. Download it.

sudo -sH
cd /opt
wget "http://downloads.sourceforge.net/project/joomscan/joomscan/2012-03-10/joomscan-latest.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjoomscan%2F%3Fsource%3Ddlp&ts=1368806935&use_mirror=ncu" -O joomscan-latest.zip


Step 2 :

Once downloaded, you need to extract the content.

sudo -sH
cd /opt
mkdir joomscan

cp joomscan-latest.zip /opt/joomscan/
rm joomscan-latest.zip

cd /opt/joomscan

unzip joomscan-latest.zip


Step 3 :

To run it.

sudo -sH
cd /opt/joomscan

perl joomscan.pl -u http://www.samiux.com


Step 4 :

To update it.

sudo -sH
cd /opt/joomscan

perl joomscan.pl update


That's all! See you.

HOWTO : WPScan on Ubuntu Desktop 12.04 LTS

WPScan is a black box WordPress vulnerability scanner.

Step 1 :

To install wpscan and her related packages.

sudo apt-get install git libcurl4-gnutls-dev libruby libxml2 libxml2-dev libxslt1-dev ruby1.9.1-dev

sudo -sH
cd /opt
git clone https://github.com/wpscanteam/wpscan.git

cd wpscan

sudo gem install bundler

sudo bundle install --without test developement


Step 2 :

To run it.

sudo -sH
cd /opt/wpscan

./wpscan.rb --url http://www.samiux.com


Step 3 :

To update it.

sudo -sH
cd /opt/wpscan

./wpscan.rb --update


That's all! See you.

Friday, May 10, 2013

HOWTO : BeEF on Ubuntu Desktop 12.04 LTS

BeEF - The Browser Exploitation Framework Project is a penetration testing tool that focuses on the web browser.

Amid growing concerns about web-borne attacks against clients, including mobile clients, BeEF allows the professional penetration tester to assess the actual security posture of a target environment by using client-side attack vectors. Unlike other security frameworks, BeEF looks past the hardened network perimeter and client system, and examines exploitability within the context of the one open door: the web browser. BeEF will hook one or more web browsers and use them as beachheads for launching directed command modules and further attacks against the system from within the browser context.

Step 1 :

To download the latest version of BeEF to the current directory.

sudo -sH
cd /opt
apt-get install git
git clone git://github.com/beefproject/beef.git


Step 2 :

To install BeEF and her related packages.

cd beef

sudo apt-get install ruby1.9.1-dev libsqlite3-dev sqlite3 sqlite3-doc build-essentail

sudo gem install bundler

sudo bundle install


Step 3 :

To run it.

sudo -sH
cd /opt/beef

./beef


Then point the Firefox to http://[your IP address]:3000/ui/panel

Step 4 :

To update it.

sudo -sH
cd /opt/beef

./update-beef


Remarks :

If you also installed Metasploit, you can integrate Metasploit to BeEF to perform attacks, such as browsers autopwn.

That's all! See you.

Tuesday, April 30, 2013

HOWTO : Troubleshooting CUDA on Pentoo 2013.0 RC1.1

As Pentoo 2013.0 RC1.1 is using hardened kernel, some application may not working properly. You may need to inspect and change the pax settings of the application in order to make it to work properly.

Use paxctl to inspect and change the pax settings.

paxctl -h
paxctl -v [application name]


Since the current Pentoo 2013.0 RC1.1 (as updated to April 29, 2013), the CUDA do not work properly by default. You are required to do something on it. This bug may be fixed in the next update or RC version.

First of all, make sure the libraries of CUDA are loading properly by making sure the following lines are at the file /etc/env.d/99cuda :

cat /etc/env.d/99cuda

PATH=/opt/cuda/bin:/opt/cuda/libnvvp
ROOTPATH=/opt/cuda/bin
LD_LIBRARY_PATH=/opt/cuda/lib64:/opt/cuda/lib


Finally, make sure some of the applications are set to proper pax settings. For example, cudaHashcat-plus64.bin and Cryptohaze-Multiforcer which are running with CUDA but they are not setting with pax flags properly at the current version.

Make sure the pax settings should be shown as the following :



Known Issue

The current version/update as on April 29, 2013, the pyrit does not work properly with CUDA. Since pyrit is written in Python, the paxctl does not work at all. According to one of the developers, the pyrit will be removed from the distribution.

That's all! See you.

Wednesday, April 10, 2013

HOWTO : VirtualBox 4.2.10 on Pentoo 2013.0 RC1.1

The current version (at the time of this writing) of VirtualBox is 4.2.10. However, it is masked in the main stream of Gentoo so as Pentoo. The reason of mask is unstable. It is recommended to use 4.1.24 from the Gentoo.

To install the current version of VirtualBox, you need to unmask it. I am a new comer of Gentoo/Pentoo, so my tutorial may not be 100% right.

Step 1 :

sudo eix virtualbox

sudo nano /etc/portage/package.accept_keywords

Append the following lines :

=app-emulation/virtualbox-bin-4.2.10 ~amd64
=app-emulation/virtualbox-modules-4.2.10 ~amd64
=app-emulation/virtualbox-guest-additions-4.2.10 ~amd64
=app-emulation/virtualbox-extpack-oracle-4.2.10 ~amd64
=app-emulation/virtualbox-additions-4.2.10 ~amd64
=app-emulation/virtualbox-4.2.10 ~amd64


sudo eix-update
sudo eix virtualbox


You will then see the current version on the screen.

sudo nano /etc/portage/make.conf

Append "PUEL" at the end of the ACCEPT_LICENSE :

ACCEPT_LICENSE="AdobeFlash-11.x Intel-SDP PUEL"

Step 2 (Install from the binary) :

** This step is tested **

Then check if the installation of VirtualBox will be working or not. I am going to install the "virtualbox-bin", the binary file, instead of compiling from source :

sudo emerge -pa virtualbox-bin

If everything is alright, you can install it :

sudo emerge -av virtualbox-bin

Step 3 :

After the installation, you need to add yourself (samiux here) to the group of "vboxusers" on the host (Pentoo) :

sudo gpasswd -a samiux vboxusers
sudo gpasswd -a vboxusers samiux


Step 4 :

Since the necessary modules of VirtualBox do not load properly, you need the following script to load and unload it when necessary.



Download it and save it at /etc/init.d/virtualbox :

sudo chmod +x /etc/init.d/virtualbox

To start it :

sudo /etc/init.d/virtualbox start

To stop it :
sudo /etc/init.d/virtualbox stop

To start it automatically when boot :

sudo rc-update add virtualbox default

Update :

According to one of the developers, you have another way to load the modules automatically :

echo modules="vboxdrv vboxnetflt vboxnetadp" >> /etc/conf.d/modules

Step 5 (General Linux) :

Install Linux guest (when necessary). After the installation, you need to add yourself (samiux here) to the group of "vboxsf" on the guest (Linux) :

sudo gpasswd -a samiux vboxsf

*** make sure it is vboxsf BUT NOT vboxfs.

Then, the share folder feature will be working properly.

Step 6 (Pentoo) :

Install the same version of virtualbox-guest-additions in your guest (Pentoo / Gentoo) as above mentioned method.

At the guest (Pentoo), you should do the following as the required module does not load properly and the mount does not work automatically.

sudo nano /etc/local.d/00-vboxsf.start

modprobe vboxsf
mount -t vboxsf vbox_share /media/sf_vbox_share


sudo chmod +x /etc/local.d/00-vboxsf.start

sudo gpasswd -a samiux vboxsf

Reboot your guest.

That's all! See you.

Friday, April 05, 2013

HOWTO : Customize Pentoo 2013.0 RC1.1

Once you installed and updated Pentoo 2013.0 RC1.1, you may consider to install some packages on it. I selected some of them for the installation.

sudo emerge -av galculator
sudo emerge -av shutter
sudo emerge -av radiotray
sudo emerge -av preload
sudo emerge -av xfce4-weather-plugin
sudo emerge -av gtk-recordmydesktop
sudo emerge -av gnome-system-monitor
sudo emerge -av xfce4-kbdleds-plugin
sudo emerge -av xfce4-cpufreq-plugin
sudo emerge -av gnome-media


If you need LibreOffice, you need to install it but it will take a very long time to compile from source code :

sudo emerge -av libreoffice

*** If you have a very slow CPU or do not want to compile LibreOffice from source, you can install the binary package instead if it is available :

sudo emerge -av libreoffice-bin

Installation of Network Manager

If you do not like the Wicd and will use VPN or mobile network (such as 3G) :

sudo emerge -av networkmanager
sudo emerge -av networkmanager-pptp
sudo emerge -av networkmanager-openvpn
sudo emerge -av networkmanager-vpnc
sudo emerge -av nm-applet


Then make it boot by default :

rc-update add NetworkManager default

Now, set to load GNOME service on boot :

Menu -- Settings -- Session and Startup -- Advanced

Select "Launch GNOME services on startup"

*** Make sure you unselect the Wicd at "Application Autostart".

Then, reboot your box.

Installation of GPointing Device Settings

sudo emerge -av gpointing-device-settings

Menu -- Settings -- Session and Startup -- Application Autostart

Select "GNOME Settings Daemon"

If you have ThinkPad with TrackPoint, you may need to set the Firefox to use the middle button :

Firefox -- Edit -- Preferences -- Advanced -- General

Select "Use autoscrolling"

Then, all the hotkeys of ThinkPad should work.

Installation of 3G USB Modem

sudo emerge -av usb_modeswitch
sudo emerge -av modemmanager


Add user to the group of plugdev :

sudo gpasswd -a samiux plugdev

Then, reboot your box.

Bonus #1

To make your Pentoo more secure by append the following to /etc/fstab :

tmpfs /tmp tmpfs noexec,nosuid,nodev,mode=1777,size=512M 0 0

*** Make sure the size is large enough for Pentoo to compile packages when update/upgrade. Or, simply DO NOT set this settings.

Bonus #2

If you are using hard drive and want to make Pentoo more faster, you can edit the /etc/fstab as the following :

/dev/sda1 /boot ext2 noatime,nodiratime,defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext4 noatime,nodiratime,defaults 0 1


If you are using SSD, you can :

/dev/sda1 /boot ext2 noatime,nodiratime,defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext4 discard,noatime,nodiratime,defaults 0 1


It will look like the following :



That's all! See you.



Sunday, March 31, 2013

HOWTO : Update Pentoo 2013.0 RC1.1 on ASUS Sabertooth X79

For routine update/upgrade of Pentoo, you need to follow the following steps :

# This syncs the gentoo and pentoo repos like "apt-get update" in debian
emerge --sync
# This updates all the normal packages like "apt-get upgrade" in debian
emerge --deep --update --newuse world -vt
# This optionally merges in changed config files. unchanged files are merged automatically
etc-update
# This removes old packages which are not needed like "apt-get autoremove" in debian
emerge --depclean
# This rebuilds anything which may have been broken in update
emerge @preserved-rebuild
# This checks all the programs installed from VCS for new revisions and updates if needed
smart-live-rebuild
# Verifies there is no breakage after updates
revdep-rebuild
# Regenerate the main menu for XFCE WM (run it under each regular account)
genmenu.py -x
#merge in any new config files
etc-update
#clean up the distfiles dir to remove old/un-needed files
eclean-dist -d

Optional
# Check /var/log/portage/elog/summary.log file
# You might need to run extra commands. For example:
emerge @x11-module-rebuild
eselect java-vm set system icedtea-bin-7

#after python/perl upgrade:
perl-cleaner --modules
python-updater


That's all! See you.

Install Pentoo 2013.0 RC1.1
Customize Pentoo 2013.0 RC1.1

Saturday, March 30, 2013

HOWTO : Pentoo 2013.0 RC1.1 on ASUS Sabertooth X79

After about a month of tries and errors, this article is the most updated and error free for the Pentoo 2013 RC1.1 installation as at April 22, 2013.

Pentoo is based on Gentoo and it is a Penetration Testing Linux distribution. The developers of Pentoo targetted their product for serious Pentesters. Pentoo is not for newbies as it is based on Gentoo which requires some Linux experience to master this distribution.

Hardware

CPU : Intel i7-3930K (6 cores, 12 cores with Hyper-Threading, Socket 2011)
Motherboard : ASUS SaberTooth X79
RAM : Corsair Vengeance DDR3 1600 32GB (4GB x 8)
Hard Drive : WD SATA III 3TB Red WD30EFRX
Display Card : Inno3D nVidia GeForce GTX 590 384bit 3072MB DDR5 x 2

Making of Bootable USB Pendrive

Use UNetbootin to make a bootable USB pendrive. Before booting, edit syslinux.cfg on the usb pendrive and add "nodetect" to the kernel line to prevent asking for password when boot. Unetbootin switches the bootloader and there was a mistake in the converted config file. This issue has been logged and fixed for the next release.

Live USB Boot to Desktop

Press F8 to pop up the BIOS boot menu and DO NOT select the UEFI option of the USB pendrive.

Once it is booted up, at the "livecd" prompt type the following to bring up the ethernet card. Make sure you are connecting to the internet :

dhcpcd eth0

Type the following to build the latest version of nVidia display card driver :

mkxf86config.sh
eselect opengl set xorg-x11
nvidia-xconfig


After that, type the following command to bring up the desktop :

startx

Live USB Boot to Install

Step 0 :

Press F8 to pop up the BIOS boot menu and DO NOT select the UEFI option of the USB pendrive.

Step 1 :

dhcpcd eth0
layman -s pentoo
emerge -1 pentoo-installer


pentoo-installer

Step 1a :

If you have a hard drive that is larger than 2TB, you need to manual configure your partitions :

/dev/sda1 - /boot
/dev/sda2 - swap
/dev/sda3 - /


Then following the menu to install step by step. At last, you will be asked for install the bootloader, you should install to /dev/sda.

Step 2 :

After the installation, remove the USB pendrive and reboot your box and login as root.

Next, clean up live configuration :

dhcpcd eth0

Fix the /etc/inittab file :
rc-update delete fixinittab
emerge -1 sys-apps/sysvinit


Remove live-related configuration :
rm /etc/gconf /usr/share/livecd
emerge -1 gnome-base/gconf


Then, reboot your box again and login as root.

Step 3 :

(First time configuration)

You are advised to follow the prompt from the screen to do the update.

dhcpcd eth0
nano /etc/portage/make.conf


ACCEPT_LICENSE="AdobeFlash-11.x Intel-SDP PUEL"

# You may wish to edit your VIDEO_CARDS line to match your system better.
# nVidia users:
USE="binary-drivers cuda opencl qemu -doc -examples"
VIDEO_CARDS="nvidia fbdev vga vesa"


# AMD (ATi) users :
USE="binary-drivers opencl qemu -doc -examples"
VIDEO_CARDS="fglrx fbdev vga vesa"


If you are installing Pentoo to virtualbox or vmware, please use the following settings :
# Guest OS users should add virtualbox/vmware flags:
USE="binary-drivers opencl qemu -doc -examples"
VIDEO_CARDS="virtualbox fbdev vga vesa"


Step 4 :

(First time update)

emerge --sync

After that, you are required to react to the recommendation on the screen (which is usually in green colour). You may requried to update portage (if any), please do :

emerge --oneshot portage

Then, you may prompt to do the following (if any) :
emerge @preserved-rebuild

*** nVidia and cuda drivers are to be installed then. If AMD (ATi), no action to be taken.

Reboot the box and login as root again.

Step 5 :

If nVidia user :
nvidia-xconfig

startx

To update/upgrade the packages :
emerge --deep --update --newuse world -vt

To merge the config files (if any) :
etc-update

*** select "-3" to replace with the new config files and answer "yes" for all questions.

To delete not necessary packages including unused video drivers :
emerge --depclean

To rebuild anything when some packages are broken in the update :
emerge @preserved-rebuild

To update/upgrade the SVN packages :
smart-live-rebuild

To make sure there is no breakage after the update :
revdep-rebuild

To regenerate the main menu of Xfce window manager (you are required to do this step on each user) :
genmenu.py -x

To check if any config file need to be merge or not :
etc-update

To clean up the box (remove old or not needed packages) :
eclean-dist -d

To rebuild X11 related drivers :
emerge @x11-module-rebuild

To set the java vm to the latest version :
eselect java-vm list
eselect java-vm set system icedtea-bin-7


or

eselect java-vm set system 1

*** if the icedtea-bin-7 is in the first item.

To recompile perl when it is upgraded :
perl-cleaner --modules

To recompile python when it is upgraded :
python-updater

Step 6 :

After that, reboot and login as root.

If you would like the xfce4 window manager :
startxfce4

Else, if you want to have e17 window manager :
startx

The network interface name will be changed to "eno1" (due to udev-2000) for my box (you may need to use "ifconfig -a" to confirm :

dhcpcd eno1

startxfce4

To make sure wicd will be launch without problem even you are login as normal user :
rc-update add wicd default

Step 7 :

nano /etc/conf.d/hostname

Change to :
HOSTNAME="pentoo"

*** or any hostname you like.

Step 8 (Optional) :

If you are AMD (ATi) user, you may need to do the following in order to launch the window manager :
rc-update add acpid boot

*** If you login as normal user, you just "startx" to xfce4 window manager.

*** If you login as root but want to use "startx" to xfce4 window manager, you need to :

nano .xinitrc
exec ck-launch-session startxfce4
#exec enlightenment_start


Step 9 (Optional) :

If you do not want to have weird or new network interface name, you can refer to this link to fallback to kernel based name.

Or simply following the below step :

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

Then, reboot your box.

Know issue

As at April 22, 2013, CUDA and her related applications, such as pyrit, cudaHashcat-plus64.bin and Cryptohaze-Multiforcer do not work due to the Pentoo's hardened kernel. The workaround for Cryptohaze-Multiforcer is at here. Hope the development team can solve this problem as soon as possible.



That's all! See you.

Update Pentoo 2013.0 RC1.1
Customize Pentoo 2013.0 RC1.1

Wednesday, March 27, 2013

HOWTO : BackBox 3.01 on ASUS Sabertooth X79

BackBox Linux project was born in Italy in 2010 and it is created by Raffaele Forte University of Calabria computer engineering student and security enthusiast.

The current version is 3.01 and it is released on Jan 23, 2013. This version is based on Ubuntu 12.04 LTS. It comes with windows manager Xfce4.

BackBox Linux is a penetration test Linux distribution. You can even install her packages (including BackBox menu) to your existing running Ubuntu 12.04 LTS box by adding her PPA repository.

It comes with about 60 pre-installed penetration testing tools but they are usable and well known. The tools are well tested by developers before they are released. Other tools can be installed by yourself or from the Ubuntu repository.

Using BackBox is just like using Ubuntu. It is easy to use and maintain.

Installation

If you have nVidia display card(s), you should add "nomodeset" to the boot menu of the Live DVD/USB by pressing "Tab" button on the keyboard. Once it is installed, the nVidia display card driver is installed automatically and the version is 304.48. Do not try to install other version of the nVidia driver yourself as other packages in the Ubuntu repository is broken.

There is no pain to install BackBox on ASUS Sabertooth X79 motherboard even it comes with UEFI BIOS. You just press "F8" when the computer is boot up to activate the boot menu. Select normal option, do not choose the UEFI option of DVD/USB. Then, it will boot fine.

To burn the bootable BackBox USB pendrive on Linux, you need to use Ubuntu's "Startup Disk Creator" (usb-creator-gtk) or UNetbootin.

Customization

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install galculator gedit radiotray axel-kapt libreoffice preload


Update Penetration Tools

Go to the menu, click "Update" and select the tools for update. It is very simple and easy as well as without pain. When you are updating "cvechecker", make sure you see the word "finish" or "done" before closing the terminal window as it needs time to download the data file. If you have slow internet connection, the download seems halt, but be patient until it is finished.

Performance Tuning

You may consider to add "noatime" and "nodiratime" to the /etc/fstab. Make sure you have no typo or your box will not boot properly.



That's all! See you.

Tuesday, March 26, 2013

What is going on for Kali Linux (Full Version)?

Kali Linux is only a collection of pentesting tools Linux distribution. All the pentesting tools can be obtained free of charge from the internet as those are freeware or open source software.

The development team of Kali Linux do not accept any voice from their users about their weakness of their product. For example, when telling them about the Kali Linux rebuild bugs, they always stating that they have built a lot of copies and they found no problem. Later, one of the developer fixed and it can be compiled correctly. You can refer to the following bug report for details.



I am getting unsatisfied with this response at that time. However, I am not an angry user at all.

The core person, muts who is also a founder of Offensive Security, deleted some of the bug reports instead of rating it as "invalid" if they find the bug report is nonsense. I think it is not a proper way to handle a bug tracker like this. I have four examples so far, they are :









On March 25, 2013 (at my time zone), I am chatting on the #kali-linux channel and telling them that Kali Linux is working perfectly on Gnome DE only but not the other DEs, such as KDE or Xfce. Why I am saying that? It is because, when I am rebuilding KDE and Xfce, I will find some packages missing according to the documentation of the Kali Linux. I am telling them that their documentation needs to be improved. However, one of the developer "balding_parrot" rely that it is a "guide" only.

Later, I tell them about the bug reports deletion, they banned me on the channel. Now, I am getting angry. I delete all the articles (3 HOWTO's only so far) in the Kali Linux forum. I also delete all the articles on my blog that regarding to Offensive Security and Kali Linux. I am an angry user now. The following is Xchat log (the last 300 lines) about the conversation on March 25, 2013 :



Under the angry mood, I write my blog like this on that day.

Later, my accounts on Kali Linux bug tracker and Kali Linux forum are banned.

I will not use Kali Linux any more as there are some other pentesting Linux distributions in the internet. Meanwhile, the pentesting tools are available under freeware or open source license.

That's all! See you.

Monday, March 25, 2013

What is going on for Kali Linux?

Today, I experienced an upset incident which Kali Linux freenode channnel banned me for I just told them the truth about the fact that one of the developers (he is muts) to delete some of the bug reports.

In my opinion, why they not rated the entries as invalid instead of deleting it. However, I was banned. Therefore, I deleted what I posted in the forum of Kali Linux (http:www.kali.org). Later learnt that I was also banned for the Kali forum.

As far as I know that Kali Linux is sponsored by Offensive Security which I was trained. Therefore, I deleted all my articles that about Offensive Security (offsec) and her courses.

I am very disappointed that the behavior of the developer (who stated that he is, balding_parrot) to act like this. Therefore, I will not use Kali Linux any more as there are many Pentesting distros out there.

That's all. See you.

Updated : You can view the full story at here.

HOWTO : Rebuild Kali Linux 1.0.1 for Xfce 4 Desktop

This article has been deleted for several days due to this reason. However, more than 2 readers request this article back. Thus, it is back, enjoy!

To rebuild Kali Linux for Xfce 4 takes time but it worths to process if you want to have a Xfce 4 desktop interface.

Step 0 :

Download the Kali Linux 1.0.1 and install to the hard drive. Make sure you enable the "mirror" when asked. Otherwise, your Kali will not working properly.

If you don't, please append the following to the /etc/apt/sources.list :

deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib


Then, do the following may fix the problem :

apt-get update && apt-get dist-upgrade

Make sure you DO NOT edit the GNOME/Xfce menu yourself as it will mess the Kali Menu. However, if you messed the Kali menu, you can do the following to fix :

rm ~/.config/menus

Step 1 :

To prepare your Kali box to be capable to rebuild the Kali iso files :

apt-get install git live-build cdebootstrap kali-archive-keyring apt-cacher-ng

Step 2 :

touch standard.list.chroot

Append some package name to the file in order to tell the maker to include such package to the .iso file.

Or copy and paste to the file namely "standard.list.chroot" to /root/ which includes some useful packages instead (you may edit this file) :

! Packages Priority standard
gedit
radiotray
preload
gtk-recordmydesktop
galculator
synaptic
axel
cpuid
network-manager-pptp
network-manager-pptp-gnome
network-manager-openvpn
network-manager-openvpn-gnome
network-manager-vpnc
network-manager-vpnc-gnome
isomaster
xchat-common
xchat
libreoffice
shutter
bluez-gstreamer
bluez-compat
bluez-alsa
bluez-cups


Step 3 :

Copy and paste to file "update-kali" to your /root/ directory :

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


Make it execuatable :

chmod +x update-kali

Step 4 :

rm -R /root/live-build-config

git clone git://git.kali.org/live-build-config.git

cp /root/standard.list.chroot /root/live-build-config/config/package-lists/
cp /root/update-kali /root/live-build-config/config/includes.chroot/root/

cd live-build-config

Step 5 :

nano config/package-lists/kali.list.chroot

To locate the following section in the file and make it looks like the following :

# Graphical desktops depending on the architecture
#
# You can replace all the remaining lines with a list of the
# packages required to install your preferred graphical desktop
# or you can just comment everything except the package of your
# preferred desktop.

#if ARCHITECTURES i386 amd64
# *** GNOME DESKTOP ***
iceweasel
alsa-base
alsa-firmware-loaders
gstreamer0.10-alsa
gnome-alsamixer
gir1.2-gstreamer-0.10
gstreamer0.10-pulseaudio
gstreamer0.10-nice
gstreamer0.10-ffmpeg
gstreamer0.10-x
gstreamer0.10-gconf
gstreamer0.10-plugins-base
gstreamer0.10-plugins-ugly
libgstreamer0.10-0
libclutter-gst-1.0-0
gir1.2-clutter-gst-1.0
libgstreamer-plugins-bad0.10-0
libgstreamer-plugins-base0.10-0
gstreamer0.10-plugins-good
gir1.2-gst-plugins-base-0.10
gstreamer0.10-plugins-bad
kali-defaults
kali-root-login
desktop-base
network-manager-gnome
network-manager
xfce4
#endif


Step 6 :

/etc/init.d/apt-cacher-ng restart
export http_proxy=http://localhost:3142/


./build_all.sh

The rebuilt amd64.iso and i386.iso are located at /root/live-build-config/images. The process will take 4 to 6 or more hours to complete. Please be patient.

Bouns #1

If your CPU is too old that does not support PAE, you need to rebuild your Kali Linux.

Follow Step 1 to Step 5 as above.

cd live-build-config
cd auto
nano config


Locate the following :

lb_opts="--debian-installer live --linux-flavours 686-pae"

and replaces with :

lb_opts="--debian-installer live --linux-flavours 486"

Save it and exit.

cd ..

or

cd /root/live-build-config

/etc/init.d/apt-cacher-ng restart
export http_proxy=http://localhost:3142/


lb config --architecture i386
lb build


That's all! See you.

Tuesday, March 19, 2013

HOWTO : nVidia Display Card on Kali Linux 1.0.1

This article has been deleted for several days due to this reason. However, more than 2 readers request this article back. Thus, it is back, enjoy!

Kali Linux is the most advanced penetration testing distribution. Back|Track 5 R3 is retired and is no longer supported. Kali Linux is based on Debian Wheezy 7.0.

This distribution can be custom build the ISO file in x86 and x86_64. The documentation is detailed and completed. The installation of Kali Linux is easy and fast.

Installation of nVidia Display Card Driver

UPDATE on October 27, 2013 : In Kali Linux 1.0.5, you need to remove winexe to install nVidia driver and CUDA driver. apt-get update

apt-get install nvidia-kernel-source nvidia-detect nvidia-libopencl1 nvidia-opencl-common nvidia-support nvidia-opencl-icd nvidia-visual-profiler nvidia-glx nvidia-installer-cleanup nvidia-kernel-common nvidia-smi nvidia-alternative nvidia-opencl-dev libglx-nvidia-alternatives nvidia-kernel-dkms nvidia-cuda-toolkit nvidia-vdpau-driver nvidia-xconfig glx-alternative-nvidia libgl1-nvidia-alternatives nvidia-settings libgl1-nvidia-glx xserver-xorg-video-nvidia libcublas4 libcudart4 libcufft4 libnpp4 libnvidia-compiler libcuda1 libcuinj4 libnvidia-ml1 libxvmcnvidia1 libcusparse4 libcurand4 python-pycuda-doc python-pycuda-headers python-pycuda nvidia-cuda-doc nvidia-cuda-gdb

nvidia-xconfig

Then, reboot your box. Although the version of the driver is quite old but it is workable.

That's all! See you.

HOWTO : Rebuild Kali Linux 1.0.1

This article has been deleted for several days due to this reason. However, more than 2 readers request this article back. Thus, it is back, enjoy!

To rebuild Kali Linux takes time but it worths when you need the most updated Kali Linux on Live DVD or USB thumb drive.

Step 0 :

Download the Kali Linux 1.0.1 and install to the hard drive. Make sure you enable the "mirror" when asked. Otherwise, your Kali will not working properly.

If you don't, please append the following to the /etc/apt/sources.list :

deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib


Then, do the following may fix the problem :

apt-get update && apt-get dist-upgrade

Make sure you DO NOT edit the GNOME menu yourself as it will mess the Kali Menu. However, if you messed the Kali menu, you can do the following to fix :

rm ~/.config/menus

Step 1 :

To prepare your Kali box to be capable to rebuild the Kali iso files :

apt-get install git live-build cdebootstrap kali-archive-keyring apt-cacher-ng

Step 2 :

touch standard.list.chroot

Append some package name to the file in order to tell the maker to include such package to the .iso file.

Or copy and paste to the file namely "standard.list.chroot" to /root/ which includes some useful packages instead (you may edit this file) :

! Packages Priority standard
gedit
radiotray
preload
gtk-recordmydesktop
galculator
synaptic
axel
cpuid
network-manager-pptp
network-manager-pptp-gnome
network-manager-openvpn
network-manager-openvpn-gnome
network-manager-vpnc
network-manager-vpnc-gnome
isomaster
xchat-common
xchat
libreoffice
shutter
bluez-gstreamer
bluez-compat
bluez-alsa
bluez-cups


Step 3 :

Copy and paste to file "update-kali" to your /root/ directory :

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


Make it execuatable :

chmod +x update-kali

Step 4 :

Copy and paste to file "rebuild-kali" to your /root/ directory :

# clean the previous live-build-config directory and pull the new config file
echo "Removing the previous live-build-config direcotry ...."
cd /root/
rm -R live-build-config
echo "Getting the new live-build-config file ...."
git clone git://git.kali.org/live-build-config.git
echo "Copying the customized standard.list.chroot from /root/ ...."
cp /root/standard.list.chroot /root/live-build-config/config/package-lists/
echo "Copying the update-kali and rebuild-kali scripts from /root/ ...."
cp /root/update-kali /root/live-build-config/config/includes.chroot/root/
cp /root/rebuild-kali /root/live-build-config/config/includes.chroot/root/
echo "Enable the apt-cacher-ng ...."
/etc/init.d/apt-cacher-ng restart
export http_proxy=http://localhost:3142/
cd live-build-config
echo "Be patient .... Building amd64.iso and i386.iso ...."
echo "It will takes 4-6 hours or more to complete ...."
echo "Please DON'T close this terminal ...."
./build_all.sh


Make it execuatable :

chmod +x rebuild-kali

Step 5 :

If you have 64-bit Kali Linux installed, you can build amd64.iso and i386.iso (PAE) at the same time. If you have 32-bit Kali Linux installed, you can only build i386.iso (PAE). To build the amd64.iso and i386.iso at the same time by executing the following command :

./rebuild-kali

The .iso files will be created at /root/live-build-config/images/ and it will takes 4 to 6 or more hours to complete. It depends on the power of your CPU and amount of RAM you have. I recommend you have at least 2 GB RAM to do the rebuild.



Bouns #1

If your CPU is too old that does not support PAE, you need to rebuild your Kali Linux.

Follow Step 1 to Step 4 as above.

cd /root/
rm -R live-build-config


git clone git://git.kali.org/live-build-config.git

cp /root/standard.list.chroot /root/live-build-config/config/package-lists/
cp /root/update-kali /root/live-build-config/config/includes.chroot/root/
cp /root/rebuild-kali /root/live-build-config/config/includes.chroot/root/


cd live-build-config
cd auto
nano config


Locate the following :

lb_opts="--debian-installer live --linux-flavours 686-pae"

and replaces with :

lb_opts="--debian-installer live --linux-flavours 486"

Save it and exit.

cd ..

or

cd /root/live-build-config

/etc/init.d/apt-cacher-ng restart
export http_proxy=http://localhost:3142/


lb config --architecture i386
lb build


That's all! See you.

Sunday, March 10, 2013

HOWTO : BitCoin Mining with nVidia GeForce on Ubuntu Desktop 12.04 LTS and 12.10

What is BitCoin?

Bitcoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin is also the name of the open source software which enables the use of this currency.

BitCoin Mining Benchmark

I think it is not too late for BitCoin mining. I know that AMD Radeon display card is more faster than nVidia when doing BitCoin mining and hash cracking. There is a benchmark comparsion at here. However, I have two nVidia GeForce GTX590 display card and I have no fund to buy another system for the purpose.

To install Ubuntu Desktop on nVidia system, you need to add "nomodeset" as Linux kernel parameter.

Installation

(A) BitCoin Wallet

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install bitcoin-qt bitcoind


(B) OpenCL

sudo apt-get install ocl-icd-libopencl1

Download nvidia-opencl-icd 195.36.31-6squeeze2
http://packages.debian.org/squeeze/nvidia-opencl-icd

Download nvidia-opencl-common 195.36.31-6squeeze2
http://packages.debian.org/squeeze/nvidia-opencl-common

Download libcuda1 195.36.31-6squeeze2
http://packages.debian.org/squeeze/libcuda1

Install them with the following command :

sudo dpkg -i *.deb

sudo apt-get install python-pyopencl python-pyopencl-headers python-wxgtk2.8 python-wxtools wx2.8-i18n python-bumpy python-netifaces

* nvidia-opencl-icd, nvidia-opencl-common and libcuda1 may be fixed in Ubuntu 13.04 and you are not required to download sperately

(C) nVidia driver

sudo apt-get install jockey-common

For Ubuntu 12.10 :

Please refer to here as the Ubuntu 12.10 have a minor bug for nVidia display driver as it lack of kernel headers for building the nvidia module.

(D) GUIMiner

GUIMiner download from https://github.com/Kiv/poclbm

sudo apt-get install git
git clone https://github.com/Kiv/poclbm.git


Edit the file ioutil.py to correct something :

cd poclbm
nano ioutil.py


To make it looking like the following at the beginning of the file :

from glob import glob
#from serial.tools import list_ports
import serial


To run the GUIMiner :

cd poclbm
python guiminer.py


(E) Bonus

(1) GUIMiner for Windows (All-in-One)

GUIMiner Advanced Setup download

(2) AMD APP SDK for AMD Radeon

AMD APP SDK

(3) Ufasoft Miner (bitcoin-miner for CPU)

bitcoin-miner
bitcoin-miner for Windows
bitcoin-miner (Source Code for Linux)

(4) GUIMiner (poclbm.py) Settings

For best performance but higher temperature -
nVidia GTX590 : -v -f0 -w128
nVidia GTX460 : -v -f0 -w128

For lower temperature but lesser performance -
nVidia GTX590 : -s0.01
nVidia GTX460 : -s0.01

e.g. Two GTX590 (a total of 4 CUDA devices) running setting of -s0.01 at room temperature (21 degree) under water cooling. The temperature of each CUDA devices is around 50 degree. The performance of each CUDA device is around 73 Mhash/s. The total performance is about 292 Mhash/s. If this box is running in room temperature in summer here (around 30-33 degree), the maximum temperature of CUDA device will be around 80 degree under water cooling condition.

The performance of BitCoin mining of this box is not good at all with the high price of the GTX590. I do not recommend to use nVidia display card for BitCoin mining and hash cracking.

* each entry for each CUDA device in GUIMiner

(5) BFGMiner for AMD Radeon/CPU/ASIC

Ubuntu PPA

(6) ASIC mining is the most fastest in the world so far

(7) Make sure you have backup your BitCoin (BTC) as it is either stored in the pool server or local machine.

That's all! See you.

Sunday, March 03, 2013

EXPLOIT - CVE-2013-1763 Linux Kernel Local Privilege Escalation

This vulnerability is announced on Feb 24, 2013 by Mathias Krause. However, according to some sources in the internet (Russian forums) that this vulnerability was discovered for more than a year but it is not published until Mathias Krause.

The affected Linux kernel is from 3.0.8 to 3.7.9. The most common Linux distributions such as Fedora and Ubuntu are affected. Fedora 16 to 18 with the kernel before 3.7.9-205.fc18 are affected. Ubuntu 12.04 LTS to 12.10 (including the 13.04 which is under development at this writing) with the kernel before 3.5.0-25.39 are affected.

The exploit source codes are available in the wild for Arch Linux, Fedora and Ubuntu. The Arch Linux available exploit is targeted to 64-bit version while the available exploit for Fedora and Ubuntu are targeted to 32-bit. The exploitation for Ubuntu is more harder for script kiddies at the moment in my opinion.

Hereby, I made a video for the Ubuntu 12.10 with kernel 3.5.0-21 exploitation for your reference.



Reference :

National Vulnerability Database (NVD)
CX Security
SecurityFocus (with exploit source code)
Source code for 64-bit Ubuntu
Source code for 64-bit Fedora
Ubuntu 12.04 LTS Kernel image download
Ubuntu 12.10 Kernel image download

Please note that there is PPA for Ubuntu Kernel image out there and they may be not fixed, not kidding!

Updated on Mar 4, 2013 :

Latest learnt that the kernel version 2.6.x are also affected.

That's all! See you.

Sunday, February 24, 2013

REVIEW - ZOTAC ZBOX ID42 Mini PC Hardware Review

Specifications

CPU : Intel Celeron 847 Dual Core 1.1 GHz
GPU : nVidia GeForce GT610 with 512MB DDR3 (with 48 CUDA)
RAM : 2 x 204-pin DDR3 SO-DIMM slots (up to 16GB)
Ethernet : 2 X 1000Mbps (Realtek)
WiFi : Intel Wireless-N 135 (802.11n)
USB : 2 x USB 3.0 and 2 X USB 2.0
Audio : onboard, HDMI audio (bitstream)
Display : HDMI and DVI
Hard Drive : 2.5 inch HDD
Bluetooth : onboard

Operating System Support

Linux : Ubuntu 12.04 LTS (Server and Desktop)
Windows : Windows 7 and 8 Ready (not tested)

The box is running quiet smooth and fast on Ubuntu 12.04 LTS Server and Desktop. However, the area near the power slot is quiet hot compares with other areas of the box.

The ethernet and wireless as well as bluetooth are supported Ubuntu 12.04 LTS Server and Desktop out of the box.

The HDMI and audio of the box did not test during this review.

The size of the box is very slim and small compares with DIY ITX boxes. It is also lightweighted as the box classis is made by plastic.

Conclusion

This box is ideal for Linux Server and Desktop usage. However, the endurance of the box for Linux Server that running 24x7 is unknown. The price of the box is also attractive. Recommended.

That's all! See you.

Sunday, February 03, 2013

HOWTO : Wired router connected to wireless router with WDS

I have two identical TP-Link TL-WR1043ND routers and they are both flashed with DD-WRT (build 20548). I connect these two routers together with a wired router and the tutorial is here. The new setup is wired router to wireless router and then wireless router. The two wireless routers are act as WDS (Wireless Distribution System). The firmware of DD-WRT can be download here.

At the tab of "WDS" on each router, make sure they are set to "LAN" and set to other's MAC address. Select "Lazy WDS" for both routers and "Apply Settings".

Make sure all the wireless setting on the both routers are identical, such as channel and etc. Also make sure the security wireless setting are disabled on both routers at the moment. We will enable it later.

The wireless router that is connected to the wired router is A and the other wireless is named B. Make sure to disable the firewall at the router B which is not the one connected to the wired router.

On the router B (which is not connected to the wired router), set the Internet "Connection Type" to "Disabled". The "DHCP Type" is set to ""DHCP Forwarder". The "Local IP Address" is set to the same network (subnet) of the wired router but in a different IP address. The "Gateway" is set to the address of the router A that connected to the wired router. The "DHCP Server" is set to the address of wired router.

For example, wired router IP address is 192.168.0.1 and it is act as DHCP server. Router A address is 192.168.0.80 and the settings is same as the captioned link at the beginning of this article. Router B address is 192.168.0.90 and the gateway is set to 192.168.0.80 and the DHCP server address is set to 192.168.0.1.

Enable the wireless security setting on router B and then A. They should be identical too. Now, you can connect to the internet properly without problem.

That's all! See you.

Saturday, February 02, 2013

HOWTO : OwnCloud with Apache on Ubuntu Server 12.04 LTS

At the early beginning, I want to create an OwnCloud server (4.5.6) with Hiawatha (8.7) on Ubuntu Server (12.04). However, I encounted a lot of problems when making it working properly. The main problem is that I cannot make any changes through the OwnCloud web interface and the applications cannot be activated and deactivated.

However, OwnCloud with Apache on Ubuntu Server is not a bad idea indeed. Furthermore, OwnCloud is designed for Apache environment. So, let's go.

OwnCloud will use your whole hard drive capacity. Therefore, the server should be dedicated for the purpose. Consider to use hardware RAID 1, 5 or 6 if possible.

(A) Installation of Ubuntu Server

Install Ubuntu Server 12.04 LTS as usual. Make sure you choose OpenSSH server, LAMP server and Mail Server when ask. Make sure you write down the MySQL password and make it strong enough.

(B) Installation of OwnCloud

To make the work simple, I choose to install from the Ubuntu respository even it is an old version as I want it to install a lot of packages automatically. Later, I will install the latest version from OwnCloud respository.

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install owncloud


wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key
sudo apt-key add - < Release.key


sudo -i
echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/owncloud.list


Exit from root.

sudo apt-get update
sudo apt-get install owncloud


sudo chown -R www-data:www-data /var/www/owncloud/

(C) Configuration of Apache and .htaccess

sudo nano /etc/apache2/sites-enabled/000-default

Change all "AllowOverride" setting from "None" to "All".

And set "/var/www" or "/var/www/" to "/var/www/owncloud" or "/var/www/owncloud/" respectively.

sudo nano /var/www/owncloud/.htaccess

You can change the following values if necessary :

php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value memory_limit 512M


Append "AcceptPathInto On" at the end of the file. Then save and exit.


sudo a2enmod rewrite
sudo a2enmod fcgid
sudo a2enmod headers


sudo /etc/init.d/apache2 restart

*** Please also to Official Manual and Administrators Manual for detail.

(D) Installation of OwnCloud via Broswer

Open Firefox and point the url to OwnCloud (e.g. http://192.168.0.100).

OwnCloud will create an Admin account when you first access the web interface.

Enter your Admin User Name (OwnCloud will create for you).
Enter your Admin Password (OwnCloud will crate for you).

Click "Advance" button to select MySQL.
Enter MySQL Admin User Name (e.g. root).
Enter MySQL Admin Password (The password when you install Ubuntu Server and MySQL that you have entered).
Enter Database Name that you want to use for this server (e.g. owncloud).

Press "Enter".

Then, you can configure your OwnCloud server via browser.

*** Make sure to backup the /var/www/owncloud/config/config.php

(E) Installation of OwnCloud client for desktop

Go to the Offical site to download (http://owncloud.org/sync-clients/).

If Ubuntu Desktop user, you can install it via the respository. The installation is similar to OwnCloud Server.

Make sure to add the "/usr/bin/owncloud" to the "Application Startup Preference" in order to make it to launch on every system boot up.

(F) Installation of Fail2ban

sudo apt-get install fail2ban

Make sure the ssh setting is set to "true".

sudo nano /etc/fail2ban/jail.conf

(G) Installation of Suricata (Optional)

You can refer to this link to install IPS on your Ubuntu Server.

(H) Tunning of MySQL (Optional)

You can refer to the MySQL section for tunning the performance of MySQL.

(I) Secure your Ubuntu Server in a passive way (Optional)

You can refer to this link for securing your Ubuntu server in a passive way.

(J) Send mail to GMail via Postfix (Optional)

You can configure your Postfix mail server to sent mail via GMail. You can refer to this link for detail.

(K) Logwatch (Optional)

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install logwatch


Make changes to the logwatch configure file in order to tell her to send you a email report.

sudo nano /usr/share/logwatch/default.conf/logwatch.conf

Change the settings of the following lines.

Output = mail
Format = html
MailTo = samiux@gmail.com


(L) Secure Apache (Optional)

You can refer to this link to make your Apache more secure.

Remarks : I just found out that mod-security may problem for operating the OwnCloud. It should be disabled.

(M) SSL for Apache (Optional)

You can secure your connection with SSL (HTTPS) in Apache. You can refer to this link.

sudo a2enmod ssl
sudo a2ensite default-ssl
sudo nano /etc/apache2/sites-enabled/default-ssl


Make some change on the file.

(N) Apparmor for Aapche (Optional)

sudo apt-get install apparmor-profiles apparmor-utils

Copy the following in a file namely "usr.lib.apache2.mpm-prefork.apache2" and placed it at "/etc/apparmor.d/" :



sudo aa-enforce usr.lib.apache2.mpm-prefork.apache2

Remarks :

At this writing, users cannot upload a file that is larger than 2GB to the OwnCloud via the web interface for 64-bit system. However, the client sync program can do it. The bug has been filed.

If your server is behind Cloudflare, your maximum file size upload via web interface should be limited to 50MB and you should disable the caching feature in the Cloudflare too.

Reference :

Apparmor manual for Ubuntu

That's all! See you.