SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
HOW TO SECURE YOUR

Author: Viska Agasi a.k.a vhyVizz

Contact: vizz91agasi@gmail.com

Home: http://www.facebook.com/vizkaaa & http://www.twitter.com/vhyVizz

History:

    -      Introduce
    -      Analysis The c0de
    -      Patching / securing
    -      Reference
    -      Great and Thanks



0x01: INTRODUCE

What is FCKEditor ? FCKEditor is a browser based WYSIWYG editor, which brings to the Web common
editing features found on desktop editing applications. It's fully accessible, semantics and standards
aware.



0x02: Analysis The c0de

Mungkin semua sudah pada mengenal dan mengetahui Jenis dan type kelemahan or lobang
keamanan pada web applikasi yg satu ini.. Ya, FCKeditor Memiliki Vulnerability atau kelemahan atau
bug pada session upload nya.



Vulnerability ini pertama sekali di temukan oleh rgod dari altalavista melalui tehnic RCE (Remote
Command Execution), Dan Belakangan lebih di populer kan oleh eidelweiss dan team security yg di
kenal dengan sebutan pentesters.ir dengan exploitasi remote file/ shell upload nya.
Letak kesalahan atau vulnerability c0de nya bias kita lihat pada configuration file nya:

        /filemanager/connectors/php/config.php

global $Config ;

// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure
that only authenticated users can access this file or use some kind of
session checking.
$Config['Enabled'] = true ; // <= 1

---

// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/userfiles/' ; // <= here is the path of
attacker file or shell backdoor will be placed.

// following setting enabled.
$Config['ForceSingleExtension'] = true ;                   //

$Config['AllowedExtensions']['File']    = array('7z', 'aiff', 'asf', 'avi',
'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid',
'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt',
'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf',
'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv',
'xls', 'xml', 'zip') ;   // <= 3




Seperti yg kita lihat Dengan konfigurasi default or standart seperti di atas , an attacker might be able
to upload arbitrary files containing malicious PHP code due to multiple file extensions isn't properly
checked. Dan vulnerability c0de lain dapat kita temukan pada file

        /filemanager/connectors/upload.php

*/

require('./config.php') ;
require('./util.php') ;
require('./io.php') ;
require('./commands.php') ;
require('./phpcompat.php') ;

function SendError( $number, $text )
{
SendUploadResults( $number, '', '', $text ) ;
}



// Check if this uploader has been enabled.
if ( !$Config['Enabled'] )
SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the
"editor/filemanager/connectors/php/config.php" file' ) ;

$sCommand = 'QuickUpload' ;

// The file type (from the QueryString, by default 'File').
$sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;

$sCurrentFolder = GetCurrentFolder() ;

// Is enabled the upload?
if ( ! IsAllowedCommand( $sCommand ) )
SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn't allowed' ) ;

// Check if it is an allowed type.
if ( !IsAllowedType( $sType ) )
SendUploadResults( 1, '', '', 'Invalid type specified' ) ;



FileUpload( $sType, $sCurrentFolder, $sCommand )

?>

Seperti yg kita lihat, tidak ada nya session yg mengharuskan kita untuk login or mempunyai access
untuk dapat melakukan upload file ke pada server.



Banyak cara yg bisa di lakukan untuk melakukan exploitasi dengan vulnerability ini.Salah satu nya
ialah FCKEditor Menyediakan sebuah file untuk melakukan test upload dan langsung menyimpan ke
dalam server tanpa melakukan verifikasi atau pengecekan jenis file yg di upload terlebih dahulu.

File yg saya maksud di sini ialah pada link berikut:

        /fckeditor/editor/filemanager/connectors/uploadtest.html

        /fckeditor/editor/filemanager/connectors/test.html
Seorang Attacker bisa langsung melakukan penetrasi dengan mengupload sebuah file baik itu sebuah
text atau file html dan tidak menutup kemungkinan untuk mengupload file image yg di ijinkan oleh
pengaturan $Config['AllowedExtensions']['File'].

Dan tanpa di sadari file images tersebut bisa berisikan file script shell php, Atau Para Attacker juga
bisa menggunakan Trick dengan mengupload sebuah file .htaccess terlebih dahulu untuk dapat
langsung mengupload file php seperti berikut:

