Kamis, 22 Desember 2011

How to Install Easy Hosting Control Panel (EHCP) on Ubuntu

EHCP is a free and open source web hosting control panel. This guide will show you how to install it on Ubuntu server.

Check /etc/apt/sources.list. It should have the following line (replace oneiric with your version).

deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://archive.ubuntu.com/ubuntu/ oneiric main restricted
deb http://archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb-src

Read more How to Install Easy Hosting Control Panel (EHCP) on Ubuntu

How to Fix MTP USB Driver Error

MTP device is used by Samsung Kies application to connect to Samsung mobile phone through PC using USB cable.

This is how to setup your Android phone to use Samsung Kies:

Go to Setting => Application => Development, and then make sure USB Debugging is unchecked.
Connect your phone to PC using USB cable.
Turn on Samsung Kies and it will try connecting to the phone.

But the problem came when I connect my phone to the PC. Windows unable to install driver for MTP device. I tried

Read more How to Fix MTP USB Driver Error

How to Hack WD My Book Live

WD My Book Live is network storage installed with Debian Linux operating system. We can setup this device to be our web server at home. Here are the steps how I did it:

1. Activate SSH
Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.
2. Login to SSH
username: root
default password: welc0me
3. Backup the system and protect udev update
Backup system:
# dd if=/dev/sda bs=15728640 count=1 | bzip2 >

Read more How to Hack WD My Book Live

Selasa, 01 Maret 2011

Read / Write NTFS on Mac OSX

Open Disk Utility:
Applications => Utilities => Disk Utility

Right click partition, and click Information.
Take note the value on Universal Unique Identifier.

Open Terminal:
Applications => Utilities => Terminal

Edit /etc/fstab:
$ sudo nano /etc/fstab

Type in this line into /etc/fstab:
UUID= none ntfs rw

Save the file.
Reboot.

Jumat, 11 Februari 2011

Setup MRTG Squid on Ubuntu 10.10

Install MRTG, Apache2, Squid and SNMP
$ sudo apt-get install apache2 snmpd mrtg snmp-mibs-downloader squid

Configure SNMP

Backup /etc/snmp/snmpd.conf
$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

Create new /etc/snmp/snmpd.conf
$ sudo nano /etc/snmp/snmpd.conf

and key in these lines:
rocommunity  public
syslocation  "Bukit Batok"
syscontact  xxxxxx@yahoo.com
com2sec public localhost public
group public v1 public
group public v2c public
group public usm public
view all included .1
access public "" any noauth exact all none none

Edit /etc/default/snmpd:
$ sudo nano /etc/default/snmpd

and make sure it contains these lines:
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
SNMPDCOMPAT=yes


Configure Squid

Edit /etc/squid/squid.conf
$ sudo nano /etc/squid/squid.conf

and make sure these lines exist:
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all

Restart Squid:
$ sudo /usr/sbin/squid -k reconfigure


Configure MRTG

Create configuration file:
$ sudo cfgmaker --global 'WorkDir:/var/www/mrtg' --ifref=name --ifdesc=eth --global 'Options[_]: bits' --output /etc/mrtg.cfg  --snmp-options=:::::1 public@localhost

Edit /etc/mrtg.cfg and make sure these lines exist:
### Global Config Options
WorkDir: /var/www/mrtg
RunAsDaemon: yes
EnableIPv6: no
Options[_]: bits
LoadMIBS: /usr/share/snmp/mibs/SQUID.txt
### Squid Config
Target[proxy-hit]: cacheHttpHits&cacheServerRequests:public@localhost:3401
# If you are using Squid 2.6 or later, uncomment the following line
RouterName[proxy-hit]: cacheUniqName
MaxBytes[proxy-hit]: 100000
Title[proxy-hit]: HTTP Hits
PageTop[proxy-hit]: <H1>proxy Cache Statistics: HTTP Hits/Requests</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>saniya</TD></TR>
   <TR><TD>Maintainer:</TD><TD>kumkum</TD></TR>
   <TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
 </TABLE>
Suppress[proxy-hit]: y
LegendI[proxy-hit]:  HTTP hits
LegendO[proxy-hit]:  HTTP requests
Legend1[proxy-hit]:  HTTP hits
Legend2[proxy-hit]:  HTTP requests
YLegend[proxy-hit]: perminute
ShortLegend[proxy-hit]: req/min
Options[proxy-hit]: nopercent, perminute, dorelpercent, unknaszero

Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@localhost:3401
# If you are using Squid 2.6 or later, uncomment the following line
RouterName[proxy-srvkbinout]: cacheUniqName
MaxBytes[proxy-srvkbinout]: 76800
Title[proxy-srvkbinout]: Cache Server Traffic In/Out
PageTop[proxy-srvkbinout]: <H1>Cache Statistics: Server traffic volume (In/Out)</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>saniya</TD></TR>
   <TR><TD>Maintainer:</TD><TD>kumkum</TD></TR>
   <TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
 </TABLE>
