Category Archives: Teknoblogia

PHP, Java, et al

Sekitar beberapa tahun yang lalu, saya menghadapi kenyataan bahwa saya harus mempelajari paling tidak sebuah web-programming language — sebuah bahasa pemrograman yang memungkinkan saya untuk membuat aplikasi-aplikasi berbasis web.

Pada saat itu pilihan saya jatuh ke PHP, karena mudah dipelajari, bisa develop aplikasi dengan cepat, tidak banyak menuntut resources komputer, dst. Dan alhamdulillah ternyata memang banyak manfaat yang saya dapatkan.

Namun akhir-akhir ini dengan semakin populernya PHP, berbagai kelemahannya juga semakin makin terasa. Seperti :

# Banyaknya security hole di berbagai aplikasi PHP – cukup mudah untuk coding aplikasi PHP yang penuh security hole.
# PHP sendiri tidak terlalu aman – ada proyek “hardened PHP”, ada bug di urldecode() sehingga bukannya mengamankan tetapi justru menjadi pintu masuk bagi cracker, PHP 4.3.9 ternyata juga masih banyak security hole-nya, dst
# PHP memang memungkinkan development aplikasi Web dengan cepat, tapi untuk melakukan development aplikasi Web dengan benar cukup membutuhkan waktu; pemisahan presentasi dengan logik perlu dibantu dengan tools seperti Smarty dkk, abstraksi database perlu dibantu dengan ADODB dkk, kurang terasa dorongan dari struktur bahasanya sendiri untuk memprogram dengan rapi (rada “hack-ish” 🙂 )dan aman.

Saya masih akan terus menggunakan PHP, namun sepertinya saya sudah harus mulai memikirkan alternatifnya dari sekarang.

Java masih tetap kurang menarik bagi saya karena kelihatannya learning curve-nya terlalu terjal / barrier to entry-nya terlalu tinggi (saya bisa coding PHP dari tidak tahu sama sekali dalam waktu 2-3 jam saja)

Enter Rails.

Rails adalah web-application framework berbasis Ruby, yang memungkinkan kita untuk develop aplikasi web secara terstruktur, dengan sangat cepat.

Dulu saya kira tidak akan mungkin bisa develop aplikasi web dengan “benar” dan tetap cepat, tapi, ternyata bisa dengan Rails
Saya tidak akan banyak komentar, cukup [ download demo ini ], dan saksikan sendiri kemampuan Rails — dari setup sampai jadi aplikasi blog hanya memakan waktu 10 menit…..

Satu lagi yang menarik adalah Ruby Gems, package management untuk Ruby. Kalau ini sudah terpasang, maka instalasi Rails cuma perlu satu baris perintah :
gem install rails

Dan update-nya juga mudah, tinggal ketik gem update, wow…. sangat berguna, misalnya untuk Rails, yang masih aktif dikembangkan sehingga sering muncul versi barunya; Anda tidak perlu upgrade Rails terus menerus secara manual.

Bagi pengguna Debian yang ingin mencoba memulai Rails dengan memasang Ruby, bisa merujuk kesini.

Selamat mencoba Ruby.

Blackberry

Barusan baca di detikcom, rupanya Indosat baru memperkenalkan Blackberry di Indonesia.

Saran saya kepada yang tertarik dengan ini – jangan.
Mengapa ?

  • Blackberry adalah teknologi yang proprietary : Anda akan terikat dengan vendor ybs, tidak ada kebebasan bagi Anda. Begitu Anda berkomitmen menggunakan Blackberry, maka Anda akan terpaksa menuruti apa saja yang dikehendaki oleh vendor.
  • Blackberry adalah teknologi yang bermasalah : Kalau RIM sampai kalah di pengadilan dan kena denda, coba tebak siapa yang akan ikut menanggungnya ? (yap, Anda sebagai customer)
  • Berbagai kelebihan Blackberry bisa ditawarkan oleh solusi email lainnya:
    • Handphone dengan keyboard: Ada Nokia 6820, Nokia communicator, Treo, Hitachi P1000, dst
    • Secure email : Ada berbagai email client yang bisa mengamankan transmisi email Anda dengan protokol SSL
    • Kompresi email : Bisa diimplementasi dengan memanfaatkan fasilitas extension di protokol SMTP.
    • Push email : Ada berbagai email client yang bisa otomatis memeriksa apakah ada email baru di server
    • dst