<FilesMatch "_php.gif">
SetHandler application/x-httpd-php
</FilesMatch>



Banyak Cara lain yg bisa di lakukan untuk mengesekusi or mengexploitasi vulnerability pada FCKeditor
ini. Salah Satu nya yg sangat Familiar ilah dengan menggunakan Metode Remote Comment Execution
or Remote Shell Upload Yg Di popular kan oleh eidelweiss .

        http://www.exploit-db.com/exploits/12506

        http://www.exploit-db.com/exploits/12376/



0x03: Patching / Securing

Setelah Kita Menganalysis c0de or Vulnerability nya lantas pasti kita akan bertanya Bagaimana cara
Pengamanan nya ?

Yach, Pastinya Setiap Ada Kelemahan or lubang harus di perbaiki , di cegah atau pun di tambal (Bukan
Tambal Ban loch :D). Berikut Ada Beberapa Tips and Trick Bagaimana untuk Mencegah Vulnerability
Pada FCKEditor.

    1. Delete default uploader tester file on fckeditor

    /fckeditor/editor/filemanager/connectors/uploadtest.html

    /fckeditor/editor/filemanager/connectors/test.html

    2. Creat Session authentication or user session based auth at the top of your upload.php
       example:

        session_start();
        $level=$_SESSION['level'];
        if($level!="admin") { die();}
3. Change the c0de in configuration.php of your fckeditor file

global $Config ;

// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure
that only
//      authenticated users can access this file or use some kind of session
checking.
$Config['Enabled'] = true ; // <= 1 This one(Change to False)

Menjadi : $Config['Enabled'] = false ;



0x04: Reference

   -   www.google.com
   -   http://en.wikipedia.org/wiki/CKEditor
   -   http://www.exploit-db.com/exploits/12506
   -   http://www.exploit-db.com/exploits/17644/



0x05: Regards and Thanks

   -   Randy Arios a.k.a eidelweiss

   -   Devilzc0de Forum

Mais conteúdo relacionado

Destaque

Vandretur i usa til web
Vandretur i usa til webVandretur i usa til web
Vandretur i usa til webArneTN
 
Viatge de estudis a Andorra
Viatge de estudis a AndorraViatge de estudis a Andorra
Viatge de estudis a AndorraVanessaMiguel27
 
Kelas11 ipa smk_matematika_nugroho-soedyarto
Kelas11 ipa smk_matematika_nugroho-soedyartoKelas11 ipa smk_matematika_nugroho-soedyarto
Kelas11 ipa smk_matematika_nugroho-soedyartoArdiansyah Nurul
 
Working with excel
Working with excelWorking with excel
Working with excelLanti4
 
Rashomon essay
Rashomon essayRashomon essay
Rashomon essayJanniie
 
Presentación inicio de curso de Cálculo Diferencial
Presentación inicio de curso de Cálculo DiferencialPresentación inicio de curso de Cálculo Diferencial
Presentación inicio de curso de Cálculo DiferencialEmisael alarcon
 
Final project
Final projectFinal project
Final projectcd8840
 
VIP USA motorhome
VIP USA motorhomeVIP USA motorhome
VIP USA motorhomeArneTN
 

Destaque (12)

Vandretur i usa til web
Vandretur i usa til webVandretur i usa til web
Vandretur i usa til web
 
Viatge de estudis a Andorra
Viatge de estudis a AndorraViatge de estudis a Andorra
Viatge de estudis a Andorra
 
11 glosarium
11 glosarium11 glosarium
11 glosarium
 
Directions
DirectionsDirections
Directions
 
Company profile
Company profileCompany profile
Company profile
 
Kelas11 ipa smk_matematika_nugroho-soedyarto
Kelas11 ipa smk_matematika_nugroho-soedyartoKelas11 ipa smk_matematika_nugroho-soedyarto
Kelas11 ipa smk_matematika_nugroho-soedyarto
 
Story board pembuatan web
Story board pembuatan webStory board pembuatan web
Story board pembuatan web
 
Working with excel
Working with excelWorking with excel
Working with excel
 
Rashomon essay
Rashomon essayRashomon essay
Rashomon essay
 
Presentación inicio de curso de Cálculo Diferencial
Presentación inicio de curso de Cálculo DiferencialPresentación inicio de curso de Cálculo Diferencial
Presentación inicio de curso de Cálculo Diferencial
 