Suppress[proxy-srvkbinout]: y
LegendI[proxy-srvkbinout]:  Traffic In
LegendO[proxy-srvkbinout]:  Traffic Out
Legend1[proxy-srvkbinout]:  Traffic In
Legend2[proxy-srvkbinout]:  Traffic Out
YLegend[proxy-srvkbinout]: per minute
ShortLegend[proxy-srvkbinout]: b/min
kMG[proxy-srvkbinout]: k,M,G,T
kilo[proxy-srvkbinout]: 1024
Options[proxy-srvkbinout]: nopercent, perminute, unknaszero

Create MRTG index file:
$ sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

Execute MRTG:
$ env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

MRTG will default graph the data every 5 minutes.
To change this interval into 10 minutes, add this line into mrtg.cfg:
Interval : 10

To view MRTG graphs, go to http://localhost/mrtg/

Rabu, 09 Februari 2011

Notes: Setup Ubuntu Web Hosting

This is my little note on web hosting setup.

- Install Ubuntu Server 10.10
- Setup static private IP address
- Install ehcp hosting control panel: ehcp.net
- Configure ehcp: add domain, add ftp user, modify ehcp dns template, modify external IP
- Upload website source code
- Import website database
- Install smbfs: apt-get install smbfs
- Create samba script
- Check .htaccess
- Check dl.php to follow .htaccess path
- Change file upload setting in php.ini:  upload_max_filesize = 200M
- Change file upload setting in php.ini:  post_max_size = 200M

- Setup cronjob

Samba Shell Script

Below is shell script to load Windows' folder share using Ubuntu 10.10:
--
#!/bin/bash
umount /var/www/vhosts/saniya/id-ebook.com/httpdocs/gudang
umount /var/www/vhosts/saniya/id-ebook.com/httpdocs/gudang2
mount.cifs \\\\ubuntu-pc\\z\\gudang /var/www/vhosts/saniya/id-ebook.com/httpdocs/gudang -o uid=www-data,gid=0,user=ubuntu,pass=xxx,rw
mount.cifs \\\\ubuntu-pc\\z\\gudang2 /var/www/vhosts/saniya/id-ebook.com/httpdocs/gudang2 -o uid=www-data,gid=0,user=ubuntu,pass=xxx,rw

Jumat, 21 Januari 2011

Teknik Menjebol Password Hotspot WEP

Hardware yg digunakan
- USB Wi-Fi adapter merk Linksys

Software yg digunakan
- Ubuntu 10.10
- Aircrack-ng
- Terminal / Konsole

TUTORIAL

Install aircrack-ng:

$ sudo apt-get install aircrack-ng

Pastikan USB Wi-Fi sudah tertancap di komputer.
Periksa interface wifi:

$ ifconfig

Misalnya nama interface adalah wlan0.
Non-aktifkan interface wifi wlan0:

$ airmon-ng stop wlan0
$ ifconfig wlan0 down
$ macchanger --mac 00:11:22:33:44:55 wlan0

Perintah macchanger ini optional, digunakan utk mengubah mac address adapter wifi (spoofing). Jika tidak ingin mengganti mac address, gunakan mac address asli adapter wifi.
Mac address wlan0 bisa dilihat dengan menjalankan perintah 'ifconfig'.

Setelah kita mengetahui mac address di atas, jalankan perintah utk mengubah status wifi menjadi monitor mode:

$ airmon-ng start wlan0

Kemudian akan muncul keluaran seperti berikut ini:

Interface Chipset Driver
wlan0 Intel 4965 a/b/g/n iwl4965 - [phy0]
(monitor mode enabled on mon0)

Untuk selanjutnya akan dipakai mon0 sebagai interface menggantikan wlan0.
Jalankan perintah berikut utk menampilkan daftar akses poin terdekat:

$ airodump-ng mon0














Yang perlu diperhatikan adalah kolom berikut,

BSSID = mac address akses poin target
PWR = kekuatan sinyal, semakin kecil nilainya semakin dekat jarak akses poin (sinyal kuat)
#Data = banyaknya lalu lintas data yg sedang terjadi
CH = channel yg digunakan
ENC = jenis enskripsi akses poin. pilih yg menggunakan WEP.
ESSID = nama akses poin
STATION = mac address komputer yg sedang terhubung