Saya sendiri bisa mengakses email saya dari mana saja dengan menggunakan Nokia 6820 dan Psion 5MX saya — tanpa perlu investasi server khusus dan membayar lisensi tambahan ke Blackberry.

Jadi, apa lagi insentif untuk menggunakan Blackberry ya ….. ?

PeerGuardian – false sense of security

I knew that using PeerGuardian only gives you false sense of security and will make you careless. However, some people will flame me to death if I ever dare criticise their favorite software.

Unfortunately, I was right:
Cease & Desist letter served to TV show downloader

So, be careful out there. Don’t think that you’re invincible just because you’re using a software – they can still be circumvented.

Forensic analysis

Backdoor pertama kali ketahuan dari hasil output ps -ef, nama proses r0nin

1. Bersihkan dulu server dari backdoor tersebut

  • Cari lokasi backdoor di hard disk : find / -name r0nin
  • Ketemu di /tmp, segera hapus : rm -f /tmp/r0nin*
  • Matikan proses di memory : kill -9 [pid_r0nin]

2. Cari rootkit
rootkit adalah software yang memungkinkan user biasa menjadi memiliki akses root. Karenanya, tentu saja, sangat berbahaya.
Saya memeriksa server saya dengan Rootkit Hunter dan chkrootkit

3. Bagaimana cara spammer masuk ke server:
Karena r0nin dijalankan sebagai user www-data, berarti masuknya melalui Apache. Jadi kita cari informasinya di log Apache :

  • Cari string “r0nin” : find /var/log/apache/ -print | xargs grep r0nin
  • Ketemu di /var/log/apache/error.log, ada hasil perintah-perintah yang dijalankan oleh si spammer. Mustinya di access.log juga ada – tapi, mungkin di-encode.
  • Kelihatan perintah-perintah tersebut dijalankan sekitar tanggal 14 Desember pukul 7 pagi, jadi kita search log Apache untuk entries pada waktu itu: find /home/sufehmi/web/logs/ -print | xargs grep “14/Dec/2004:07”

Ketemu, ternyata spammer tersebut masuk dengan menggunakan vulnerability di phpBB versi 2.0.11 ke bawah. Entry yang berkaitan adalah sbb :

/var/log/apache/agfp-access.log:200.158.9.218 – – [14/Dec/2004:07:20:40 -0600] “GET /forum//viewtopic.php?t=10&highlight=%252echr(47)%252echr(117)%252echr(115)%252echr(114)%252echr(47)%252echr(108)%252echr(111)%252echr(99)%252echr(97)%252echr(108)%252echr(47)%252echr(59)%252echr(108)%252echr(115)%252echr(32)%252echr(45)%252echr(108)%252echr(97)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252echr(95)%252echr(95)%252echr(59))%252e%2527 HTTP/1.1” 200 27315 “-” “Mozilla/3.0 (compatible; Indy Library)”

4. Setelah ketahuan biang keroknya, maka forum tersebut langsung di-non aktifkan, sambil menunggu proses upgrade-nya selesai.

5. Kesimpulan:
Walaupun r0nin sudah terpasang, namun tidak berdaya apa-apa karena r0nin melayani akses via port 1666 – sedangkan port tersebut diblokir oleh Firehol.

Case closed ? Belum, masih ada beberapa hal yang bisa dilakukan untuk memperkuat keamanan server ini. Silahkan comment kalau Anda bisa menebaknya 🙂

Hacked !

Pagi ini ketika sedang inspeksi rutin server, tidak sengaja terlihat ada program bernama “r0nin” yang sedang berjalan. Deg.. apaan tuh 🙂 googling sebentar, dan ternyata firasat saya benar, r0nin adalah backdoor.

Setelah diselidiki lebih lanjut, ternyata setelah saya meng-update semua software di server, termasuk instalasi-instalasi phpBB yang ada, kemudian saya memigrasikan situs AGFP ke server saya. Dan, yap, forum situs tersebut menggunakan phpBB versi baheula 🙂 duhhh.