Final project
Final projectFinal project
Final project
 
VIP USA motorhome
VIP USA motorhomeVIP USA motorhome
VIP USA motorhome
 

Semelhante a SECURE YOUR FCKEditor

SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...
SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...
SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...Fitri Febriani
 
Squid proxy-server
Squid proxy-serverSquid proxy-server
Squid proxy-serverDwi Wahyudi
 
Step by step konfigurasi squid server dari berbagai kasus
Step by step konfigurasi squid server dari berbagai kasusStep by step konfigurasi squid server dari berbagai kasus
Step by step konfigurasi squid server dari berbagai kasusfilar
 
Supriyanto squidproxyserver
Supriyanto squidproxyserverSupriyanto squidproxyserver
Supriyanto squidproxyserverHARRY CHAN PUTRA
 
Squidproxyserver
SquidproxyserverSquidproxyserver
Squidproxyserverpuput51
 
Menciptakan Sertifikat SSL dengan OpenSSL
Menciptakan Sertifikat SSL dengan OpenSSLMenciptakan Sertifikat SSL dengan OpenSSL
Menciptakan Sertifikat SSL dengan OpenSSLMunir Putra
 
Wawan tutorial-zend-bagian-1-3
Wawan tutorial-zend-bagian-1-3Wawan tutorial-zend-bagian-1-3
Wawan tutorial-zend-bagian-1-3Haswi Haswi
 
Wordpress Security Optimization (Basic)
Wordpress Security Optimization (Basic)Wordpress Security Optimization (Basic)
Wordpress Security Optimization (Basic)Irvan R-ID
 
Investigasi Serangan Terhadap Website Pada Web Server Apache
Investigasi Serangan Terhadap Website Pada Web Server ApacheInvestigasi Serangan Terhadap Website Pada Web Server Apache
Investigasi Serangan Terhadap Website Pada Web Server ApacheMark Thalib
 
It menjaga keamanan sistem artikel
It menjaga keamanan sistem artikelIt menjaga keamanan sistem artikel
It menjaga keamanan sistem artikelFathoni Mahardika II
 
Bypass web security dengan menggunakan teknik XST (Cross Sites Tracing)
Bypass web security dengan menggunakan  teknik XST (Cross Sites Tracing)Bypass web security dengan menggunakan  teknik XST (Cross Sites Tracing)
Bypass web security dengan menggunakan teknik XST (Cross Sites Tracing)Mark Thalib
 
Mengamankan Aplikasi Java EE 6
Mengamankan Aplikasi Java EE 6Mengamankan Aplikasi Java EE 6
Mengamankan Aplikasi Java EE 6Bowo Prasetyo
 
Keamanan sistem informasi
Keamanan sistem informasiKeamanan sistem informasi
Keamanan sistem informasiwindi rohmaheny
 
Tips Keamanan Software OJS : Panduan Untuk Pemula
Tips Keamanan Software OJS : Panduan Untuk PemulaTips Keamanan Software OJS : Panduan Untuk Pemula
Tips Keamanan Software OJS : Panduan Untuk PemulaDwi Fajar Saputra
 
Laporan 6
Laporan 6Laporan 6
Laporan 6hudakds
 
Ragam hacking menggunakan google
Ragam hacking menggunakan googleRagam hacking menggunakan google
Ragam hacking menggunakan googleIndra Levyprawira
 

Semelhante a SECURE YOUR FCKEditor (20)

SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...
SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...
SIM, Fitri Febriani, Hapzi Ali, Keamanan Sistem Informasi, Universitas Mercu ...
 
Squid proxy-server
Squid proxy-serverSquid proxy-server
Squid proxy-server
 
Step by step konfigurasi squid server dari berbagai kasus
Step by step konfigurasi squid server dari berbagai kasusStep by step konfigurasi squid server dari berbagai kasus
Step by step konfigurasi squid server dari berbagai kasus
 
Supriyanto squidproxyserver
Supriyanto squidproxyserverSupriyanto squidproxyserver
Supriyanto squidproxyserver
 
Squidproxyserver
SquidproxyserverSquidproxyserver
Squidproxyserver
 
