Rabu, 25 Januari 2012

Audit Security Website dengan Nikto di Linux Ubuntu




Tutorial ini sudah banyak di Internet, saya tulis kembali dengan bahasa saya sendiri sebagai referensi pribadi saya.

Kali ini saya akan coba membahas bagaimana cara mudah untuk melakukan audit security website sedarhana dengan menggunakan Linux. Program yang dipakai adalah "nikto". Nikto ini merupakan program paling sederhana menurut saya.

Nikto ini adalah tools sederhana untuk melakukan scan terhadap vulnerability yang ada pada suatu website. Untuk pengguna Ubuntu atau keluarga linux Debian program nikto ini sudah ada di repository. Selain nikto banyak aplikasi yang lain di linux untuk melakukan audit security website, mungkin lain kali akan saya bahas juga.

Untuk melakukan instalasinya cukup mudah :

$ sudo apt-get install nikto

Atau bisa juga dilakukan instalasinya dari synaptic.

Misal target website yang akan dicek adalah www.example.com (hanya tester lokal)


$ nikto -h www.example.com


- Nikto v2.1.4
---------------------------------------------------------------------------
+ Target IP: 192.168.0.1
+ Target Hostname: example.com
+ Target Port: 80
+ Start Time: 2012-01-26 10:23:04
---------------------------------------------------------------------------
+ Server: Apache/2.2.12 (Ubuntu)
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Apache/2.2.12 appears to be outdated (current is at least Apache/2.2.17). Apache 1.3.42 (final release) and 2.0.64 are also current.
+ DEBUG HTTP verb may show server debugging information. See http://msdn.microsoft.com/en-us/library/e8z01xdh%28VS.80%29.aspx for details.
+ /config.php: PHP Config file may contain database IDs and passwords.
+ OSVDB-3268: /tmp/: Directory indexing found.
+ OSVDB-3092: /tmp/: This might be interesting...
+ OSVDB-3268: /images/: Directory indexing found.
+ OSVDB-3268: /images/?pattern=/etc/*&sort=name: Directory indexing found.
+ 6448 items checked: 812 error(s) and 7 item(s) reported on remote host
+ End Time: 2012-01-26 10:37:42 (878 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested



Dari output hasil yang diberikan oleh nikto tarhadap hasil scan yang diberikan untuk website www.example.com diatas terlihat sangat sederhana sekali :

+ Server: Apache/2.2.12 (Ubuntu)
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Apache/2.2.12 appears to be outdated (current is at least Apache/2.2.17). Apache 1.3.42 (final release) and 2.0.64 are also current.
+ DEBUG HTTP verb may show server debugging information. See http://msdn.microsoft.com/en-us/library/e8z01xdh%28VS.80%29.aspx for details.
+ /config.php: PHP Config file may contain database IDs and passwords.
+ OSVDB-3268: /tmp/: Directory indexing found.
+ OSVDB-3092: /tmp/: This might be interesting...
+ OSVDB-3268: /images/: Directory indexing found.
+ OSVDB-3268: /images/?pattern=/etc/*&sort=name: Directory indexing found.
+ 6448 items checked: 812 error(s) and 7 item(s) reported on remote host


Kita bisa melihat versi apache dan OS yang digunakan, begitu juga masih terlihat ada file config.php dan beberapa direktori yang masih dapat dilihat langsung dari browser seperti /tmp dan /images.

Dari hasil itu maka kita tinggal menutup semua innformasi atau celah seperti direktori tersebut agar tidak terlihat lagi jika dilakukan akses langsung via browser dengan melakukan beberapa konfigurasi di apache nya.

Referensi : http://sectools.org/tool/nikto/

Semoga bermanfaat juga untuk teman semua.


Dony Ramansyah
site : http://dony-ramansyah.bravehost.com
blog : dony-ramansyah.blogspot.com
email : dony.ramansyah[at]gmail.com
Registered linux user : ID 400171

Jumat, 13 Januari 2012

Repository Tambahan untuk Linux Centos - Extra Packages for Enterprise Linux (EPEL)




Linux Centos seperti yang kita ketahui memang tidak memiliki repository selengkap repository milik Ubuntu. Untuk teman-teman yang ingin mencari program atau file linux yang memang kebetulan tidak tersedia pada repository default milik linux Centos, maka dapat melakukan instalasi dari repository tambahan.

Repository tambahan dapat dilihat disini : http://fedoraproject.org/wiki/EPEL

Repository ini bisa digunakan untuk Redhat, Centos, maupun Fedora (saya belum coba di opensuse). Untuk memasang repository ini sangat mudah, kebetulan saya memakai Centos versi 6.

Pertama kali kita harus mendowload terlebih dahulu file repositorynya (sesuaikan dengan versi centos atau redhat yang digunakan) :

[root]# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
--2012-01-12 15:42:15-- http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Resolving download.fedoraproject.org... 2610:28:3090:3001:dead:beef:cafe:fed4, 66.35.62.166, 80.239.156.215, ...
Connecting to download.fedoraproject.org|2610:28:3090:3001:dead:beef:cafe:fed4|:80... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: http://epel.idrepo.or.id/epel/6/i386/epel-release-6-5.noarch.rpm [following]
--2012-01-12 15:42:17-- http://epel.idrepo.or.id/epel/6/i386/epel-release-6-5.noarch.rpm
Resolving epel.idrepo.or.id... 203.34.118.133, 203.34.118.132
Connecting to epel.idrepo.or.id|203.34.118.133|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14064 (14K) [application/x-redhat-package-manager]
Saving to: “epel-release-6-5.noarch.rpm”

100%[====================================================================================>] 14,064 --.-K/s in 0.009s

2012-01-12 15:42:17 (1.51 MB/s) - “epel-release-6-5.noarch.rpm” saved [14064/14064]


Setelah itu tinggal install file yang sudah di download tadi :

[root]# rpm -ivh epel-release-6-5.noarch.rpm
warning: epel-release-6-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]


Instalasi selesai. Setelah itu kita tinggal melakukan instalasi program atau file library yang memang tidak terdapat pada repository default milik Centos. Misalnya "php-mcrypt" yaitu salah satu modul php yang memang tidak terdapat pada repository default milik Centos.

Cara install nya silahkan menggunakan yum :


[root]# yum install php-mcrypt

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* epel: ftp.jaist.ac.jp
* extras: centos.biz.net.id
* updates: centos.biz.net.id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.3.3-1.el6 will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.3.3-1.el6.x86_64
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================
Installing:
php-mcrypt x86_64 5.3.3-1.el6 epel 18 k
Installing for dependencies:
libmcrypt x86_64 2.5.8-9.el6 epel 96 k

Transaction Summary
==============================================================================================================================
Install 2 Package(s)

Total download size: 114 k
Installed size: 326 k

Is this ok [y/N]: y
Downloading Packages:
http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm: [Errno 12] Timeout on http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
(1/2): libmcrypt-2.5.8-9.el6.x86_64.rpm | 96 kB 00:00
(2/2): php-mcrypt-5.3.3-1.el6.x86_64.rpm | 18 kB 00:00
------------------------------------------------------------------------------------------------------------------------------
Total 3.6 kB/s | 114 kB 00:31
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6)
Package: epel-release-6-5.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libmcrypt-2.5.8-9.el6.x86_64 1/2
Installing : php-mcrypt-5.3.3-1.el6.x86_64 2/2

Installed:
php-mcrypt.x86_64 0:5.3.3-1.el6

Dependency Installed:
libmcrypt.x86_64 0:2.5.8-9.el6

Complete!


Selesai. Mudah-mudahan bermanfaat juga untuk teman yang semua dan tulisan ini juga sebagai referensi pribadi saya.


Dony Ramansyah
site : http://dony-ramansyah.bravehost.com
blog : dony-ramansyah.blogspot.com
email : dony.ramansyah[at]gmail.com
Registered linux user : ID 400171

Selasa, 10 Januari 2012

Ebook Management dan Convert Ebook di Linux Ubuntu




Tentunnya teman semua sudah sangat familiar dengan format file epub yang digunakan untuk sebagai file format untuk ebook pada umumnya. Biasanya file ebook dengan extension epub ini banyak digunakan pada ebook reader yang beredar saat ini.

Untuk para pengguna Linux, terutama Ubuntu, disini kita dapat melakukan konversi file ebook dari file pdf ke file epub ini dengan menggunakan program yang tentunya gratis yaitu "Calibre".

Calibre ini program untuk management ebook dan bisa juga untuk melakukan konversi tipe file ebook pada umumnya. Calibre ini juga mendukung multi platform OS yang ada, bahkan ada juga yang portablenya loh...

Calibre ini memiliki kemampuan untuk :

- Library Management
- E-book conversion
- Syncing to e-book reader devices
- Downloading news from the web and converting it into e-book form
- Comprehensive e-book viewer
- Content server for online access to your book collection

Untuk lebih jelasnya bisa dilihat di : http://calibre-ebook.com/

Bagi pengguna Linux Ubuntu atau variannya dapat dengan mudah melakukan download dan instalasi untuk calibre ini, berikut langkahnya :

$ sudo apt-get install calibre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
calibre-bin libpodofo0.9.0 python-beautifulsoup python-cherrypy3 python-clientform python-cssutils python-cssutils-doc
python-django python-django-tagging python-dnspython python-encutils python-lxml python-mechanize python-pyparsing
python-routes python-webob
Suggested packages:
python-psycopg2 python-psycopg python-mysqldb python-flup python-sqlite python-yaml python-lxml-dbg python-paste
The following NEW packages will be installed:
calibre calibre-bin libpodofo0.9.0 python-beautifulsoup python-cherrypy3 python-clientform python-cssutils
python-cssutils-doc python-django python-django-tagging python-dnspython python-encutils python-lxml python-mechanize
python-pyparsing python-routes python-webob
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/21.4 MB of archives.
After this operation, 97.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package python-beautifulsoup.
(Reading database ... 236736 files and directories currently installed.)
Unpacking python-beautifulsoup (from .../python-beautifulsoup_3.2.0-2_all.deb) ...
Selecting previously deselected package python-cherrypy3.
Unpacking python-cherrypy3 (from .../python-cherrypy3_3.1.2-1_all.deb) ...
Selecting previously deselected package python-encutils.
Unpacking python-encutils (from .../python-encutils_0.9.8~a1-1_all.deb) ...
Selecting previously deselected package python-cssutils.
Unpacking python-cssutils (from .../python-cssutils_0.9.8~a1-1_all.deb) ...
Selecting previously deselected package python-cssutils-doc.
Unpacking python-cssutils-doc (from .../python-cssutils-doc_0.9.8~a1-1_all.deb) ...
Selecting previously deselected package python-django.
Unpacking python-django (from .../python-django_1.3-2ubuntu1.1_all.deb) ...
Selecting previously deselected package python-django-tagging.
Unpacking python-django-tagging (from .../python-django-tagging_0.3.1-1_all.deb) ...
Selecting previously deselected package python-dnspython.
Unpacking python-dnspython (from .../python-dnspython_1.9.4-0ubuntu2_all.deb) ...
Selecting previously deselected package python-lxml.
Unpacking python-lxml (from .../python-lxml_2.3-0.1build1_amd64.deb) ...
Selecting previously deselected package python-pyparsing.
Unpacking python-pyparsing (from .../python-pyparsing_1.5.2-2_all.deb) ...
Selecting previously deselected package python-routes.
Unpacking python-routes (from .../python-routes_1.12.3-1_all.deb) ...
Selecting previously deselected package python-clientform.
Unpacking python-clientform (from .../python-clientform_0.2.10-2.1_all.deb) ...
Selecting previously deselected package python-mechanize.
Unpacking python-mechanize (from .../python-mechanize_0.1.11-1.1_all.deb) ...
Selecting previously deselected package libpodofo0.9.0.
Unpacking libpodofo0.9.0 (from .../libpodofo0.9.0_0.9.0-1ubuntu2_amd64.deb) ...
Selecting previously deselected package calibre-bin.
Unpacking calibre-bin (from .../calibre-bin_0.8.8+dfsg-1ubuntu1_amd64.deb) ...
Selecting previously deselected package calibre.
Unpacking calibre (from .../calibre_0.8.8+dfsg-1ubuntu1_all.deb) ...
Selecting previously deselected package python-webob.
Unpacking python-webob (from .../python-webob_1.0.8-1_all.deb) ...
Processing triggers for doc-base ...
Processing 3 added doc-base files...
Registering documents with scrollkeeper...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Setting up python-beautifulsoup (3.2.0-2) ...
Setting up python-cherrypy3 (3.1.2-1) ...
Setting up python-encutils (0.9.8~a1-1) ...
Setting up python-cssutils (0.9.8~a1-1) ...
Setting up python-cssutils-doc (0.9.8~a1-1) ...
Setting up python-django (1.3-2ubuntu1.1) ...
Setting up python-django-tagging (0.3.1-1) ...
Setting up python-dnspython (1.9.4-0ubuntu2) ...
Setting up python-lxml (2.3-0.1build1) ...
Setting up python-pyparsing (1.5.2-2) ...
Setting up python-routes (1.12.3-1) ...
Setting up python-clientform (0.2.10-2.1) ...
Setting up libpodofo0.9.0 (0.9.0-1ubuntu2) ...
Setting up calibre-bin (0.8.8+dfsg-1ubuntu1) ...
Setting up python-webob (1.0.8-1) ...
Processing triggers for python-central ...
Setting up python-mechanize (0.1.11-1.1) ...
Processing triggers for python-central ...
Setting up calibre (0.8.8+dfsg-1ubuntu1) ...
Processing triggers for python-support ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place


Setelah selesai instalasi, tinggal dijalankan program calibre ini :



Untuk melakukan konversi file ebook, tinggal klik menu "Add books" untuk memilih dan memasukan file ebook sumber yang ingin dikonversi, setelah itu klik menu "Convert books"



Setelah itu tinggal menentukan tipe file ebook tujuan, misalnya file sumbernya adalah .pdf dan dan ingin dirubah menjadi file ebook .epub, Setelah itu klik "OK" untuk memulai proses konversi



Tinggal tunggu hingga prosesnya selesai. Untuk hasil file konversinya (.epub) akan ada di : /home/user/Calibre\ Library/

Setelah file epub nya jadi kita tinggal copy ke perangkat ebook reader yang digunakan dan selamat membaca.. :)


Dony Ramansyah
site : http://dony-ramansyah.bravehost.com
blog : dony-ramansyah.blogspot.com
email : dony.ramansyah[at]gmail.com
Registered linux user : ID 400171