Ironisnya, saya termasuk yang pertama mengingatkan kawan-kawan saya untuk update phpBB mereka ke versi 2.0.11 (dimana versi sebelumnya bisa ditembus via highlight exploit dengan mudah sekali)

Kelihatannya sih penjebolnya adalah spammer dari Brazil, yang pingin memanfaatkan server ini sebagai spambot 🙁
Tapi untung keburu ketahuan.

Yang menakjubkan, baru beberapa hari saja saya memindahkan situs AGFP ke server ini, sudah langsung ketemu forumnya yang rentan exploit tersebut oleh mereka.
Jadi bagi yang masih pakai versi phpBB lama, segera upgrade forum Anda !

Langkah-langkah investigasi yang saya lakukan akan saya posting sebentar lagi.

PC World sucks

There are reasons why people are putting PC World in the Hall of Shame along with AOL – and I’m finding it out, painfully, at the moment.

A friend of mine asked for help with his PC. He couldn’t get the drivers for it. It’s an Advent brand PC, which I found out later to be sold by PC World. Unfortunately, he’s lost his drivers CD, so I have to find the drivers online.

After a quick search, it’s clear that PC World wants you to call its Helpline – which is a premium phone number, which will cost you a lot. So I refused the temptation, and insisted on finding the drivers by myself.

pcservicecall.co.uk (on of PC World’s website) listed the manufacturer’s website as http://www.adventcomputers.co.uk/. Too easy ? Yep, the website is down. Nothing like a challenge to start your day.

Unfortunately, it went downhill from there.
The graphic card was quite easy, it’s a Radeon X300. But the motherboard and soundcard were the painful ones. And then there’s still one funny thing in device manager that I have no idea what it is.

At the moment I’m still sorting out this bloody thing.
So, again, just say no to PC World. They can make your life miserable (and you paid a lot for it!).

Firefox -vs- Internet Explorer

What most people doesn’t realise is that we’re talking about the battle to defend / conquer mainstream Internet here.

Imagine if Microsoft managed to dominate both the web browser and web server market. What’s going to happen ? Yes, they can define Internet “standards” all by their own, locking out alternatives and locking in their users in the same time.

Thankfully, Apache singlehandedly managed to avoid the webserver-domination scenario from happening.

Now Firefox has starting to reverse the Microsoft domination on the web-browser front. For our own sake, let’s hope they succeed before the next attempt from Microsoft arrived.

RedHat’s price

Among problems with RedHat is their price. It’s almost the same to its Windows counterparts !
I’ve had a hard time justifying some migrations to open-source because of the cost – my manager will become confused and asked me “what’s the difference with Windows then ?”.

You may ask, why not propose other/non-RedHat distros ? Well, in case you failed to notice, they’re a very recognised brand in corporate environment.

But this may change soon (rejoice!) – especially when it’s a behemoth as huge as Dell that’s complaining about it.
I hope this will finally kick some senses back to their sales department, and make them adjust their prices accordingly.

The Wiki Empire

I’ve been very impressed by Wikipedia, the free encyclopedia with vast amount of good quality contents. So imagine my surprise to find the list of all WikiMedia’s websites here:
Wiki Media Foundation: Our projects

Internet has renewed my belief to the goodness in human race. Grass root movements like these will enable and empower us to be and act as a single, human, race – regardless of nationality, religion, skin color, etc.
Let’s just hope it doesn’t get hijacked before it fully realize its full potential.

mod_security

mod_security is an Apache module which is designed to do things that a conventional firewall couldn’t – block application-level attacks.

While a firewall block attacks at packet level, most of them have port 80 opened to allow access to the webserver behind it. And with conventional firewall getting very good nowadays at doing its job, criminals have started to find that it can be very easy to breach your network using this route instead.

This is where mod_security come to your assistance.