Menciptakan Sertifikat SSL dengan OpenSSL
Menciptakan Sertifikat SSL dengan OpenSSLMenciptakan Sertifikat SSL dengan OpenSSL
Menciptakan Sertifikat SSL dengan OpenSSL
 
Wawan tutorial-zend-bagian-1-3
Wawan tutorial-zend-bagian-1-3Wawan tutorial-zend-bagian-1-3
Wawan tutorial-zend-bagian-1-3
 
Wordpress Security Optimization (Basic)
Wordpress Security Optimization (Basic)Wordpress Security Optimization (Basic)
Wordpress Security Optimization (Basic)
 
FreeBSD Web Server
FreeBSD Web ServerFreeBSD Web Server
FreeBSD Web Server
 
Investigasi Serangan Terhadap Website Pada Web Server Apache
Investigasi Serangan Terhadap Website Pada Web Server ApacheInvestigasi Serangan Terhadap Website Pada Web Server Apache
Investigasi Serangan Terhadap Website Pada Web Server Apache
 
FreeBSD web-based MUA
FreeBSD web-based MUAFreeBSD web-based MUA
FreeBSD web-based MUA
 
It menjaga keamanan sistem artikel
It menjaga keamanan sistem artikelIt menjaga keamanan sistem artikel
It menjaga keamanan sistem artikel
 
Bypass web security dengan menggunakan teknik XST (Cross Sites Tracing)
Bypass web security dengan menggunakan  teknik XST (Cross Sites Tracing)Bypass web security dengan menggunakan  teknik XST (Cross Sites Tracing)
Bypass web security dengan menggunakan teknik XST (Cross Sites Tracing)
 
Mengamankan Aplikasi Java EE 6
Mengamankan Aplikasi Java EE 6Mengamankan Aplikasi Java EE 6
Mengamankan Aplikasi Java EE 6
 
Keamanan sistem informasi
Keamanan sistem informasiKeamanan sistem informasi
Keamanan sistem informasi
 
Tips Keamanan Software OJS : Panduan Untuk Pemula
Tips Keamanan Software OJS : Panduan Untuk PemulaTips Keamanan Software OJS : Panduan Untuk Pemula
Tips Keamanan Software OJS : Panduan Untuk Pemula
 
Laporan 6
Laporan 6Laporan 6
Laporan 6
 
FreeBSD Proxy Server
FreeBSD Proxy ServerFreeBSD Proxy Server
FreeBSD Proxy Server
 
Konfigurasi web server
Konfigurasi web serverKonfigurasi web server
Konfigurasi web server
 
Ragam hacking menggunakan google
Ragam hacking menggunakan googleRagam hacking menggunakan google
Ragam hacking menggunakan google
 

