博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Time-Based Blind NoSQL Injection
阅读量:2435 次
发布时间:2019-05-10

本文共 2733 字,大约阅读时间需要 9 分钟。

 
 
Time-Based Blind NoSQL Injection - Detecting server-side JavaScript injection vulnerabilitiesIn July 2011, Bryan Sullivan, a senior security researcher at Adobe Systems, demonstrated server-side JavaScript injection vulnerabilities in web applications using MongoDB and other NoSQL database engines. He demonstrated how they could be used to perform Denial of Service, File System, Remote Command Execution, and many other attacks, including the easy extraction of the entire contents of the NoSQL database -- a blind NoSQL injection attack (paper here at https://media.blackhat.com/bh-us-11/Sullivan/BH_US_11_Sullivan_Server_Side_WP.pdf). We not only confirmed the published data about the NoSQL injection vulnerabilities, but also discovered that the MongoDB shell supports a sleep() function which makes time-based detection possible of vulnerable web applications.It is also possible to inject a custom sleep code, a technique that may be used to spot injection vulnerabilities in web applications using server-side JavaScript execution. This is not restricted to MongoDB.Below you can find two examples of NoSQL injection vulnerabilities in PHP that could be spotted using these techniques.Example 1: NoSQL Injection Vulnerability in PHPThe following requests would make these (or similar) vulnerable web application sleep for 10 seconds:vulnerable.php?msg=1';sleep(10000);var%20foo='barThe MongoDB sleep() function works with milliseconds.Alternative technique using a custom sleep code:vulnerable.php?msg=1';var%20d%20=%20new%20Date();%20var%20cd%20=%20null;%20do%20{%20cd%20=%20new%20Date();%20}%20while(cd-d%20<%2010000);var%20foo='bar 
demo;$id = $_GET['id'];$js = "function() {var id = '$id';SOME CODE...}";$response = $db->execute($js);...?>Example 2: NoSQL Injection Vulnerability in PHP
demo;$year = $_GET['year'];$collection = $db->demo;$query = 'function() {var search_year = \'' .$year . '\';' .'return this.publicationYear == search_year || ' .' this.filmingYear == search_year || ' .' this.recordingYear == search_year;}';$cursor = $collection->find(array('$where' => $query));...?>Example 3: Sleep in JavaScriptvar date = new Date();var curDate = null;do { curDate = new Date(); }while(curDate-date < 10000); // delay time (ms)SolutionAlways validate user input used in server-side JavaScript commands.Article by Felipe Aragon. Originally published at http://www.syhunt.com/?n=Articles.NoSQLInjection---Copyright � 2010 Syhunt SecurityDisclaimer:The information in this article is provided "as is" withoutwarranty of any kind. Details provided are strictly foreducational and defensive purposes.Syhunt is not liable for any damages caused by direct orindirect use of the information provided by this article.

转载地址:http://qjhmb.baihongyu.com/

你可能感兴趣的文章
深度探索C++对象模型 ( 第四部分 )(转)
查看>>
MySQL中的SQL特征(转)
查看>>
使用JBuilder和WTK2.2搭建MIDP1.0和MIDP2.0开发环境(转)
查看>>
Symbian命名规则(翻译)(转)
查看>>
windows server 2003的设置使用(转)
查看>>
优化Win2000的NTFS系统(转)
查看>>
IE漏洞可使黑客轻易获取私人信息(转)
查看>>
脱机备份与恢复实战(转)
查看>>
WLINUX下的DNS服务器设置(转)
查看>>
游戏引擎剖析(二)(转)
查看>>
sms发mms C语言源码(转)
查看>>
窝CDMA网络中移动IP接入Internet(转)
查看>>
实现MMS增值业务的关键技术(转)
查看>>
Vista被破解 一个小程序可成功激活(转)
查看>>
SEO作弊常见方法和形式(转)
查看>>
蓝芽技术的原理和应用(2)(转)
查看>>
解决接通电源后自动开机问题(转)
查看>>
实例编程:用VC写个文件捆绑工具(转)
查看>>
教你如何用手工迅速剿灭QQ广告弹出木马(转)
查看>>
Windows系统维护完全图形化攻略(转)
查看>>