It’s able to do quite a lot. For example, it’s able to filter user requests (based on your own rules), both POST and GET – protecting you from potential SQL injection, XSS, root traversal, and other attacks.
Those are already quite powerful, but there are more. It’s also makes it easy to make Apache runs chroot-ed, invoke virus scanner on uploaded files, limiting admin access based on IP address, detecting instrusions, stopping information leak – even disabling the famous FormMail from sending spam. Your creativity is pretty much the limit with it.

I can’t praise this thing enough. If you haven’t install it, I recommend you do, asap.

Further readings:
# Excellent introduction to mod_security
# chroot-ing Apache with mod_security
# ApacheSecurity.net – the website for Ivan’s (yet to be released) book, but already contains a few security tools which may be of interest to you
# HOWTO: installing mod_security on Debian stable

Psion 5MX –> infrared –> Nokia 6820 –> GPRS –> Internet

It was quite a struggle to get the setup above to work. It’s also quite scary because I don’t even know if 5MX is compatible with 6820, or if 6820 has modem functionality, etc.

But in the end, it works. You can find the instruction to get them to work here, mainly for my own future references, and also (hopefully) to benefit others in similar situation.

Note: I think it’s quite reasonable to assume that any Nokia phones newer than 6210 will be able to work with 5MX using this instruction. But, don’t bet your life on that statement.

Requirements:

The Steps:

  1. Go to Control Panel
  2. Select MODEMS > New
  3. Name: Nokia 6820
  4. Speed: 115200 baud
  5. Connect via: Infrared
  6. Fax class: Auto
  7. Options :
    (note: you’ll need to replace “mobile.o2.co.uk” with your mobile provider’s setting)
    • Loudspeaker: Never
    • Volume: Quiet
    • Pause time: 4 seconds
    • Init (reset) string: AT&F&K3
    • Data Init: AT+CGDCONT=,”IP”,”mobile.o2.co.uk”
    • Fax init. string: Blank
    • Flow control: Hardware (RTS/CTS)
    • Terminal detect (DSR/DTR): Ticked
    • Carrier detect (DCD): Unticked
    • Modem type: Mobile
  8. Click OK
  9. Back to Control Panel, open “Internet” settings:
  10. Click New
  11. Based on “Standard Settings” :
    • Name: My Internet
    • Connection type: Dial-up
    • Use smart dialling: Not ticked
    • Standard dial-up number: *99#
  12. ACCOUNT:
    (note: you’ll need to replace username & password with your mobile provider’s settings)
    • Manual login: Not ticked
    • Username: web
    • Password: password
  13. ADDRESSES:
    (note: you’ll need to replace both DNS addresses with your mobile provider’s settings)
    • Get IP adddress from server: Ticked
    • Get DNS addresses: Unticked
    • Primary DNS address: 193.113.200.200
    • Secondary DNS address: 193.113.200.201
  14. LOGIN:
    • Use login script: Not ticked
  15. ADVANCED:
    • Enable PPP extensions: Ticked
    • Allow plain text authentication: Ticked
    • Use call back: Not ticked
  16. CLICK “DONE”
  17. Open “Message”
  18. Menu > Tools > Add New Account > Email
  19. Complete all fields in order to access your POP3 email
  20. FINISHED with set-up!

Again, please note that the settings above works if you’re a subscriber of O2 mobile phone network in UK only !
You’ll need to adjust some settings above to follow the settings from your own mobile phone provider. An example of such settings can be viewed here.

Now, to actually use the email or internet:

  • Activate infrared on the mobile
  • Activate GPRS on the mobile
  • Point at the infrared port of Psion 5MX
  • Open Message
  • Open Mailbox, and select an account
  • A new window appears “Connect to internet” – click OK
  • If you’re downloading email, ALWAYS Close mailbox before disconnecting from the Internet to avoid login problems on subsequent sessions.

Enjoy.

Credits:
www.pdastreet.com
www.howardforums.com
www.mgmcc.plus.com/Uk_apn.htm

Psion 5MX

In anticipation to my return to Indonesia, where I expect I’ll be mobile / on the road most of the time at the day, I just bought a Psion 5MX to enable me to work anywhere.