Selanjutnya kita akan memonitor lalu lintas data di salah satu akses poin.
Misalnya kita target akses poin "yoyo".
Buka aplikasi terminal / konsole, dan jalankan perintah monitor berikut:

$ airodump-ng -c 3 -w hasilmonitor --bssid 99:88:77:66:55:44 mon0







Parameter "-c 3" menunjukkan bahwa akses poin 99:88:77:66:55:44 menggunakan channel 3.
Parameter "-w hasilmonitor" menunjukkan nama file hasil rekaman data.

Biarkan terminal monitor ini berjalan.
Kita buka satu lagi terminal baru, untuk melakukan fake authenticate bssid.

$ aireplay-ng -1 0 -a 99:88:77:66:55:44 -h 00:11:22:33:44:55 -e yoyo mon0

Pastikan hasilnya berupa pesan Association successful.
Jika tidak sukses, ganti target akses poin yg lain.

Kemudian jalankan perintah berikut utk melakukan arp inject.

$ aireplay-ng -3 -b 99:88:77:66:55:44 -h 00:11:22:33:44:55 mon0

Arp inject ini bertujuan utk mempercepat lalu lintas data yg terjadi pada akses poin target, sehingga kita dapat mengumpulkan cukup banyak data yg akan kita crack nantinya.
Arp inject ini membuat paket baca/tulis yg sangat cepat yg memungkinkan komputer lain yg sedang terhubung ke akses poin tersebut tidak bisa melakukan akses internet (diskonek).
Jika arp inject ini dilakukan dengan frekuensi yg sering, bisa saja membuat pemilik akses poin curiga bahwa ada oknum yg sedang melakukan penyerangan.

Ada cara lain yg lebih sadis yaitu dengan cara deauth attack. Dengan menggunakan deauth attack, kita memaksa komputer yg sedang terhubung ke akses poin utk putus / diskonek. Dan jika suatu komputer terputus dari akses poin, maka komputer tersebut otomatis akan berusaha tersambung kembali dengan akses poinnya. Kegiatan putus-sambung yg berulang kali ini akan membuat lalu lintas data menjadi bertambah, yg bisa kita rekam di aplikasi monitor kita sebelumnya. Perintahnya:

$ aireplay-ng --deauth 0 -a aa:bb:cc:dd:ee:ff mon0

Mac address aa:bb:cc:dd:ee:ff adalah milik komputer client yg sedang terhubung ke akses poin. Mac address komputer client ini terlihat pada terminal saat kita menampilkan daftar akses poin, yaitu pada kolom STATION.

Data (dinamakan data IV = Initialization Vector) yg diperlukan utk melakukan crack keamanan WEP minimal berjumlah 10.000. Jika kolom #Data yg terlihat di terminal monitor sudah mencapai sekitar angka 10.000 (semakin banyak semakin akurat), kita sudah bisa hentikan proses monitoring data.

Kemudian kita lakukan crack file hasil monitor data tersebut.

$ aircrack-ng -b 99:88:77:66:55:44 hasilmonitor.cap

Kemudian akan muncul keluaran: KEY FOUND [ 5F:81:BD:13:1F ]

Kita gunakan hasil tersebut sebagai password WEP dengan menghilangkan tanda titik dua, sehingga menjadi: 5F81BD131F.







Kamis, 20 Januari 2011

Pad Number with Leading Zero in Javascript

The following function will pad number with leading zero(es).

function pad(number, length) {
   var str = '' + number;
   while (str.length < length) {
   str = '0' + str;
   }
   return str;
} 
 
Some code to test the function:

document.write(pad(1, 1) + '');
document.write(pad(1, 2) + '');
document.write(pad(15, 2) + '');
document.write(pad(1, 3) + '');
document.write(pad(15, 3) + '');
document.write(pad(155, 3) + '');
document.write(pad(1, 4) + '');
document.write(pad(1, 5) + ''); 
 
And the result output:

1
01
15
001
015
155
0001
00001

http://www.electrictoolbox.com/pad-number-zeroes-javascript/

Jumat, 14 Januari 2011

Login Multiple Yahoo Messenger



There's a registry hack to enable multiple login for Yahoo Messenger.

1. Start => Run => regedit
2. Go to HKEY_CURRENT_USER => Software => Yahoo => Pager => Test
3. On the right window, right click => New => DWORD => type in Plural
4. Type in decimal value: 1
5. Close registry and run multiple Yahoo Messenger login.