Tuesday, September 10, 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.

Sunday, August 25, 2013

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 http://r-7.co/MSF-SVN for more]=

Don`t answer any thing, do it:



  cd /opt/metasploist

  mv msf3 msf3_back

  rm -rf msf3

  git clone --depth=1 git://github.com/rapid7/metasploit-framework 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:

     ./msfupte

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

 Change:

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

To:

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

 

Update again.

Congratulation !!!

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

Sunday, March 10, 2013

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:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

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.

Thursday, January 31, 2013

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:
#ping www.google.com.vn

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 = http://mirror-fpt-telecom.fpt.net/archlinux/$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
namhb.hbn.local

Set timezone
#ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

Edit /etc/locale.gen file:
Uncommnent en US

#locale-gen

Create linux environment:
#mkinitcpio -p linux

Create boot:
#grub-install /dev/sda
#grub-mkconfig -o /boot/grub/grub.cfg

Reboot to your archlinux

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

Wednesday, January 2, 2013

Using GeoIP to query IP location database

First, download IP database:
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Install Python pupi libs: http://pypi.python.org/pypi/pygeoip/
Extract, go to extracted folder and type: #python setup.py install

File geo.py:
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])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$", str1)
is_domain = re.match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", str1)

if is_ip:
    printRecord(str1)

if is_domain:
    ip = str(name2ip(str1))
    printRecord(ip)

Run it:
#python geo.py hacking.vn
------------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
Security Research
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.

Install Xposed Inspector and Frida on Genymotion

Today i had some work with android. So i need trace application. I found 2 nice tool can help me: Xposed Inspector and Frida. To setup ther...