The reasons:

  1. It’s way lighter and easier to bring around than a laptop
  2. While small in size, the keyboard is still convenient and speedy to use
  3. It’s able to connect to Internet, and browse/email/etc.
  4. There are a LOT of applications available for it
  5. You can run Linux on it – and it’s Debian-based too. (minimizing the need to compile software, which means longer CF card life)
  6. It runs Linux without destroying what’s already on it – a small program will cause it to boot from the CF card, which has Linux installed in it
  7. It’s a bargain (most especially when you compare it to laptop price 🙂 ) at about 100 poundsterling
  8. It’s a very convenient voice recorder – it has dedicated buttons for this feature, so you can record straight away without having to open it first. It’s very important for me because I’m very forgetful 🙂 I really hate it when I forgot brilliant ideas because I wasn’t able to record it when it occurs. I almost bought separate device for this – lucky for me, 5MX can do this too.
  9. It uses 2 x AA batteries, not some weird proprietary battery. So when it runs out of power, I just need to buy AA batteries – which is available pretty much everywhere.
  10. The Psion community is amazing – you can find the solution for your problem on Google quite easily. Or when you need to ask questions, the community is very helpful

This afternoon, I’ve managed to get it to access the Internet via Nokia 6820 :
Internet — GPRS — Nokia 6820 — infrared — Psion 5MX

It was quite a struggle to get it connected for the first time, but now it’s rock solid.
Sweet.

Someone probably will argue that it’ll be more convenient to connect via Bluetooth (and use different PDA), why do you use such antiquated thing, and so on.
However, I’ve yet to find any other PDA with the features listed above, so it’s Psion 5MX for me at the moment then. Do feel free to let me know if you find anything else that can beat that feature list.

Windows: swap file optimization

5 years in writing (see bottom of page), ARP has now released the latest version of their Virtual Memory Optimization Guide (version 4.1)

Since hard disk is WAY slower than RAM, increasing virtual memory / swap performance will always give you instant increase in overall system performance.

Of particular interest would be movingswap file to outer tracks (max 200% performance gain), create multiple swap file on different hard disks (just make sure to read this as well), and stopping Windows from paging itself to disk.

A recommended read.

Spyware

People are still busy with spyware; sure it is a problem. But reading their recommendations on combating the problem does make you wonder a bit.

If you have a good firewall, use Firefox instead of Internet Exploder, doesn’t install dubious software (read: kazaa, morpheus) – then you can be quite sure that your PC will be free from Spyware.

Alternatively, use Linux 🙂

Rapat dengan netproject

Pagi ini tiba di kantor, dan tiba-tiba ditegur teman, “are you coming to this OpenLDAP meeting ?”. Hm, perasaan meeting hari ini soal desktop linux deh, tapi oh well, why not.

Ternyata benar 🙂 bukan soal OpenLDAP, tapi pengenalan soal Open Source dan Open Desktop oleh netproject. netproject adalah perusahaan konsultansi yang menjadi terkenal ketika Microsoft kebakaran jenggot karena Newham City Council hampir pindah dari solusi Microsoft ke solusi open source berkat rekomendasi dari netproject. netproject juga membuat laporan untuk European Union soal cara migrasi ke solusi open source.

Eddie Bleasdale, direktur netproject, memimpin langsung rapat tersebut. Berikut adalah beberapa hal yang menarik dari rapat ini:

  1. Proposal paten software di EU (European Union) ternyata adalah karena tekanan keras dari pemerintah Amerika 🙁 dasar teroris.
  2. Kasus migrasi open source di Munich – ternyata keputusan migrasi tersebut berdasarkan hal yang politis, not based on good business/technical case. Menurut Eddie, saat ini mulai terdengar beberapa masalah dengan implementasi pada proyek ini. Duh, mudah-mudahan mereka tetap berhasil deh…
  3. pak Eddie pernah sekali memberikan presentasi mengenai open source ke para manager marketing Oracle se-Eropa; dan mereka semua sepakat bahwa MySQL (bukan DB2, bukan juga MS-SQL) adalah ancaman nomor #1 bagi Oracle

Cukup menarik….

Juga ada beberapa hal yang menarik yang lainnya, tapi sayang belum bisa saya beberkan sekarang. Mudah-mudahan dalam waktu yang tidak terlalu lama lagi deh.