SECURE YOUR FCKEditor

  • 1. HOW TO SECURE YOUR Author: Viska Agasi a.k.a vhyVizz Contact: vizz91agasi@gmail.com Home: http://www.facebook.com/vizkaaa & http://www.twitter.com/vhyVizz History: - Introduce - Analysis The c0de - Patching / securing - Reference - Great and Thanks 0x01: INTRODUCE What is FCKEditor ? FCKEditor is a browser based WYSIWYG editor, which brings to the Web common editing features found on desktop editing applications. It's fully accessible, semantics and standards aware. 0x02: Analysis The c0de Mungkin semua sudah pada mengenal dan mengetahui Jenis dan type kelemahan or lobang keamanan pada web applikasi yg satu ini.. Ya, FCKeditor Memiliki Vulnerability atau kelemahan atau bug pada session upload nya. Vulnerability ini pertama sekali di temukan oleh rgod dari altalavista melalui tehnic RCE (Remote Command Execution), Dan Belakangan lebih di populer kan oleh eidelweiss dan team security yg di kenal dengan sebutan pentesters.ir dengan exploitasi remote file/ shell upload nya.
  • 2. Letak kesalahan atau vulnerability c0de nya bias kita lihat pada configuration file nya: /filemanager/connectors/php/config.php global $Config ; // SECURITY: You must explicitly enable this "connector". (Set it to "true"). // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only authenticated users can access this file or use some kind of session checking. $Config['Enabled'] = true ; // <= 1 --- // Path to user files relative to the document root. $Config['UserFilesPath'] = '/userfiles/' ; // <= here is the path of attacker file or shell backdoor will be placed. // following setting enabled. $Config['ForceSingleExtension'] = true ; // $Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ; // <= 3 Seperti yg kita lihat Dengan konfigurasi default or standart seperti di atas , an attacker might be able to upload arbitrary files containing malicious PHP code due to multiple file extensions isn't properly checked. Dan vulnerability c0de lain dapat kita temukan pada file /filemanager/connectors/upload.php */ require('./config.php') ; require('./util.php') ; require('./io.php') ; require('./commands.php') ; require('./phpcompat.php') ; function SendError( $number, $text ) {
  • 3. SendUploadResults( $number, '', '', $text ) ; } // Check if this uploader has been enabled. if ( !$Config['Enabled'] ) SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ; $sCommand = 'QuickUpload' ; // The file type (from the QueryString, by default 'File'). $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ; $sCurrentFolder = GetCurrentFolder() ; // Is enabled the upload? if ( ! IsAllowedCommand( $sCommand ) ) SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn't allowed' ) ; // Check if it is an allowed type. if ( !IsAllowedType( $sType ) ) SendUploadResults( 1, '', '', 'Invalid type specified' ) ; FileUpload( $sType, $sCurrentFolder, $sCommand ) ?> Seperti yg kita lihat, tidak ada nya session yg mengharuskan kita untuk login or mempunyai access untuk dapat melakukan upload file ke pada server. Banyak cara yg bisa di lakukan untuk melakukan exploitasi dengan vulnerability ini.Salah satu nya ialah FCKEditor Menyediakan sebuah file untuk melakukan test upload dan langsung menyimpan ke dalam server tanpa melakukan verifikasi atau pengecekan jenis file yg di upload terlebih dahulu. File yg saya maksud di sini ialah pada link berikut: /fckeditor/editor/filemanager/connectors/uploadtest.html /fckeditor/editor/filemanager/connectors/test.html
  • 4. Seorang Attacker bisa langsung melakukan penetrasi dengan mengupload sebuah file baik itu sebuah text atau file html dan tidak menutup kemungkinan untuk mengupload file image yg di ijinkan oleh pengaturan $Config['AllowedExtensions']['File']. Dan tanpa di sadari file images tersebut bisa berisikan file script shell php, Atau Para Attacker juga bisa menggunakan Trick dengan mengupload sebuah file .htaccess terlebih dahulu untuk dapat langsung mengupload file php seperti berikut: <FilesMatch "_php.gif"> SetHandler application/x-httpd-php </FilesMatch> Banyak Cara lain yg bisa di lakukan untuk mengesekusi or mengexploitasi vulnerability pada FCKeditor ini. Salah Satu nya yg sangat Familiar ilah dengan menggunakan Metode Remote Comment Execution or Remote Shell Upload Yg Di popular kan oleh eidelweiss . http://www.exploit-db.com/exploits/12506 http://www.exploit-db.com/exploits/12376/ 0x03: Patching / Securing Setelah Kita Menganalysis c0de or Vulnerability nya lantas pasti kita akan bertanya Bagaimana cara Pengamanan nya ? Yach, Pastinya Setiap Ada Kelemahan or lubang harus di perbaiki , di cegah atau pun di tambal (Bukan Tambal Ban loch :D). Berikut Ada Beberapa Tips and Trick Bagaimana untuk Mencegah Vulnerability Pada FCKEditor. 1. Delete default uploader tester file on fckeditor /fckeditor/editor/filemanager/connectors/uploadtest.html /fckeditor/editor/filemanager/connectors/test.html 2. Creat Session authentication or user session based auth at the top of your upload.php example: session_start(); $level=$_SESSION['level']; if($level!="admin") { die();}
  • 5. 3. Change the c0de in configuration.php of your fckeditor file global $Config ; // SECURITY: You must explicitly enable this "connector". (Set it to "true"). // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only // authenticated users can access this file or use some kind of session checking. $Config['Enabled'] = true ; // <= 1 This one(Change to False) Menjadi : $Config['Enabled'] = false ; 0x04: Reference - www.google.com - http://en.wikipedia.org/wiki/CKEditor - http://www.exploit-db.com/exploits/12506 - http://www.exploit-db.com/exploits/17644/ 0x05: Regards and Thanks - Randy Arios a.k.a eidelweiss - Devilzc0de Forum