vzlist --a : melihat semua VPS vzctl start VPS_ID : start VPS. vzctl stop VPS_ID : stop (Shut Down) VPS. vzctl status VPS_ID : melihat status VPS. vzctl stop VPS_ID --fast : stop VPS secara cepat. vzctl enter VPS_ID : masuk VPS
OpenVZ Command
Mesin Lawas
Gak tau kenapa, kok akhir akhir ini kerja ngerasa jenuh dan sangat melelahkan, apa karena suasana yang kurang kondusif kali yah ?
iseng iseng, jadi kepengen tau ni komputer yang tiap hari aku pake. Selidik punya sidik ni komputer di beli skitar tahun 2000an, bisa di bilang udah 4-5 tahunan.
dan komputer ini satu-satunya yang pake Linux Full di kantor (debian etch)
iseng code :
uname -ar;hostname;cat /etc/issue;cat /proc/cpuinfo;lsusb;lspci;dmesg | grep -i memory;df -h
Iseng Result :
Linux thunderbox 2.6.18-6-686 #1 SMP Sat Dec 27 09:31:05 UTC 2008 i686 GNU/Linux
thunderbox
Debian GNU/Linux 4.0 \n \l
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 1
model name : Intel(R) Pentium(R) 4 CPU 1.70GHz
stepping : 2
cpu MHz : 1715.335
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm up
bogomips : 3433.88
Bus 004 Device 002: ID 07d1:3c03 D-Link System
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
00:00.0 Host bridge: Silicon Integrated Systems [SiS] SiS645 Host & Memory & AGP Controller (rev 02)
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP)
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS962 [MuTIOL Media IO] (rev 04)
00:02.1 SMBus: Silicon Integrated Systems [SiS] SiS961/2 SMBus Controller
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] AC'97 Sound Controller (rev a0)
00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.2 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)
00:09.0 Modem: PCTel Inc HSP MicroModem 56 (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation NV11 [GeForce2 MX/MX 400] (rev b2)
Memory: 1031816k/1048560k available (1543k kernel code, 16060k reserved, 578k data, 196k init, 131056k highmem)
Freeing initrd memory: 4391k freed
Freeing unused kernel memory: 196k freed
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 18G 9.7G 7.0G 59% /
tmpfs 507M 0 507M 0% /lib/init/rw
udev 10M 52K 10M 1% /dev
tmpfs 507M 0 507M 0% /dev/shm
/dev/hdd 366M 366M 0 100% /media/PHOTO SMAN 2
emil@thunderbox:~$
HeHeHeHe
ada komentar ?
How much memory is in this machine?
Solaris
1. dmesg | grep mem
2. prtdiag | grep Memory
3. prtconf -v | grep Memory
AIX
1. bootinfo -r
2. lsattr -E1 sys0 -a realmem
3. getconf REAL_MEMORY
HPUX
1. dmesg | grep Physical
2. /opt/ignite/bin/print_manifest | grep Memory
3. machinfo | grep Memory
Linux
1. dmesg | grep Memory
2. grep -i memtotal /proc/meminfo
3. free
OpenVMS
1. show mem /page
FreeBSD
1. dmesg | grep memory
2. grep memory /var/run/dmesg.boot
3. sysctl -a | grep mem
Create a tar archive from a directory
Since I started working with cPanel server I always needed to create archives from directories.
For example backing up a user’s home directory.
How can you do this? It’s not difficult at all. For exemple to backup a user home directory you would have to run:
tar -pczf rchive.tar.gz /home/USERNAME
You can read more about tar by reading it’s manual.
man tar
Install Rootkit Hunter
Rootkit Hunter adalah … Klik Disini Adja Dech
Langsung saja, masalah ini kita selesaikan secara Adat !! :
Pra-Installasi :
- Siapkan Komputer
- Rokok Sampoerna Mild
- Teh Kotak / Kopi
- XMMS biar lebih asyik dengerin music
BEGIN :
1. Login ke Shell server menggunakan akses Root
emil@thunderbox:~$ su Password:
2. Langkah selanjutnya COPAS adja dech :
wget http://transact.dl.sourceforge.net/sourceforge/rkhunter/rkhunter-1.3.2.tar.gz tar -xzvf rkhunter-1.3.2.tar.gz cd rkhunter-1.3.2 ./installer.sh --layout default --install vim /etc/cron.daily/rkhunter.sh
Masukin ini (COPAS maning)
#!/bin/bash (/usr/local/bin/rkhunter -c --cronjob 2>&1 | mail -s "Daily Rkhunter Scan Report" email@domain.com):
[Esc]:wq
Buat ngetest scan, berhasil atau tidak pada saat installasi
[sourcecode language='bash']chmod +x /etc/cron.daily/rkhunter.sh
Buat Update database rkhunter
rkhunter --update
Selamat Mencoba..!
1st Client Ask
Client pertama yang nanya, setelah Yahoo Status di pajang di PasarHosting
(10:41:13 PM) cs2_tunasindo: bos
(10:41:14 PM) cs2_tunasindo: malem
(10:41:16 PM) cs2_tunasindo: mau tanya nih'
(10:41:19 PM) cs2_tunasindo has buzzed you!
(10:41:30 PM) cs2_tunasindo: www.klikxxxxxx.com gak bisa dibuka kenapa yak
(10:41:32 PM) erahman2001: silahkan pak
(10:42:54 PM) erahman2001: terbuka dengan baik o pak
(10:43:06 PM) cs2_tunasindo: sebentar
(10:43:38 PM) cs2_tunasindo: kenapa disini gak bisa dibuka ya?
(10:43:47 PM) cs2_tunasindo: biasanya apanya tuh?
(10:44:04 PM) erahman2001: ada kemungkin salah masukin password lebih dari 3 kali
(10:44:19 PM) erahman2001: baik cpanel ato webmail pak
(10:44:25 PM) cs2_tunasindo: trus?
(10:44:31 PM) cs2_tunasindo: solusinya gimana dong
(10:44:31 PM) erahman2001: jadi kemungkinnan IP address nya di band
(10:44:42 PM) erahman2001: kalo boleh tau IP bapak berapa ?
(10:44:49 PM) cs2_tunasindo: IP yang mana?
(10:45:03 PM) erahman2001: ip internet nya yang bapak pakai sekarang ?
(10:45:08 PM) cs2_tunasindo: sebentar
(10:46:13 PM) cs2_tunasindo: 125.161.xxx.xxx
(10:47:11 PM) erahman2001: mohon tunggu sebentar pak >:D<
(10:47:23 PM) cs2_tunasindo: ok
(10:47:56 PM) erahman2001: oke pak
(10:48:16 PM) erahman2001: silahkan di resfresh web browser nya untuk www.klikxxxxxx.com
(10:48:21 PM) cs2_tunasindo: ok
(10:48:39 PM) cs2_tunasindo: siip
(10:48:46 PM) cs2_tunasindo: itu gimana ceritanya bos
(10:48:53 PM) cs2_tunasindo has buzzed you!
(10:49:02 PM) erahman2001: ach jangan panggil bos pak
(10:49:04 PM) erahman2001:
(10:49:12 PM) cs2_tunasindo: soalnya tadi mau edit
(10:49:29 PM) cs2_tunasindo: eh masuk cpanel lulpa user ama pass
(10:49:32 PM) cs2_tunasindo: gak sesuai
(10:49:40 PM) cs2_tunasindo: hehehe
(10:49:40 PM) erahman2001: begini dari IP yang bapak gunakan ada kemungkinnan salah masukkan password cpanel / webmail ato akses apapun ke server bentuk nya
(10:49:57 PM) erahman2001: ketika 3 x salah masukin password maka server akan ngeblock IP bapak
(10:50:32 PM) erahman2001: server menganggap IP tsb akan melakukan tindakan tindakan ilegal / hacking
(10:50:43 PM) cs2_tunasindo: oooo
(10:50:51 PM) erahman2001: demi keamanan server dan situs bapak .. jadi server memblock ip tsb
(10:51:16 PM) erahman2001: di khawatirkan ada yang berusaha menebak-nebak password
(10:51:27 PM) erahman2001: begitu pak >:D<
(10:51:32 PM) cs2_tunasindo: iya deh
(10:51:36 PM) erahman2001: silahkan di edit web nya pak
(10:51:55 PM) erahman2001: ada lagi yang bisa saya bantu pak >:D<
(10:52:12 PM) cs2_tunasindo: sementara itu dulu
(10:52:41 PM) erahman2001: terima kasih pak .. semoga sukses dengan klikxxxxxx.com
(10:53:15 PM) cs2_tunasindo: iya
(10:53:22 PM) cs2_tunasindo: tapi ini belum sukses mau ngeditnya ni
(10:53:36 PM) cs2_tunasindo: nyari orang yang dulu daftarin dulu
(10:53:57 PM) erahman2001: pastinya ada proses pak ..
(10:54:02 PM) erahman2001: <-- ikut mendoakan
My Task’s
Pe Er yang blom kelar :
- Melakukan koneksi VPN dari Server Colo ke Server ivas TELKOM (Windblow OS)
- Melakukan koneksi VPN dari kantor Bogor ke salah satu Kantor Client di JKT (biar bisa remote pc karyawan disana, and gak usah bulak balik lagi BGR-JKT terus buat maintenance)
- Install server buat Client di Tanjung Priuk
- Pelajari lebih jaun tentang installasi openSSL (https://) <– masih cupu disini HeHeHe..
- Research TCExam
- Apa lagi yah ? (om apa lagi …? HeHeHe )
Siapa Gwe..?? ( psyBNC Log )
<-psyBNC> You have Messages. Type /QUOTE PLAYPRIVATELOG to read your messages.
<-psyBNC> Starting playing Log
<-psyBNC> Sun Jul 13 06:08:26 :(guyh!~user@125.164.121.181) mas ajarin akun jd hecker bayarbrp?
<-psyBNC> Use ERASEPRIVATELOG to kill the log
ERASEPRIVATELOG
<-psyBNC> Log erased
HeHehe Siapa Gwe … Masih Cupu Gini …!! Sorry Om .. om bisa belajar ke yang lain adja .!!
MySQL Replication With Local and Hosting Server (WHM)
Basa basinya apa yah disini .. ??? mungkin sedikit catatan saja, apa yang sudah berhasil di oprek. intinya membuat replikasi database MySQL dari Server MySQL di Lokal (kantor) ke database MySQL Server Hosting di Alam Gaib sana.
[Informasi Saja]
Server Lokal (Kantor) = Master = 125.232.2x.xxx (Debian)
Server Hosting = Slave = 76.24.2x.xxx (Centos)
Database Name = cobadb
Database User = usercoba
Database Pass = rahasia123
MySQL Version Debian = mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
MySQL Version Centos = mysql Ver 14.12 Distrib 5.0.51a, for redhat-linux-gnu (i686) using readline 5.0
Login = root
Konfigurasi yang harus kita lakukan adalah :
————- Server Lokal (MASTER) : ————–
Edit file my.cnf :
root@thunderbox:~$ vim /etc/mysql/my.cnf
Pastikan pada bagian :
[mysqld]
...........
...........
# bind-address = 127.0.0.1
...........
...........
[Dan Seterusnya]
#
# * Logging and Replication
#
...........
...........
[Dan Seterusnya]
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = cobadb
Save :
:wq
Restart Service MySQL :
root@thunderbox:~$ /etc/init.d/mysql restart
Login ke MySQL Server dengan Login root :
root@thunderbox:~$ mysql -u root -p
Enter password:
Buat User dengan replication privileges:
mysql> GRANT REPLICATION SLAVE ON *.* TO 'usercoba'@'%' IDENTIFIED BY 'rahasia123';
mysql> FLUSH PRIVILEGES;
mysql> USE cobadb;
mysql> FLUSH TABLES WITH READ LOCK;
mysql> SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 | 98 | cobadb | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)mysql> QUIT;
*) Simpan-Catat informasi diatas, karena akan digunakan untuk konfigurasi pada MySQL Slave Server Langkah terakhir adalah Unlock table cobadb yang sebelumnya kita lock
root@thunderbox:~$ mysql -u root -p
Enter password:
mysql> UNLOCK TABLES;
mysql> QUIT;
— Now the configuration on the master is finished. On to the slave… —
Ini Proses Apa Yah..??!!
Iseng iseng .. cek, sambil nunggu jam pulang kerja
# ps -aux
aih aih .. ini seh jam pulang kerja bakalan telat lagi :
# ps aux|grep nobody
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
nobody 6003 0.0 0.2 3952 3556 ?? S 7:02AM 0:31.37 /bin/bash(perl)
……….
……….
[dan seterusnya]
Siaga Satu !!!!
Hehehe nah pertanyaan nya adalah kenapa dianggap mencurigakan? memang sih agak-agak susah untuk mengkatagorikan suato proses mencurigakan atau tidak soalnya perlu sedikit pengalaman dan sering baca-baca. Tapi yang pasti untuk kasus diatas gampang banget mengetahui kalau proses tersebut mencurigakan alasannya yaitu.
1. User nobody gak punya shell jadi dia gak di ijinin buat login (/bin/bash itu kan shell)
2. /bin/bash itu aplikasi mandiri sementara disini /bin/bash (perl) yang artinya dia itu perl yang di eksekusi seolah-oleh /bin/bash
Ok dari dua kemungkinan itu aja dulu kita udah ada gambaran untuk mencurigai proses dengan PID 6003 tersebut. Selanjutnya saya berusaha memastikan apakah betul-betul ilegal atau tidak dengan cara mengetikan ps axj dan berikut ini hasilnya
# ps axj|grep nobody
USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND
nobody 6003 1 6003 c83f5c40 0 S ?? 0:31.46 /bin/bash (perl)
nobody 17104 18172 18172 c5123900 0 S ?? 0:00.37 /usr/local/apache/bin/httpd -DSSL
nobody 19345 18172 18172 c5123900 0 S ?? 0:00.15 /usr/local/apache/bin/httpd -DSSL
……….
……….
[dan seterusnya]
Kemudian kita cari tahu ada di mana sih aplikasi yang sedang jalan ini
# lsof -a -d cwd -p 6003
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
perl 6003 nobody cwd VDIR 116,131072 1024 2 /
Nah lho koq di / (root) kan disana gak ada bash
katanya di /bin/
ok semakin terlihat kejanggalan proses tersebut dimana PPID nya 1
nah udah lah lengkap sudah kecurigaan nya sekarang mari kita mencari apa yang harus dicari.
# lsof -i -a -n -p 6003
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
perl 6003 nobody 3u IPv4 0xe5892a00 0t0 TCP *:sd (LISTEN)
Dari hasil lsof dengan option -i -a -n -p ketemu deh kalo ternyata dia juga membuka port dengan nama sd. hmmm sd apaan ya??? ya udah lah cari tau dulu sd itu apa dan port berapa.
# cat /etc/services |grep sd sd
9876/tcp #Session Director sd
9876/udp #Session Director
Nah nah ternyata port nya 9876 namanya Session Director sekarang kita test siapa tau dapet info lebih dari port tersebut.
# netstat -an |grep 9876
tcp4 0 0 *.9876 *.* LISTEN
Ketemu open port tcp4 port 9876 di semua IP yang ada di box sekarang kita coba port tersebut.
# telnet localhost 9876 T
rying 127.0.0.1…
Connected to 127.0.0.1.
Escape character is ‘^]’.
Sua senha:
Senha Incorreta!
Connection closed by foreign host.
Naaah ketemu ternyata ketika di test menggunakan telnet di langsung respon dengan Sua senha (artinya kira-kira Password Euy
dalam bahasa portugis) kemudian setelah dicoba ngetik sembarang text dia langsung keluar pesan Senha Incorreta! (password salah) dan close. Ya udah lah gpp toh cuman ngetes dowang yang pasti sekarang tau kalau kemungkinan aplikasi yang sedang jalan itu adalah bot atau shell (backdoor?) yang pasti ilegal.
Lanjut berhubung dengan lsof tidak ditemukan lokasi dari aplikasi asli yang sedang berjalan kemungkinan ini adalah bot hit and run yang biasa dipake ketika orang inject web (biasanya mambo). Dimana dia akan mendownload file kemudian menjalankan file tersebut dan kabur yang kemudian bikin pusing admin box karena file nya tidak ada tapi proses nya jalan terus.
Ya udah lah sekarang kita matiin dulu prosess nya biar server gak terlalu berat.
# kill -9 6003
Selanjutnya kita iseng-iseng mencari siapa tahu bisa ketemu file yang bisa dipakai untuk download atau mendapatkan shell access untuk user nobody. Karena sudah pasti kalau nobody bisa meng execute file ber extensi PHP dan ada yang namanya phpshell maka yang kita kejar sekarang adalah file PHP yang ada kata-kata wget didalam nya.
# cd /home find ./*/public_html/ -depth 1 -name “*.php” | xargs grep “wget”
dan berikut ini adalah salah satu contoh hasil dari proses diatas.
./xxeditedxx/public_html/samiyo.php:echo sr(15,”<strong>”.$lang[$language.'_text16'].$arrow.”</strong>”,”
<select name=”\”with\”"><option value=”\”wget\”">wget</option><option value=”\”fetch\”">fetch</option><option value=”\”lynx\”">lynx</option><option value=”\”links\”">links</option><option value=”\”curl\”">curl</option><option value=”\”GET\”">GET</option></select>
“.in(’hidden’,'dir’,0,$dir).ws(2).”<strong>”.$lang[$language.'_text17'].$arrow.”</strong>”.in(’text’,'rem_file’,78,’http://’));
Nah selanjutnya tinggal masuk ke folder tersebut dan hapus atau kalau mau sadis ya suspend aja deh account host-nya :P.
