[Tutorial] Instalasi suhosin pada Backtrack

[Tutorial] Instalasi suhosin pada Backtrack

Berikut ini keterangan singkat dari situsnya

Suhosin is an advanced protection system for PHP installations. It was designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core. Suhosin comes in two independent parts, that can be used separately or in combination. The first part is a small patch against the PHP core, that implements a few low-level protections against bufferoverflows or format string vulnerabilities and the second part is a powerful PHP extension that implements all the other protections.

Unlike the PHP Hardening-Patch Suhosin is binary compatible to normal PHP installation, which means it is compatible to 3rd party binary extension like ZendOptimizer.

  1. Download hardened-php-signature-key

    $ wget http://www.hardened-php.net/hardened-php-signature-key.asc
  2. Import key nya kedalam keyring gpg
    $ gpg --import < hardened-php-signature-key.asc
    gpg: key 0A864AA1: public key "Hardened-PHP Signature Key" imported
    gpg: Total number processed: 1
    gpg:               imported: 1
  3. Download signature suhosin
    $ wget http://download.suhosin.org/suhosin-0.9.27.tgz.sig
  4. Verifikasi signature suhosinnya dengan menggunakan gpg
    $ gpg suhosin-0.9.27.tgz.sig
    gpg: Signature made Sat Aug 23 09:19:36 2008 UTC using DSA key ID 0A864AA1
    gpg: Good signature from "Hardened-PHP Signature Key"
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg:          There is no indication that the signature belongs to the owner.
    Primary key fingerprint: 066F A6D0 E57E 9936 9082  7E52 4439 14CC 0A86 4AA1
  5. Download source suhosin
    $ wget http://download.suhosin.org/suhosin-0.9.27.tgz
  6. Buat file md5 untuk source tersebut lalu simpan dengan nama suhosin.md5, isinya sebagai berikut:
    9aae02bc2d2bcf9b8bd97cd22f56a8b8  suhosin-0.9.27.tgz
  7. Verifikasi md5sum sourcenya dengan file “suhosin.md5″ tadi
    $ md5sum -c suhosin.md5 suhosin-0.9.27.tgz: OK
  8. Sekarang kita unpack sourcenya
    $ tar xzvf suhosin-0.9.27.tgz
  9. Lalu kita masuk ke direktori source yang sudah di-unpack
    $ cd suhosin-0.9.27
  10. Jalankan phpize
    $ phpize
    Configuring for:
    PHP Api Version:         20020918
    Zend Module Api No:      20020429
    Zend Extension Api No:   20050606
  11. Lalu configure, untuk mengetahui switch apa saja yang bisa digunakan, bisa dengan menambahkan argumen –help setelah perintah configure
    $ ./configure
  12. Lalu waktunya untuk build
    $ make
  13. Hasil kompilasi akan ditempatkan pada sub direktori modules
    $ ls modules/
    suhosin.la  suhosin.so*
  14. Pindahkan (copy/move) module suhosin.so ke direktori extension php misalnya
    $ sudo -s
    # mkdir /usr/local/lib/php/extensions
    # cp modules/suhosin.so /usr/local/lib/php/extensions/
  15. Edit file konfigurasi php (mis: /usr/local/lib/php.ini) untuk me-load modul suhosin
    extension_dir = "/usr/local/lib/php/extensions" extension=suhosin.so
  16. Restart apache (dengan cara yang sedikit kasar :p;)
    # apachectl restart
  17. Buat file test.php di document root server yang isinya :
    <?php phpinfo(); ?>
  18. Test suhosin dengan mengakses halaman test.php di browser
    http://localhost/test.php
  19. Maka akan tampak seperti ini jika suhosinnya sudah berjalan :

    PHP 4.4.4 Info ()

    PHP 4.4.4 Info ()

  20. Selanjutnya tinggal memasukkan konfigurasi suhosin pada file php.inisesuai dengan petunjuk yang ada di situs suhosin.
  21. Pengujian dilakukan pada backtrack2 dengan apache 1.3.3.7 dan php 4.4.4
tabs-top
bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top

5 Comments »

  1. avatar
    00:53:15 - November 9th, 2008: #1
    Moeghan says:

    Ini buat apaan kk?
    Bener bener kagak ngerti aku kk :D
    Emang dasar guoblok aku ini dari dulu gak ngerti2 :(

    comment-bottom
  2. avatar
    08:10:21 - November 9th, 2008: #2
    NitrouZ says:

    # Moeghan, Sudah ada pada deskripsi atas, untuk PHP Protection.

    comment-bottom
  3. avatar
    10:46:26 - November 10th, 2008: #3
    idiotnesia says:

    tetep aja no 1 kalau nulis kode php mesti hati2.

    comment-bottom
  4. avatar
    14:51:41 - December 1st, 2008: #4
    pecun says:

    dengan hormat,

    saya ada masalah mas,
    begini ya… saya masih awam masalah backtrack 3
    ehm2 * ngambil nafas panjang dulu *
    jadi kalo mau install backtrack di flashdisk gimana caranya ya mas,
    tapi bukan live cd dari fd, tapi nginstall backtracknya native di fd,
    trus gimana ngatur mbr sama lilo nya supaya dia baca di flashdisk tapi bukan sebagai live cd tapi full instalasa bt 3, dah saya coba kemaren pake fd yg 8 giga cuma ya belum berhasil,
    mohon penerangannya ya mas / om / tante

    terima kasih sebelumnya

    comment-bottom
  5. avatar
    17:35:55 - December 1st, 2008: #5
    drubicza says:

    #4: mohon maafkan saya yang masih pemula… ^:)^
    saya belum sempat mencoba berhubung fd yang saya miliki hanya yang 1 GB. kalau saya sudah punya fd yang memadai, akan saya coba dan kalau berhasil akan saya post di sini. mohon maaf atas segala kekurangan yang saya miliki sebagai pemula ini ^:)^

    comment-bottom

RSS feed for comments on this post. TrackBack URL

Leave a comment