Proficient in the JavaScript attack framework: setting up the AttackAPI Environment (1)

Source: Internet
Author: User

Bkjia.com exclusive Article] Client Security has not attracted enough attention for many years, but now the situation has changed dramatically, and client security has become one of the focal points in the information security field. Web malware, AJAX worms, browser history cracking, logon detection, puppet control technology, network port scanning, browser hijacking, and other technologies are only part of the underground laboratory technology of security researchers, but it has already brought a huge impact.

When a type of security professional emerges and becomes a mainstream exploitation mechanism, suppliers and individuals begin to issue frameworks and automated tools to process tools and testing processes. Although vendors initially focused primarily on AJAX auditing tools, security researchers are more concerned with continuous system boundaries to explore the truth.

Due to various possible attack vectors, the Web Application Security Community has also established multiple frameworks to detect and exploit security vulnerabilities, so as to reveal various problems faced by the Web development community. This article introduces how to use AttackAPI in detail.

1. AttackAPI Overview

AttackAPI is a Web-based attack construction library that can be used in combination with PHP, JavaScript, and other client and server technologies. AttackAPI consists of dozens of modules with different functions. These modules can be used either in a browser or in a JavaScript interpreter, such as Mozilla Rhino. It aims to provide a simple and easy-to-use interface for exploits of vulnerabilities and is mainly used for testing and verification.

Before studying the AttackAPI subroutine, let's make some preparations. First, download the library and set up a test environment. We will develop most sample programs in this environment. To do this, we need to install and run the following applications:
Apache + PHP or AppServ, an HTTP server that supports PHP 4.x or an updated version)

Www.apache.org/
Www.php.net/
Www.appservnetwork.com/
Download the latest AttackAPI from GNUCITIZEN
Www.gnucitizen.org/projects/attackapi
Mozilla's Web browser Firefox
Www.getfirefox.com
Firefox extension Firebug, address: www.getfirebug.com/

Start the Apache HTTP Server and make sure it is running properly. There are many documents about this type of task on the Internet, so I will not repeat them here. Download the AttackAPI package from GNUCITIZEN and extract it to the root folder of the Web server. For example, if you are using AppServ, you can put these files in C: \ AppServ \ www \ attackapi.

Make sure that the running Firefox has installed Firebug. The reason for us to prepare these things without any effort is that they can leave us a lot of effort in the future. When we do this in the Firebug dynamic console, it is much easier than saving and opening random temporary files. Although we use Firefox here, the example here can still be used in other browsers, just make a slight modification.

After completing these initial settings, open Firefox and navigate from localhost to the AttackAPI folder, that is, http: // localhost/attackapi. The content shown in 1 is displayed.

Figure 1

From the file structure of AttackAPI to Build | Tests | firetest-interactive.htm, this file contains some of the elements we will use below. Because we do not make any changes to the HTML content of the opened page, open Firebug and adjust the console to extend it to the entire screen.
Make sure you are on the Console tab and enter the command: dir (AttackAPI ). If everything is normal, we will see the AttackAPI Document Object Model DOM in 2.

Figure 2

In the rest of this article, we will use the $ A object instead of the AttackAPI to access and call library objects and methods. $ A object is A standalone instance of AttackAPI and contains shortcuts for more accessible AttackAPI methods. AttackAPI is a highly structured library. As shown in figure 2, it is further divided into AttackAPI. core library core), AttackAPI. dom cross-browser method) and AttackAPI. utils method ). Using the above conventions, the complete path of the base64 encoding function of AttackAPI is $ A. encodeBase64. Is it very concise ?! This saves effort when you enter the code. So Laziness is one of the main motivations for promoting human progress.

Because we need to enter more code, we recommend that you use a larger command line. First, select the "larger command line" option from the "options" drop-down menu, as shown in figure 3.

Figure 3

The command line appears on the right of the window, as shown in:

Figure 4

Because we need to type a lot of code, it is inevitable that an input error occurs. Therefore, after opening a larger command line, the change will be faster and better.
Note that we can use the Load AttackAPI bookmarks to Load the AttackAPI to the selected page, especially when we need to develop exploitation programs for a site, but I don't want to use Firebug to modify the source code of the page or insert script labels. The bookmarklet can be downloaded from www.gnucitizen.org/projects/load-attackapi-bookmarklet. Now we start to study the client tracking function of AttackAPI.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.