Showing posts from 2013

Instal Oracle Java on Ubuntu

First, download java jdk newest version at: Link
Chose Linux tar packet, after download extract it and copy to opt folder (with root permision)
Rename jdk_x.x.x to java.
Add java to system:
#update-alternatives --install /usr/bin/java java /opt/java/jre/bin/java 1
#update-alternatives --set java /opt/java/jre/bin/java
Add javac to system:
#update-alternatives --install /usr/bin/javac javac /opt/java/bin/javac 1
#update-alternatives --set javac /opt/java/bin/javac

Thanks for reading
Security Research
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.

Update metasploit in Backtrack 5R3 (8/2013)

When i update metasploit, i got many errors. After fixed all, i wrote some solution:

If you get this error:

$ svn up Updating '.':

Authentication realm: =[ MSF must be updated via GitHub or a more recent msfupdate. See for more]=

Don`t answer any thing, do it:

  cd /opt/metasploist

  mv msf3 msf3_back

  rm -rf msf3

  git clone --depth=1 git:// msf3

After git metasploit, update it. Before update, you should change ruby path to 1.9.3 (default is 1.9.2)

     update-alternatives --install /usr/bin/ruby ruby /opt/metasploit/ruby/bin/ruby 400

     update-alternatives --config ruby

     Chose new ruby (/opt)

     cd /opt/metasploit/msf3

Update now:


If you get error with pg install: Edit: /opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux/rbconfig.rb


CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static"



Debug with PHP and XDebug

PHP with XDebug
I need one debugger for PHP IDE. So i chosed XDebug. I am using Wampp on Windows.
First, you must enable XDebugger.

Edit php.ini, add lines at bottom file:

Restart Wampp.
If you use Netbean IDE, you should config:

I like Netbean than Eclipse, because it is classic gui, my idea.
Debug now:

Thanks for reading
Security Research
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.

Install ArchLinux No script

Install Arch Linux

Download Arch Linux distro iso at:

Boot to Arch Linux, chose Arch Linux x86
Use cfdisk to create partion:
#cfdisk /dev/sda
Chose New to create new partion, next Chose Begin. Chose Bootable
Down arrow to chose other, continue chose create New. (make swap)
Chose Write, yes to confirm. Quit to exit
Format partion:
#mkfs.ext4 /dev/sda1
#mkswap /dev/sda2
#swapon /dev/sda2

Check internet connection:

Mount partion:
#mount /dev/sda1 /mnt
Edit mirror list:
#vi /etc/pacman.d/mirrorlist

## Arch Linux repository mirrorlist
## Sorted by mirror score from mirror status page
## Generated on 2012-XX-YY

## Vietnam Mirror
Server =$repo/os/$arch

Install base:
#pacstrap /mnt base base-devel
#pacstrap /mnt grub-bios

Create fstab:
#genfstab -p /mnt >> /mnt/etc/fstab

Chroot to new system:
#arch-chroot /mnt

Assign hostname
#vi /etc/hostname

Set timezone
#ln -s /usr/share/zoneinfo/Asia/Ho_Chi_…

Using GeoIP to query IP location database

First, download IP database:
Install Python pupi libs:
Extract, go to extracted folder and type: #python install

import pygeoip
import dns.resolver
import sys
import re

gi =pygeoip.GeoIP('GeoLiteCity.dat')

def name2ip(dnsname):
    answers = dns.resolver.query(dnsname, 'A')
    for rdata in answers:
           return rdata
def printRecord(tgt):
    rec =gi.record_by_name(tgt)
    city =rec['city']
    region =rec['region_name']
    country =rec['country_name']
    long =rec['longitude']
    lat =rec['latitude']
    print '[*] Target: ' +tgt
    print '[+] '+str(city)+', '+str(region)+', '+str(country)
    print '[+] Latitude: '+str(lat)+', Longitude: '+str(long)

str1 = sys.argv[1]
is_ip = re.match("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)…