用Firefox來Hacking Web 2.0程序(圖)
互聯(lián)網(wǎng) 發(fā)布時間:2008-10-08 19:37:54 作者:佚名
我要評論
Introduction //簡介
AJAX and interactive web services form the backbone of “web 2.0” applications. This technological transformation brings about new challenges for security professionals.
This article looks at some of the methods, tools and tric
Figure 4. Capturing Ajax calls.
We can see several requests made by the browser using XHR. It has loaded the dojo AJAX framework from the server while simultaneously making a call to a resource on the server to fetch news articles.
http://example.com/ getnews.aspx?date=09262006
If we closely look at the code, we can see following function in JavaScript:
function getNews()
{
var http;
http = new XMLHttpRequest();
http.open("GET", " getnews.aspx?date=09262006", true);
http.onreadystatechange = function()
{
if (http.readyState == 4) {
var response = http.responseText;
document.getElementById('result').innerHTML = response;
}
}
http.send(null);
}
The preceding code makes an asynchronous call to the backend web server and asks for the resource getnews.aspx?date=09262006. The content of this page is placed at the ‘result’ id location in the resulting HTML page. This is clearly an Ajax call using the XHR object.
By analyzing the application in this format, we can identify vulnerable internal URLs, querystrings and POST requests as well. For example, again using the above case, the parameter “date” is vulnerable to an SQL injection attack.
Crawling challenges and browser simulation
An important reconnaissance tool when performing web application assessment is a web crawler. A web crawler crawls every single page and collects all HREFs (links). But what if these HREFs point to a JavaScript function that makes Ajax calls using the XHR object? The web crawler may miss this information altogether.
In many cases it becomes very difficult to simulate this environment. For example, here is a set of simple links:
go1
go2
go3
The “go1” link when clicked will execute the getMe() function. The code for getMe() function is as shown below. Note that this function may be implemented in a completely separate file.
function getMe()
{
var http;
http = new XMLHttpRequest();
http.open("GET", "hi.html", true);
http.onreadystatechange = function()
{
if (http.readyState == 4) {
var response = http.responseText;
document.getElementById('result').innerHTML = response;
}
}
http.send(null);
}
The preceding code makes a simple Ajax call to the hi.html resource on the server.
Is it possible to simulate this click using automation? Yes! Here is one approach using the Firefox plug-in Chickenfoot [ref 4] that provides JavaScript-based APIs and extends the programmable interface to the browser.
By using the Chickenfoot plugin, you can write simple JavaScript to automate browser behavior. With this methodology, simple tasks such as crawling web pages can be automated with ease. For example, the following simple script will “click” all anchors with onClick events. The advantage of this plug-in over traditional web crawlers is distinct: each of these onClick events makes backend XHR-based AJAX calls which may be missed by crawlers because crawlers try to parse JavaScript and collect possible links but cannot replace actual onClick events.
l=find('link')
for(i=0;i
You can load this script in the Chickenfoot console and run it as shown in Figure 5.
Figure 5. Simulating onClick AJAX call with chickenfoot.
This way, one can create JavaScript and assess AJAX-based applications from within the Firefox browser. There are several API calls [ref 5] that can be used in the chickenfoot plugin. A useful one is the “fetch” command to build a crawling utility.
Logic discovery & dissecting applications
To dissect client-side Ajax-based applications, one needs to go through each of the events very carefully in order to determine process logic. One way of determining the entire logic is to walk through each line of code. Often, each of these event calls process just a few functions from specific files only. Hence, one needs to use a technique to step through the relevant code that gets executed in a browser.
There are a few powerful debuggers for JavaScript that can be used to achieve the above objective. Firebug is one of them. Another one is venkman [ref 6]. We shall use Firebug again in our example.
Let’s take a simple example of a login process. The login.html page accepts a username and password from the end-user, as shown in Figure 6. Use the “inspect” feature of Firebug to determine the property of the form.
Figure 6. Form property inspection with Firebug.
After inspecting the form property, it is clear that a call is made to the “auth” function. We can now go to the debugger feature of Firebug as illustrated in Figure 7 and isolate internal logic for a particular event.
相關(guān)文章

什么是CC攻擊 判斷網(wǎng)站是否被CC攻擊并且如何防御CC攻擊
CC主要是用來攻擊頁面的,大家都有這樣的經(jīng)歷,就是在訪問論壇時,如果這個論壇比較大,訪問的人比較多,打開頁面的速度會比較慢,對不?!一般來說,訪問的人越多,論壇的頁2024-01-06
Windows系統(tǒng)安全風(fēng)險-本地NTLM重放提權(quán)
入侵者主要通過Potato程序攻擊擁有SYSTEM權(quán)限的端口偽造網(wǎng)絡(luò)身份認(rèn)證過程,利用NTLM重放機(jī)制騙取SYSTEM身份令牌,最終取得系統(tǒng)權(quán)限,該安全風(fēng)險微軟并不認(rèn)為存在漏洞,所以2021-04-15
這篇文章主要介紹了文件上傳漏洞全面滲透分析小結(jié),這里主要為大家分享一下防御方法,需要的朋友可以參考下2021-03-21- 這篇文章主要介紹了sql手工注入語句&SQL手工注入大全,需要的朋友可以參考下2017-09-06
- 這篇文章主要介紹了詳解Filezilla server 提權(quán),需要的朋友可以參考下2017-05-13
FileZilla Server 2008 x64 提權(quán)與防御方法
這篇文章主要介紹了FileZilla Server 2008 x64 提權(quán)與防御方法,需要的朋友可以參考下2017-05-13https加密也被破解 HEIST攻擊從加密數(shù)據(jù)獲取明文
不久之前我們說過關(guān)于http和https的區(qū)別,對于加密的https,我們一直認(rèn)為它是相對安全的,可今天要講的是,一種繞過HTTPS加密得到明文信息的web攻擊方式,不知道這消息對你2016-08-10iPhone和Mac也會被黑 一條iMessage密碼可能就被盜了
一直以來蘋果系統(tǒng)的安全性都是比安卓要高的,但是再安全的系統(tǒng)也免不了漏洞,蘋果也一樣。最近爆出的新漏洞,只需要接收一條多媒體信息或者iMessage就會導(dǎo)致用戶信息泄露。2016-07-27- 國家正在修正關(guān)于黑客方面的法律法規(guī),有一條震驚黑客圈的“世紀(jì)佳緣”起訴白帽黑客事件,深深的傷害了廣大黑客們的心,加上扎克伯格和特拉維斯·卡蘭尼克賬號被盜,于是黑2016-07-11
如何逆向破解HawkEye keylogger鍵盤記錄器進(jìn)入攻擊者郵箱
面對惡意郵件攻擊,我們就只能默默忍受被他攻擊,連自我保護(hù)能力都沒有談什么反抗?讓人痛快的是,如今有了解決辦法,逆向破解鍵盤記錄器,進(jìn)入攻擊者郵箱2016-07-06


