baner

Cơ sở dữ liệu nâng cao

Cơ sở dữ liệu nâng cao, Advanced Database.

Khai phá dữ liệu

Khai phá dữ liệu.

An Toàn Thông Tin

An Toàn Thông Tin

Trí tuệ nhân tạo

Trí tuệ nhân tạo.

Bảo Mật Thông Tin

Bảo Mật Thông Tin

Thứ Tư, 1 tháng 1, 2014

Burp Suite Walkthrough

Burp Suite is one of the best tools available for web application testing. Its wide variety of features helps us perform various tasks, from intercepting a request and modifying it on the fly, to scanning a web application for vulnerabilities, to brute forcing login forms, to performing a check for the randomness of session tokens and many other functions. In this article we will be doing a complete walkthrough of Burp Suite discussing all its major features.
Burp Suite (free edition) is available by default in Backtrack 5. The professional edition can be downloaded from here. Some of the features that are not available in the free edition are Burp Scanner, Task Scheduler, Target Analyzer, etc. Overall it has the following features.
1) Proxy - Burp Suite comes with a proxy, which runs on port 8080 by default. Using this proxy, we can intercept and modify the traffic as it flows from the client system to the web application. In order to use this proxy, we have to configure our browser to use this proxy. We can also drop the packets if we want so that they do not reach their intended destination, or redirect the traffic to a particular host, etc.
2) Spider - The spider feature of Burp Suite is used to crawl web applications looking for new links, content, etc. It automatically submits login forms (through user defined input) in case it finds any, and looks for new content from the responses. This information can then be sent to the Burp Scanner to perform a detailed scan on all the links and content provided by the spider.
3) Scanner - It is used to scan web applications for vulnerabilities. The type of scanning can be passive, active or user-directed. Some false positives might occur during the tests. It is important to remember that no automated scanner is 100 percent accurate in its results. Unfortunately Burp Scanner is not available with the free edition that is included in Backtrack 5.
4) Intruder - This feature can be used for various purposes like exploiting vulnerabilities, fuzzing web applications, carrying out brute force attacks etc.
5) Repeater - This feature is used to modify and send the same request a number of times and analyze the responses in all those different cases.
6) Sequencer - This feature is mainly used to check the randomness of session tokens provided by the web application. It performs various advanced tests to figure this out.
7) Decoder - This feature can be used to decode data to get back the original form, or to encode and encrypt data.
8) Comparer - This feature is used to perform a comparison between any two requests, responses or any other form of data. This feature could be useful when comparing the responses with different inputs.

1) Proxy

The proxy feature allows us to intercept and modify requests. In order to intercept the requests and manipulate them, we must configure our browser to direct its traffic through Burp’s proxy, which is 127.0.0.1:8080 by default.
Want to learn more?? The InfoSec Institute Web Application Penetration Testing Boot Camp focuses on preparing you for the real world of Web App Pen Testing through extensive lab exercises, thought provoking lectures led by an expert instructor. We review of the entire body of knowledge as it pertains to web application pen testing through a high-energy seminar approach.

The Web Application Penetration Testing course from InfoSec Institute is a totally hands-on learning experience. From the first day to the last day, you will learn the ins and outs of Web App Pen Testing by attending thought provoking lectures led by an expert instructor. Every lecture is directly followed up by a comprehensive lab exercise (we also set up and provide lab workstations so you don't waste valuable class time installing tools and apps). Benefits to you are:

  • Get CWAPT Certified
  • Learn the Secrets of Web App Pen Testing in a totally hands-on classroom environment
  • Learn how to exploit and defend real-world web apps: not just silly sample code
  • Complete the 83 Step "Web App Pen Test Methodology", and bring a copy back to work with you
  • Learn how perform OWASP Top 10 Assessments: for PCI DSS compliance

Once this is done, open up Burp Suite. Go to Proxy, then Intercept and make sure Intercept is on.

Go to the alerts tab, we can see that a proxy service is running on port 8080. We can also change this configuration by going to the options tab under proxy.

Let’s have a look at all the options we have while running the proxy. Go to the options tab under proxy.

Here we can edit the port the proxy is listening on, and even add a new proxy listener. Burp also has option of presenting certificates to SSL protected websites. By default, Burp creates a self-signed CA certificate upon installation. The current checked option, i.e generate CA-signed per-host certificates will generate a certificate for the particular host we are connecting to signed by Burp’s CA certificate. The only thing with which we are concerned here is to decrease the number of warnings which a user gets when connecting to a SSL protected website.
If we don’t check the listen in loopback interface only option then this means that the burp proxy can serve as a proxy for other systems on the network too. This means any computer in the same network can use this Burp proxy as a proxy and relay its traffic through it.
The support invisible proxying for non-proxy-aware client option is used for clients that do not know that they are using a proxy. This means that the option for proxy is not set in the browser, but somewhere else, e.g., in the hosts.txt file. The only issue with this is that the request in this case will be a bit different than the requests when the proxy option is set in the browser itself, and hence Burp needs to know if it is receiving traffic from a non-proxy aware client. The redirect to host, redirect to port option will redirect the client to the host and port we specify in that option.

Similarly we can intercept requests and responses based on the rules we specify here. This could be a handy feature when we want to intercept only some of the requests in a very high traffic environment.

There are options for modifying HTML received from the response. We can unhide hidden form fields, remove JavaScript, etc. Similarly there is an option for finding a specific pattern and replacing it with a custom string. We need to specify regular expressions here. Burp will parse the request or response looking for this pattern and will replace it with the custom string.
Now that we have set up Burp Suite and the configurations in our browser properly, we can intercept requests. Please note that whenever we send a request, it will be intercepted by Burp Suite and we will have to forward it manually. Hence it is advisable to keep the “intercept is on” option checked only when you really want to see the contents of the packets going through.
Open up your browser and start browsing. We will see that the request is being intercepted by Burp Suite. Hence our proxy is working. We can right click on it and send the request to various other tools in Burp Suite for analysis.

2) Spider

Burp Spider is used for mapping web application. It will automatically crawl the web application looking for links and will submit any login forms it finds and hence provide a detailed analysis of the whole application. These links can then be passed over to Burp Scanner to perform a detailed scan using the information provided by the scanner. In this case I will be using the spider tool on DVWA (Damn Vulnerable Web Application). To do that simply go to the application DVWA using your browser, make sure intercept is on in Burp Suite, and get the request intercepted by Burp Suite. Right click on the intercepted request, and click on send to spider.

Once you do this, an alert will pop up asking us to add the item to the scope. Click on Yes. A scope basically defines the target region on which we want to run our tests.

If we go to the target tab under site map, we will see that the url has been added in the target. Also we can see that some other targets like http://google.com have been added to the targets list. Burp Suite automatically adds targets as we browse the web while using Burp’s proxy. We can add the targets to our scope by right clicking on any target and clicking on add item to scope.

Want to learn more?? The InfoSec Institute Web Application Penetration Testing Boot Camp focuses on preparing you for the real world of Web App Pen Testing through extensive lab exercises, thought provoking lectures led by an expert instructor. We review of the entire body of knowledge as it pertains to web application pen testing through a high-energy seminar approach.

The Web Application Penetration Testing course from InfoSec Institute is a totally hands-on learning experience. From the first day to the last day, you will learn the ins and outs of Web App Pen Testing by attending thought provoking lectures led by an expert instructor. Every lecture is directly followed up by a comprehensive lab exercise (we also set up and provide lab workstations so you don't waste valuable class time installing tools and apps). Benefits to you are:

  • Get CWAPT Certified
  • Learn the Secrets of Web App Pen Testing in a totally hands-on classroom environment
  • Learn how to exploit and defend real-world web apps: not just silly sample code
  • Complete the 83 Step "Web App Pen Test Methodology", and bring a copy back to work with you
  • Learn how perform OWASP Top 10 Assessments: for PCI DSS compliance
If we go to the Scope tab we find that the application dvwa has been added to the scope.

Go to the Spider tab now and click on options. Here we can set various options while running the Burp Spider on the application. We can ask it to check for the robots.txt file, in which it will try to crawl to the directories that the website administrator has not allowed to be indexed for search engines. Another important option is passively spider as you browse. Basically Burp Spider can be run both in passive and active mode. This asks Burp Spider to keep scanning for new links and content as we browse the web application using Burp’s proxy.

Another important option is application login. Whenever Burp Spider hits a login form while crawling, it can automatically submit the credentials that we provide to it here. I have asked Burp Spider to submit the credentials admin/password as these are the credentials used in DVWA. Hence Burp Spider will submit these credentials automatically and keep crawling ahead looking for extra information. You can also change the thread count if you want.

To begin spidering an application, just right click on the target to reveal the branch for DVWA (in this case dvwa) and click on spider this branch.

This will start the Burp Spider. If we go to the Spider control tab, we can see the requests being made. We can also define a custom scope for Burp Spider.

Once it has finished running, we will see a lot of new URL’s for dvwa branch. This provides us very useful information about the web application. We can then send these URLs to other Burp tools like Burp Scanner (available only in the professional edition) and scan it for vulnerabilities.

3) Intruder

Burp Intruder can be used for exploiting vulnerabilities, fuzzing, carrying out brute force attacks and many other purposes. In this case we will be using the Intruder feature in Burp Suite to carry out a brute force attack against DVWA. Browse over to DVWA and click on Brute Force. Enter any username/password, make sure Intercept is on in Burp Suite, and click on Login.

The request will be intercepted by Burp Suite, right click on it and click on send to intruder.

This will send the request information to the Intruder. Go to the Intruder tab. Now we will have to configure Burp Suite to launch the brute force attack. Under the target tab, we can see that it has already set the target by looking at the request.

Go to the positions tab now, here we can see the request which we had previously sent to intruder. Some of the things are highlighted in the request. This is basically a guess by Burp Suite to figure out what will be changing with each request in a brute force attack. Since in this case only username and password will be changing with each request, we need to configure Burp accordingly.

Click on the clear button on the right hand side. This will remove all the highlighted text. Now we need to configure Burp to only set the username and password as the parameters for this attack. Highlight the username from this request (in this case “infosecinstitute”) and click on Add. Similarly, highlight the password from this request and click on Add. This will add the username and password as the first and second parameters. Once you are done, your output should look something like this.

The next thing we need to do is set the attack type for this attack, which is found at the top of the request we just modified. By default it is set to Sniper. However, in our case we will be using the attack type “Cluster Bomb”. According to Burp’s documentation from portswigger.net here is the difference between the different types of attack.
Sniper – This uses a single set of payloads. It targets each position in turn, and inserts each payload into that position in turn. Positions which are not targeted during a given request are not affected – the position markers are removed and any text which appears between them in the template remains unchanged. This attack type is useful for testing a number of data fields individually for a common vulnerability (i.e., cross-site scripting). The total number of requests generated in the attack is the product of the number of positions and the number of payloads in the payload set.
battering ram – This uses a single set of payloads. It iterates through the payloads, and inserts the same payload into all of the defined positions at once. This attack type is useful where an attack requires the same input to be inserted in multiple places within the HTTP request (i.e., a username within the cookie header and within the message body). The total number of requests generated in the attack is the number of payloads in the payload set.
pitchfork – This uses multiple payload sets. There is a different payload set for each defined position (up to a maximum of 8). The attack iterates through all payload sets simultaneously, and inserts one payload into each defined position. For example, the first request will insert the first payload from payload set 1 into position 1 and the first payload from payload set 2 into position 2. The second request will insert the second payload from payload set 1 into position 1 and the second payload from payload set 2 into position 2, and so on. This attack type is useful where an attack requires different but related input to be inserted in multiple places within the HTTP request (i.e., a username in one data field, and a known ID number corresponding to that username in another data field). The total number of requests generated by the attack is the number of payloads in the smallest payload set.
cluster bomb – This uses multiple payload sets. There is a different payload set for each defined position (up to a maximum of 8). The attack iterates through each payload set in turn, so that all permutations of payload combinations are tested. For example, if there are two payload positions, the attack will place the first payload from payload set 1 into position 1, and iterate through all the payloads in payload set 2 in position 2; it will then place the second payload from payload set 1 into position 1, and iterate through all the payloads in payload set 2 in position 2. This attack type is useful where an attack requires different and unrelated input to be inserted in multiple places within the HTTP request (i.e., a username in one parameter, and an unknown password in another parameter). The total number of requests generated by the attack is the product of the number of payloads in all defined payload sets – this may be extremely large.
As we can see in the image below, our attack type is set to “Cluster Bomb”.

Go to the payload tab, make sure payload set 1 is selected, click on load and load the file containing a list of usernames. In my case I am using a very small file just for demonstrations purposes. Once you load the file all the usernames will be displayed as shown in the image below.

Similarly select payload set 2, click on load and load the file containing a list of passwords.

Go to the options tab now and make sure “store requests” and “store response” options are set under results. Have a look at all the options and see if you need or don’t need any of these options.

All right we are now set to launch our attack. Click on Intruder on the top left and click on start attack. We will see a window pop up with all the requests being made.
So how do we know which request is successful? Usually a successful request will have a different response than an unsuccessful request or will have a different status response. In this case we see that the request with the username “admin” and the password “password” has a response of different length than the other responses.

Let’s click on the request with a different response size. If we click on the response section, we see the text “Welcome to the password protected area admin” in the response. This confirms that the username/password used in this request is the correct one.

I recommend you explore Burp Intruder in more detail as it is one of the most powerful features available in Burp Suite.

4) Repeater

With Burp Repeater, we can manually modify a request, and resend it to analyze the response. We need to send a request to Burp Repeater for this. The request can be sent to it from various places like Intruder, proxy, etc.
Let’s send a request to Repeater from the Intruder attack we just performed on DVWA. To send the request to the Intruder, just right click on the request and click on Send to Intruder.

If we go to the Repeater tab, we can see the request there. We also see that there are 3 tabs with the name 1, 2 and 3. In Burp Repeater, a tab is used for each request.

We can also see the params, header, hex and raw format of the request. We can modify any of these before sending the request.

Let’s just change the username, password to the correct one, i.e., username=admin and password=password and click on Go. This will send the request.

We can analyze the response in the response section. Again we have the option to see the params, header, hex and raw format of the response. The render option displays the page as if it were displayed in a browser, though it is not fully reliable.

5) Sequencer

Burp Suite Sequencer is used to figure out the randomness of the session tokens generated by a web application. This is because session tokens are usually used to authenticate a user, and hence should not be compromised. It is important for a web application to have a high degree of randomness for session tokens, so that brute force attacks are not successful against it. We need to send a request which returns a session token to the sequencer, the Sequencer then repeatedly sends the request, thus obtaining a high number of session IDs. It then passes these session IDs through various statistical tests to determine the randomness.
Let’s send a request that returns a session token to the Sequencer. Right click on the request and click on Send to Sequencer.

In sequencer we can see that it automatically identified the ID parameter. We can also use manual selection to select it ourselves, or we can use the cookie and form field drop box to select the value which we think is the session token.

Click on start capture to start the process.

We can see the requests being made and the different tokens being received. It is good to have a sample size of at least 100-200 tokens before starting the analysis. However, the more no of tokens, the better would be the test results. Once you think you have captured enough tokens, click on Analyze now. We will see that Burp Sequencer is now performing all the tests.

The results are displayed as shown in the figure below. As we can see, the overall randomness within the sample is estimated to be excellent. You can switch between tabs to see the results of different types of analyses.

Burp Suite will still continue to capture tokens so that you can again perform the test once you have collected more tokens. Examining the different types of test and how they work is beyond the scope of this article. To understand how Burp Sequencer actually works, read this article.

6) Comparer

Burp Suite Comparer tool is used to do a comparison between two pieces of data, which could be requests, responses, etc. We must provide the Comparer tool with two pieces of data in order to do that. In this case we will be giving the Comparer tool a successful response and an unsuccessful response from the brute force attack against DVWA which we carried out earlier. Make sure the response tab is selected while sending it to the comparer so that we send the responses and not the requests. Right click on an unsuccessful response and click on send to comparer, do the same for the successful response (which is the response for request #11 in the figure below).

Go to the comparer tab. Here we can see the two responses which we had sent to it earlier. Click on the first response (#3) on the top half, and on the second response (#4) on the bottom half. Now the two responses have been selected to carry out the comparison.

We have two ways of performing a comparison between the two responses – through words or through bytes. Click on words to perform a comparison by words. The result is pretty clear. While one response has a “Username and/or password incorrect” message, the other one has a “Welcome to the password protected area admin” message.

Similarly, comparing by using bytes returns the following output. By now you must have begun to understand the importance of this tool.

7) Decoder

Burp Suite Decoder can be used to decode encoded data and get it back into its canonical form. It can also be used to encode and encrypt data to get the encoded and encrypted forms. We can manually paste data into the decoder or send an encoded request to it. In this case I will be sending an HTML Basic authentication request that contains the username and password in base64 encoded form to the decoder. Right click on the request and click on Send to Decoder

Highlight the encoded form and click on decode as and then click on base64

Burp Decoder decodes the base64 encoded string and gives us the username/password in plaintext.

You should check out the Smart Decode feature too in Burp Suite, in which Burp decoder intelligently guesses the encoding used and decodes it. Though it is not fully reliable and some mistakes might occur.

8) Scanner

Burp Scanner is one of the most powerful web application scanners. Though, like any other web application scanner, it is not perfect and some false positives may occur. Burp Scanner is not available with the free edition. You can find more information about Burp Scanner here.

Conclusion

In this article we looked at almost all the popular features of Burp Suite – proxy, scanner, sequencer, repeater, etc. The extent to which it can be helpful in Web application testing is only up to the imagination of the user which makes it a valuable tool for web application testing.

References

  1. PortSwigger Website
    http://portswigger.net/burp/
  2. Hacking Web Authentication – Part 1
    http://resources.infosecinstitute.com/authentication-hacking-pt1/
  3. Burp Sequencer 101
    http://blog.portswigger.net/2008/05/burp-sequencer-101.html
  4. Burp Scanner
    http://portswigger.net/burp/scanner.html

Online Dictionary Attack with Hydra

1. Introduction
When an attacker wants to learn credentials for an online system, he can use brute force or a dictionary attack. This article introduces these two types of attack and explains how to launch an online dictionary attack using Hydra.
2. Brute Force vs. Dictionary Attack
An attacker can try every possible password combination (brute force approach). The advantage is guaranteed success in finding the right password. The drawback is that it is a very time-consuming process.
It’s probable that a typical user is frustrated about password best practices and uses a pattern for the password (for example a common word and a digit appended at the end). Then the attacker can build a set of common words concatenated with a digit (an exemplary pattern in the dictionary) and try every combination from this set. This approach (dictionary attack) can save the attacker’s time, because he doesn’t have to brute-force the whole key space. The disadvantage is that there is no guarantee that the right password will be found. However, the probability of hitting the right password is quite good, taking into account the passwords people often choose.
3. Environment
Hydra is described as a network logon cracker that supports many services [1]. This article explains how to use Hydra to launch an online dictionary attack against FTP and a web form.
Metasploitable is a Linux-based virtual machine that is intentionally vulnerable [2]. It can be used, for example, to practice penetration testing skills. Please remember that this machine is vulnerable and should not operate in bridge mode.
DVWA (Damn Vulnerable Web Application) is a web application that is intentionally vulnerable [3]. It is helpful for those who want to play with web application security stuff. DVWA is part of Metasploitable.
4. Dictionaries
Let’s create two short dictionaries for the simplicity of description.
List of users (list_user):
[plain]
admin_1
admin
msfadmin
[/plain]
List of passwords (list_password)
[plain]
password_1
password
msfadmin
password_2
[/plain]
There are 12 combinations to check (3 users times 4 passwords). These combinations include default credentials for DVWA login form and Metasploitable FTP (admin/password for DVWA login form; msfadmin/msfadmin for Metasploitable FTP).
5. Metasploitable—Dictionary Attack on FTP
Use the following command to launch the attack:
[plain]
dawid@lab:~$ hydra -L list_user -P list_password 192.168.56.101 ftp -V
[/plain]
The aforementioned dictionaries (list_user and list_password) are used. The IP address of Metasploitable FTP server is 192.168.56.101. FTP is attacked. That’s why ftp module is used in the command. One should use -V to see username and password for each attempt.
As we can see below, Hydra has found one valid pair of username and password (username: msfadmin, password: msfadmin).


6. DVWA—Dictionary Attack on Login Form
Use the following command to launch the attack:
[plain]
dawid@lab:~$ hydra -L list_user -P list_password 192.168.56.101 http-post-form "/dvwa/login.php:username=^USER^&password=^PASS^&Login=Login:Login failed" -V
[/plain]
The aforementioned dictionaries (list_user and list_password) are used again. The IP address of DVWA is 192.168.56.101. The login form of DVWA is available in Metasploitable at 192.168.56.101/dvwa/login.php. When the user logs in, the following request is generated (intercepted by Burp Suite [4]):
Want to learn more?? The InfoSec Institute Ethical Hacking course goes in-depth into the techniques used by malicious, black hat hackers with attention getting lectures and hands-on lab exercises. While these hacking skills can be used for malicious purposes, this class teaches you how to use the same hacking techniques to perform a white-hat, ethical hack, on your organization. You leave with the ability to quantitatively assess and measure threats to information assets; and discover where your organization is most vulnerable to black hat hackers. Some features of this course include:
  • Dual Certification - CEH and CPT
  • 5 days of Intensive Hands-On Labs
  • Expert Instruction
  • CTF exercises in the evening
  • Most up-to-date proprietary courseware available

The key parts were marked on the screenshot. They are the values of the parameters of http-post-form module:

[plain]
"/dvwa/login.php:username=^USER^&password=^PASS^&Login=Login:Login failed"
[/plain]
^USER^ and ^PASS^ are replaced with usernames (from list_user) and passwords (list_password) respectively. When the login attempt is unsuccessful, the server responds with a “Login failed” message, which is the value of the last parameter.
Finally, one should use -V to see username and password for each attempt.
As we can see below, Hydra has found one valid pair of username and password (username: admin, password: password).

7. Summary
This article introduced two types of online password attack (brute force, dictionary) and explained how to use Hydra to launch an online dictionary attack against FTP and a web form. Hydra is a network logon cracker that supports many services [1]. Metasploitable can be used to practice penetration testing skills [2]. DVWA (Damn Vulnerable Web Application) is helpful for those who want to play with web application security stuff [3].
References:
[1] Hydra
http://www.thc.org/thc-hydra/ (access date: 7 September 2013)
[2] Metasploitable
http://www.offensive-security.com/metasploit-unleashed/Metasploitable (access date: 7 September 2013)
[3] DVWA (Damn Vulnerable Web Application)
http://www.dvwa.co.uk/ (access date: 7 September 2013)
[4] Burp Suite
http://portswigger.net/burp/ (access date: 7 September 2013)

Doxing: The Dark Side of Reconnaissance



Introduction:
Doxing is a coin with two sides. Doxing can be used for security, research and collecting proof for investigation in one hand but in other hand, it can be used for cyber harassment and other serious cyber issues. But here, after lots of research, I learned that Doxing is a part of Reconnaissance, which generally focuses on its dark side. So before entering into the dark side, let’s first understand the bright side i.e. Reconnaissance.
Define: Reconnaissance
Reconnaissance is also known as foot printing or information gathering. It is the first step to any penetration testing. The main objective is to gather as much as information possible about the target.
Define: Doxing
According to urban dictionary, “Doxing is a technique of tracing someone or gathering information about individual using sources on the internet. Its name is derived from ‘Documents’ or ‘Docx.’ The Doxing method is based purely on the ability of the hacker to recognize valuable information about his target and use this information to his benefit.”
It’s also based around the idea that, “The more you know about your target, the easier it will be to find his/her flaws.”
Though I understood the concept, still it’s a little confusing. If Doxing is all about gathering a valuable piece of information and using it to the attackers benefit then how does it differ from Reconnaissance? Why it is called Doxing?
After lots of research I found that Doxing is a two-step process.
Step1: Collecting information about an individual from publicly available sources such as social networks, chat forums, blogs, articles etc. from a limited initial source of information such as name, email id or screen name in any site. This is Reconnaissance.
Step2: Intentionally disclosing it in any group, forum, site, or anywhere in public for some kind of personal benefit that may be rage, revenge or enmity for harassing or humiliating the target.
What I concluded is that Doxing consist of two stages. If a Hacker collects all the information about a target and does nothing than, that’s not Doxing but simply Information Gathering. When this Information is posted publicly, that’s exactly what we call Doxing.
What information is needed when Doxing?
There is no such format or any particular structure for Doxing. It may be any information related to the target. The information must be private and important. If you think from an attacker point of view we can say Doxing might contain real names, real pictures, ages, genders, primary email id, and if different email ids are used for different social sites than those ids with respect of sites. Social network profile links (Facebook, Twitter, LinkedIn), websites, owned blogs, address, phone number, education details, Bank account details and such similar or more important information.
Where to Start?
As we know the first step of Doxing is gathering information. And to gather information about someone we need some or any small piece of information to start with. That information may be name, email, screen name or some/all of these.
Let’s think about real time scenario.
In a social network site, a user is disturbing another user. In this case our victim wants to Dox the attacker. But the problem is the attackers profile looks fake, not one bit of information looks genuine. So where to start? The answer is, start with the username.
How to start?
Let’s say the name is John. We know that John is a very common name and if you search in Google as “John” you will get thousands of results. So what to do?
You have to find some other information about John in that social network site. But as we know that it’s a fake profile we don’t know whether to rely on any of the information or not. In this case, search for some other info like signature. For example if he/she put signature as “h4xor”. You can continue searching using “John h4xor”. This will reduce the Results.
Sometimes your target person registered in multiple forums, websites or social networks. So while searching, you will get results of registered websites for him/her using that username or other info. Let’s say you found some other accounts which looks fake with the same signature, then compare those accounts and see what information and which users are mutual, Read each post of target persons, he might have left some more information about him in any of the forums or websites.
This is just an example of how to collect information from nothing and end up with Doxing.
Search Methods:
Google
It’s a powerful search engine which comes with different advance search options. Use its special notations, operators or a combination of both to find an effective result.
There are several special notations like
  • + include
    • Exclude
  • | OR
  • .. range
  • ~ synonym
  • “” string
  • *Wild card
http://www.google.com
Bing
Bing is also a powerful search engine. Having its own specialties, it’s social search feature helps users to search for and retrieve real-time information from social networks.
http://www.bing.com/
Looking for profile of a person
Peek You
Is an interesting site to gather information. It asks about the first name or last name. After entering first name and last name it provides interesting information such as social account details, possible location, possible relatives, email addresses (Partial shown in result) and also arrest records if any.
Nothing to worry if you don’t know the first name and last name of the target. You can even search just using the username and also using email addresses of the target.
http://www.peekyou.com
Lullar
This is also quite similar to peek you. You can search using first name, last name, user name and also with an email id. It gives results of all the websites that may have the entered user.
http://com.lullar.com/
Check Usernames
This is actually made to find out if a user wants to use a particular username in a social networking site than whether it is available or not. But we can use the same to check if our target is using other social networking sites or not. It’s quite simple you just have to add the target’s username and search. The site will search through 160 different social sites and give you the result. Check for the sites are not available, that means the particular username is already registered in the site and may be another account of your victim as shown in image1.

Image1: Check Usernames Result
http://checkusernames.com/
Pipl
You can search using name, email, username or phone number (location is optional). It provides links of the social networking sites along with the profile picture used to verify the target easily.
https://pipl.com
123 People
It is also similar to Pipl but it only allows you to search using first name last name and location (You can use world if you don’t know about the targets country).The results provide social networking site links with profile picture and interestingly it provides related people details also.
http://www.123people.com.
Webmii
You need to search using first name and last name. If you don’t know the region of the target, use international to search. In the result you will find pictures of the target and also blog posts. If the target posts any articles in public you can find it in the results.
http://webmii.com/
Socialmention
You need to search using name, email id, username or any related keywords. Social mention searches the entered keyword and provides you results if the keyword is mentioned in any social networking site such as Facebook, YouTube and Wiki. It also provides you the usernames which mentions that particular keyword you entered.
http://socialmention.com
Whostalkin
You need to search using name, email id, username or any related keyword. Whostalking searches the entered keyword in many different web sources and provides you the link where the particular keyword is mentioned.
http://www.whostalkin.com
Recordedfuture
This is the one I like most. This can be used for different purposes such as Cyber intelligence, Corporate Security, Competitive intelligence, Financial Services etc. but you can use this for Reconnaissance also.
The best thing regarding this application is that you can set the timeline in which you want to search.
You can search for people, places, time and events. In our case we are interested in collecting information about a person.
You need to register first to use this application but I must say you will find worth of it. After registration login to your account and click on ANALYZE. You will find a search bar in top right. Enter the name you want to search. Adjust the timeline in bottom. And click on search. It will show the links and details of the name mentioned anywhere in the internet. It also shows the summary on the right hand side of the page. As shown in Image2.

Image2: Recorded Future Timeline (Courtesy: RecordedFuture.com)
You can see the results in different forms such as timeline, map (As shown in Image3), network, table, feed, and tree map format.

Image3: Recorded Future Event Map (Courtesy: RecordedFuture.com)
The result contains dates, link where the name is mentioned and some part of the post. It also minutely differentiates the results such as organization, person, product and many other. The Network view (As shown in Image4) shows how different results are connected to each other.

Image4: Recorded Future Event Network (Courtesy: RecordedFuture.com)
This application will provide information related to
  1. Who is the first to report about the person you search for?
  2. Which sources are reporting about the person you search for?
  3. Quotes about the person you search for.
  4. Who is mentioned together with the person you search for?
  5. What else is associated with the person you search for?
  6. Where is the person you searching for is travelling?
…and many more.
It’s so interesting to get all this information in an organized manner. And it provides you the feature to customize your view according to group by event type, person, Location, First source and many more.
There are loads of features present in this application. You just need to explore.
https://recordedfuture.com
Search information using image
Google image
If you want to search someone using image, what will be the best solution other than a powerful search engine. Just go to Google than click on images. In the right corner of the search bar you will find a camera icon. Click on that and it will ask you to paste image URL or upload image. Do any of these two and you will get not only similar image but also best match images in result.
https://www.google.co.in/imghp?hl=en&tab=wi
Tin Eye
Search for someone using image. You need to either provide the link of an image or simply download the profile picture of the target and upload to search. This site provides the links where same picture is used and also the links of the best match pictures. As shown in Image5.

Image5: Tineye Result
http://tineye.com
Search information using address or telephone number
White pages
If you know the exact address of the target than use it to find the neighborhood. If you know the partial address than use it to find more details of that area. You can also search for information using telephone number.
http://www.whitepages.com/reverse_address
http://www.whitepages.com/reverse_phone
Search information using a post or discussion
Omgili
Sometimes people discuss about a particular topic in different forums or social networking sites. If you want to find information related to any of the posts of your target, you can use this site. It allows you either enter the detailed post or at least the keywords of the post to search weather any other forum or site has similar discussion.
http://omgili.com
Search information using IP address
IP address does not provide much information but still it will help to collect some information. I am not going to cover how to collect IP address (You can collect it using email). If you are having the IP address of the target then you can use any IP look up tool to collect the information such as http://whatismyipaddress.com/ip-lookup . It will provide you details such as ISP name, country, state, city, longitude and latitude.
Search information using Domain names
Sometimes domain names help us to find out important information such as address, email id and phone number. Just enter the domain name in http://whois.domaintools.com and click on lookup.
Tools
We came across different cases and how to collect information in that particular scenario manually but there are certain tools which will automate the process for you and provide information using web resources.
Want to learn more?? The InfoSec Institute Ethical Hacking course goes in-depth into the techniques used by malicious, black hat hackers with attention getting lectures and hands-on lab exercises. While these hacking skills can be used for malicious purposes, this class teaches you how to use the same hacking techniques to perform a white-hat, ethical hack, on your organization. You leave with the ability to quantitatively assess and measure threats to information assets; and discover where your organization is most vulnerable to black hat hackers. Some features of this course include:
  • Dual Certification - CEH and CPT
  • 5 days of Intensive Hands-On Labs
  • Expert Instruction
  • CTF exercises in the evening
  • Most up-to-date proprietary courseware available
The Harvester
The Harvester is an open source intelligence tool (OSINT) for obtaining email addresses, sub domains, hosts, employee name, open ports and banners from public sources such as search engines. It’s a simple python tool which is easy to use and contains different information gathering functions.
http://www.edge-security.com/theharvester.php
Generally we need a domain name or company name to collect information but we can use keyword also to collect related information. We can specify our search, such as to search from Google or Google-profiles or linked or all the web resources used by the harvester.
Collecting information using Google as a source (As shown in Image6).

Image6: The Harvester Command
-d= Generally, domain name or company name but for our case it is for keyword
-l= Number of result limits to work with
-b= Specifying the data source
Collecting information using LinkedIn as source
#./theHarvester.py –d yourkeyword –l 100 –b linkedin
Collecting information using all the web resource
#./theHarvester.py –d yourkeyword –l 100 –b all
This tool provides you email addresses, hosts, virtual hosts etc. (As shown in Image7). This tool is useful when you know the company of your target or the domain owned by the target, then you can collect related information.

Image7: The Harvester Result
Maltego
Maltego is also an open source intelligence tool (OSINT). It’s a little complex yet very effective tool. It collects information from different web sources and provides you with a relationship graph for link analysis and data mining. It helps you in analyzing real-world relationships between people, groups, websites, domains, networks, internet infrastructure etc. I like this tool, because it provides an overview of the entity relationship in a mind map manner.
http://www.paterva.com/web6/products/maltego.php
To use Maltego you need to register yourself first. It provides you a wide range of options to start with such as IP address, domain name, URL, location, name, email id etc. Start with any of these but in our case we will start with name.
Drag the Person entity to the center and in the property view edits its first name and last name. Right click and run different transformations. According to the information fetch from web resources Maltego will co relate among that information and will provide you with a relational network diagram (As shown in Image8). If you don’t know which transformation to choose then run all transformations. It will provide all the result.

Image8: Maltego Result Main View
You can switch in to different types of views to see your result. You can insert, edit and delete the entities and its relationships. It’s a tool with lots of features. Play with it more to find new possibilities.
Keeping track of all the information collected
CaseFile
Sometime it’s better to keep track of all the information collected manually. But isn’t it better to have a tool which will simplifies the process. And there comes CaseFile, a data visualization tool.
Want to learn more?? The InfoSec Institute Ethical Hacking course goes in-depth into the techniques used by malicious, black hat hackers with attention getting lectures and hands-on lab exercises. While these hacking skills can be used for malicious purposes, this class teaches you how to use the same hacking techniques to perform a white-hat, ethical hack, on your organization. You leave with the ability to quantitatively assess and measure threats to information assets; and discover where your organization is most vulnerable to black hat hackers. Some features of this course include:
  • Dual Certification - CEH and CPT
  • 5 days of Intensive Hands-On Labs
  • Expert Instruction
  • CTF exercises in the evening
  • Most up-to-date proprietary courseware available
http://www.paterva.com/web6/products/CaseFile.php
CaseFile is another fine product of Paterva also known as Maltego CaseFile. It helps you build information map with tons of new features included such as attaching photos, documents, graph merging etc (As shown in Image9). It provides you simple interface to add, link and analyze data quickly and effectively.

Image9: CaseFile Result
Why Dox Someone?
The intention behind Doxing someone is never good because the target has to face serious consequences. It can be done for many different reasons as I stated some of the motives earlier in the definition of Doxing. It is generally used for accepting challenge, taking revenge on someone, or simply harassing the enemy in public.
What are the consequences?
As Doxing discloses all the private information in public, it’s a serious privacy concern. Apart from that it affects the virtual identity (Online Reputation), it can break the target mentally, it can be a threat to health and life, and it will affect the employment, business and social life. It might lead to identity theft. And in the worst scenario may be a reason for suicide. These are some of the serious consequences but it can be worse in real life.
You can be a victim
As internet became an essential part of our life. We started living dual life. One is the online life, where we have different usernames, different aliases, and different profile pictures in different places and other the offline life our physical life. As the definition of being social changed from meeting people outside to doing Google hang out and being online in different social networking sites. We started sharing information intentionally or unintentionally in internet. If you ask me personally how many sites you’re registered in. I can’t answer exactly. Because internet changed so rapidly and we also changed ourselves, in the mean while we forgot about those sites or thing we used to do earlier in internet. I think this is the case for most internet user. And taking benefit of this ignorance any attacker can collect our information from different sources of internet which makes each one of us vulnerable to be a victim of Doxing.
Help yourself not to be a victim
  1. Don’t provide all the personal information in any site if it is not mandatory.
  2. If you provide personal information anywhere than make that profile private.
  3. Use different user credentials for different sites.
  4. Use different aliases in different sites.
  5. Don’t share your image in any profiles.
  6. Don’t show off too much in social sites.
  7. Don’t challenge any one.
Conclusion:
This can be utilized for good. As social media plays a huge role in everyone’s life now days, it is one of the fastest media and covers all age group audience. We can use this technique to protest against social evils and disclose them totally in public media for greater good.
Reference:
https://www.ethicalhacker.net/columns/andress/doxing-and-anti-doxing-part-i
http://www.irongeek.com/i.php?page=security/doxing-footprinting-cyberstalking
https://www.recordedfuture.com/

Web Services Penetration Testing Part 5: Manual Testing with soapUI


In the previous article, we discussed the importance of manual web services penetration testing, how to perform a manual test using SOA Client, how SOA client helps us in most cases, and what the restrictions are that require us to choose other options.
In this article, we will find the solution to those problems that we discussed in the previous part.
The scenario was: What if we are performing a black box test and the sample request is not disclosed to the public? What if, in the same scenario, this SOA Client is unable to parse one of our requests properly? In that case, we need other options to perform the test, and nothing is better than an open source specialist web services testing tool.
Yes, it is soapUI. As we discussed in one of the previous articles, “Web Services Penetration Testing, Part 2: An Automated Approach With SoapUI Pro,” SoapUI by SMARTBEAR (http://www.soapui.org) is the only one popular tool to test for soap vulnerabilities. It comes in two versions: 1. SoapUI (which is open source) and 2. SoapUI Pro (the commercial version). We have already learned how to use SOAP UI Pro, now it’s time to learn about how to use the open source version, i.e., SoapUI (http://www.soapui.org/Downloads/latest-release.html).
Testing Web Services with soapUI
Although the initial process of creating a project is same in both soapUI and soapUI Pro, I just want to quickly cover all of those again. To create a project, open your soapUI. You will see the initial window, as shown in Figure 1.
Figure 1: soapUI start window
Click on “File” and “New SOAP Project” to open another window, as shown in Figure 2.
Figure 2: New SOAP Project window
Fill in all the details. Name the project anything you want and the initial WSDL should be either the WSDL file URL or the local path if you have the WSDL file locally. I will use the http://www.testfire.net/bank/ws.asmx?WSDL URL for testing, as shown in Figure 3.
Figure 3: New SOAP Project window with data
Then click “OK” to load all the definitions and you will get all the definitions in your soapUI, as shown in Figure 4.
Figure 4: soapUI window with imported definitions
A similarity between soapUI and soapUI pro is that you can edit the interface properties, as shown in the left bottom corner, but in soapUI we can’t add new properties. And the most important thing is that the security automation feature is only present in soapUI Pro but, apart from that, in the case of manual testing, soapUI is as powerful as soapUI Pro.
Now click on any method you want to test. Let’s say we were facing a problem in the TransferBalance method in SOA Client, so we will start from there to check whether or not we will face something like that here. The request editor window is shown in Figure 5.
Figure 5: Request editor window
Unlike soapUI Pro, the request editor window of soapUI contains only two tabs:
  1. XML
  2. RAW
Mostly we will use XML and, unlike the SOA Client, soapUI parsed the method successfully, so we don’t have a problem generating proper requests.
Though soapUI is an excellent tool, it has a major disadvantage in the case of black box testing: It won’t show you the data type required to test a particular request. In this case we have three options:
  1. You need to guess or fuzz all types of data types in different parameters. But this is not a smart way of testing and also very time-consuming.
  2. You can get help from some other tool, such as SOA Client, to get these details.
  3. Read the WSDL file and understand the requirements of the request (to understand different elements of WSDL go through Web Services Penetration Testing Part 1)
Let’s start with the first option to guess the values we need to understand the request properly. We can see the request in Figure 6.
  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://www.altoromutual.com/bank/ws/">
  2. <soapenv:Header/>
  3. <soapenv:Body>
  4. <ws:TransferBalance>
  5. <!--Optional:-->
  6. <ws:transDetails>
  7. <ws:transferDate>?</ws:transferDate>
  8. <!--Optional:-->
  9. <ws:debitAccount>?</ws:debitAccount>
  10. <!--Optional:-->
  11. <ws:creditAccount>?</ws:creditAccount>
  12. <ws:transferAmount>?</ws:transferAmount>
  13. </ws:transDetails>
  14. </ws:TransferBalance>
  15. </soapenv:Body>
  16. </soapenv:Envelope>
Figure 6: transferBalance Request
Here we have four parameters; let me guess the data type by its parameter name.
  1. transferDate(this must be in date format) = 2013-11-11
  2. debitAccount (this must be integer type) = 112233
  3. creditAccount (this must be also of integer type) = 445566
  4. transferAmount (this must be double) = 100.00
As it is black box testing and we don’t have a clue for the data types, we will use what we have guessed. After inserting all those data, the request looks like Figure 7.
Figure 7: transferBalance request with data
Let’s send this request by clicking the green button in the top left corner of the request window, as shown in Figure 7, and we will get the response as shown in Figure 8.
Figure 8: showing response of transferBalance request
We got the response, “Transaction failed – debit account does not exist,” but we don’t know whether it’s a successful response or error response. To check that, click on the RAW tab of the response window as shown in Figure 9.
Figure 9: Raw response window
Two things we get from that response:
  1. Our request executed properly.
  2. We got a vulnerability, i.e., a header version disclosure.
The SOAP response header discloses the following version details:
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Everything worked fine, but we still don’t know whether the data types we assumed are correct or not, so let us move to the next option, i.e., collecting data type information from SOA Client.
We learned how to test using SOA Client in the “Web Services Penetration Testing Part 4: Manual Testing with SOA Client,” so, without taking much time, I will directly show you where to collect this information. Just check it in Figure 10.
Figure 10: SOA Client showing parameters with required data type
It’s a very simple process. Open SOA Client. In “URL,” provide the WSDL URL. Click on “Parse WSDL” and in the result window you can find the parameters with data types. But sometimes it is unable to parse a WSDL properly; in that case, there is nothing to worry about; just go below and, in the “Raw WSDL Data,” you can find the parameters as well as the data type needed under the particular method or operation name.
As you can see from Figure 10, the required parameters with needed data types are:
  1. “transferDate”(date-time)
  2. “debitAccount” (string)
  3. “creditAccount” (string)
  4. “transferAmount” (double)
As we discussed earlier, the same can be also found at the WSDL, as shown in Figure 11.
Figure 11: WSDL showing parameters with required data types
We can get these details in both ways discussed above, but I personally feel that it’s better to understand the WSDL file and better to be tool-independent. But both the options are in front of you. You can choose whichever one you are comfortable with.
So, as we now have all these details, we can easily fill the appropriate data types and send the request in soapUI. The data we are going to use are:
  1. transferDate(date-time) = 2013-01-01T00:00:00
  2. debitAccount (string) = 1001160140
  3. creditAccount (string) = 1001160141
  4. transferAmount(double) = 1.0
Let’s send the request with these data. It will look like Figure 12:
Want to learn more?? The InfoSec Institute Ethical Hacking course goes in-depth into the techniques used by malicious, black hat hackers with attention getting lectures and hands-on lab exercises. While these hacking skills can be used for malicious purposes, this class teaches you how to use the same hacking techniques to perform a white-hat, ethical hack, on your organization. You leave with the ability to quantitatively assess and measure threats to information assets; and discover where your organization is most vulnerable to black hat hackers. Some features of this course include:
  • Dual Certification - CEH and CPT
  • 5 days of Intensive Hands-On Labs
  • Expert Instruction
  • CTF exercises in the evening
  • Most up-to-date proprietary courseware available
Figure 12: transferBalance request with data
Let’s send this request by clicking the green button on the top of the left corner and we will get the result shown in Figure 13.
Figure 13: response window after successfully executing the request
Voila, we successfully sent the request and got the response that “$1 was successfully transferred from Account 1001160140 into Account 1001160141 at 11/16/2013 2:15:47 PM”. Some might think how exactly I got these numbers correct; yes, this is a question but the other major question is how you can get all these data correct. It’s simple by fuzzing the parameters.
We have four parameters here, of which two are independent, i.e., transferDate and transferAmount. And now we are left with two parameters. debitAccount and creditAccount. As there is no anti-automation we can fuzz both the parameters and enumerate the account number.
Now, since we successfully executed this request and collected some genuine data, we can use them to test some other test cases. Since it is a banking application and it allows us to send money from one account to another, let’s check whether a negative balance transfer is allowed or not.
We will use the same data that we used in the previous request, just changing the transferAmount value from 1.00 to -1.00. The data used:
  1. transferDate(date-time) = 2013-01-01T00:00:00
  2. debitAccount (string) = 1001160140
  3. creditAccount (string) = 1001160141
  4. transferAmount(double) =- 1.0
And let’s check the result, as shown in Figure 14.
Figure 14: response window after successfully executing the request
Yes, we are able to transfer a negative balance. This is one of the critical business logic vulnerabilities in any banking application or service. And this is the power of manual testing. This kind of vulnerability can never be detected by any auto scanner.
Let’s now look at another test case. We will use the same data used in the previous request, but this time with a $2.00 transferAmount. The only other thing we will change is that we will use the same account number for both debitAccount and creditAccount. Here we will check whether this web service validates the uniqueness of debitcardAccount and creditcardAccount before executing the service or not. The data used:
  1. transferDate(date-time) = 2013-01-01T00:00:00
  2. debitAccount (string) = 1001160140
  3. creditAccount (string) = 1001160140
  4. transferAmount(double) = 2.0
And let’s check the result, as shown in Figure 15.
Figure 15: response window after successfully executing the request
This is again a critical business logic vulnerability. A banking service must validate that the sender’s account and receiver’s account are not the same.
Similarly, you can think out of the box according to your scenario; understand the functionality of the web service first and then experiment with different approaches to get new nontraditional vulnerabilities.
Now it’s time to try some very popular test cases. The data we will use are:
  1. transferDate(date-time) = 2013-01-01T00:00:00
  2. debitAccount (string) = 1001160140′
  3. creditAccount (string) = 1001160141
  4. transferAmount(double) = 2.0
The result is shown in Figure 16.
Figure 16: response window showing error message.
In this case we found:
  1. System.Data.OleDb.OleDbException (we got a DB Exception or possible SQLI)
  2. d:\downloads\AltoroMutual_v6\website\App_Code\WebService.cs:line 146 (server path disclosure)
Though we found some good business logic vulnerabilities, it’s not possible every time to find the same. Most of the time, the common vulnerabilities that we find on a web service are information disclosures, such as header version disclosure, private IP address disclosure, database error pattern found, etc. Apart from that, authorization-related vulnerabilities are very common in this case. Some other common vulnerabilities, such as SQL Injection, can also be found. But we need to focus most on information disclosure, as web services are being used in complex enterprise level applications and those applications contain a huge number of vital, private and important information.
Conclusion
In this article, we focused on how to perform manual web services penetration testing using soapUI: How to get information regarding the data type needed for different parameters and how to generate different test cases according to the given scenario to test different business logic vulnerabilities. So, as I mentioned in the Web Services Penetration Testing Part 1, the testing approach of web services is quite similar to the testing approach used in web applications. You will agree with me after completing this article.
The only problem here is that it is very difficult to execute each and every request independently in soapUI. Let’s say I want to fuzz a parameter: It is very difficult for me to do so just using soapUI. So, in the next installment, we will discuss how to integrate soapUI with other tools to automate the testing process.
References
http://www.soapui.org
https://addons.mozilla.org/en-US/firefox/addon/soa-client/

Web Services Penetration Testing Part 4: Manual Testing with SOA Client


In the previous article, we discussed the automated tools available for testing web services, how to automate web services penetration testing using different automated tools, and also why the automation of web services penetration test is not sufficient and manual testing is needed.
In this article, we will focus on the open source tools available to pen test web services manually and why it is so important.
Manual Testing
Manual testing covers lots more different types of nontraditional test cases that will help a pen tester to understand the functionalities and trying different new approaches based on the scenario, rather than fuzzing the general payloads to cover traditional vulnerabilities. It allows a pen tester to think out of the box, which may lead to a zero-day. It also provides freedom to a pen tester to test different business logic vulnerabilities that are literally impossible to cover by a auto scanner.
For manual testing also we need some kind of tools that will help us, so today we will start with the open source manual tools that can be used test web services. We will start with a simple yet effective Mozilla Firefox add-on, SOA Client.
SOA Client
SOA Client (https://addons.mozilla.org/en-US/firefox/addon/soa-client/) is a Mozilla Firefox add-on by Michael Santoso. It is a portable client to access web services and UDDI registries. It is easy to install and it has a user-friendly interface to perform web services penetration testing manually, as shown in Figure 1.
Figure 1: SOA Client window
As I stated earlier, SOA Client is used to access WSDL and UDDI. Below is a list of some web services and UDDI registries that are on the SOA Client page.
Web Services
Credit card verification: https://ws.cdyne.com/creditcardverify/luhnchecker.asmx?wsdl
Census information: http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl
Currency foreign exchange: http://www.xignite.com/xCurrencies.asmx?WSDL
Email address validation: http://www.webservicex.com/ValidateEmail.asmx?WSDL
English dictionary: http://services.aonaware.com/DictService/DictService.asmx?WSDL
Number conversion: http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL
Image converter (e.g., PSD into JPG): http://www.bigislandcolor.com/imageconvert.wsdl
IP address into location: http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl
Stock quote: http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl
Translator (English to Chinese): http://fy.webxml.com.cn/webservices/EnglishChinese.asmx?wsdl
FIFA World Cup 2010: http://footballpool.dataaccess.eu/data/info.wso?WSDL
Weather forecast: http://www.webservicex.net/WeatherForecast.asmx?WSDL
UDDI Registries
Want to learn more?? The InfoSec Institute Ethical Hacking course goes in-depth into the techniques used by malicious, black hat hackers with attention getting lectures and hands-on lab exercises. While these hacking skills can be used for malicious purposes, this class teaches you how to use the same hacking techniques to perform a white-hat, ethical hack, on your organization. You leave with the ability to quantitatively assess and measure threats to information assets; and discover where your organization is most vulnerable to black hat hackers. Some features of this course include:
  • Dual Certification - CEH and CPT
  • 5 days of Intensive Hands-On Labs
  • Expert Instruction
  • CTF exercises in the evening
  • Most up-to-date proprietary courseware available
http://hma.eoportal.org/juddi/inquiry
http://registry.gbif.net/uddi/inquiry
http://test.uddi.microsoft.com/inquire
As you can see in Figure 1, There are four tabs in SOA Client:
  1. Access Web Services
  2. Access UDDI Registries
  3. Advanced Access
  4. About
In this article, we will be using mostly the “Access Web services” and “Advanced Access” options, since we are going to use a public-facing demo web service and not the UDDI registry. So, for this case, we are going to use the same (http://www.testfire.net/bank/ws.asmx?WSDL) for manual testing.
Manual Testing with SOA Client
First open your SOA Client and put this WSDL URL, as shown in Figure 2.
Figure 2: Access Web Services tab
Then Click on “Parse WSDL” to import all the operations present in that web service, as shown in Figure 3.
Figure 3: Parsed WSDL window
In the result page, you will get all the operations available in the web service. And, as you can see, there are five tabs:
  1. Raw WSDL Data
  2. Raw Request Header
  3. Raw Request Body
  4. Raw Response Header
  5. Raw Response Body
This is a very good, light-weight, simple GUI tool to test web services manually. Let’s start the test by selecting the “GetUserAccounts” operation, as shown in Figure 4.
Figure 4: invoking GetUserAccounts operation
As we can see here, the “GetUserAccounts” operation contains only one parameter of “int” data type and we provided an appropriate value there. Now click on “Invoke” (because Figure 4 is a partial image, you will see the “Invoke” button on the very right side of this window. as shown in Figure 3) to send the request.
Since we provided it with a proper request, we get a valid response “200 OK” without any error. (If you remember, in the previous article “Web Services Penetration Testing, Part 2: An Automated Approach With SoapUI Pro” in Figure 10: XML View, we used the same method and value and got a response with no error; here we got a similar response, as shown in Figure 5.)
Figure 5: Response to GetUserAccounts requests
Similarly, you can change the values in different parameters and invoke the request to get the response. But there are certain problems with this SOA Client; one problem is that sometimes it won’t parse the WSDL properly. That’s what happened here. As you can see in Figure 6 in the Raw WSDL Data tab, the operation “TransferBalance” has four parameters, but in the GUI, the SOA Client shows only two.
Figure 6: Parsed WSDL operations window
As is very clear from the raw WSDL data, the “TransferBalance” operation needs four values:
  1. transferDate (date-time data type)
  2. debitAccount (string data type)
  3. creditAccount (string data type)
  4. transferAmount (double data type)
But the SOA Client only parsed two parameters, “debitAccount” and “creditAccount.”
We can come out of this and still perform web service manual penetration testing using its “Advanced Access” option. All we need is the sample request. Most probably, in gray box testing, we are provided with sample requests, but sometimes we get those sample requests due to an information leakage vulnerability.
I prefer this tool when I get a WSDL file and the sample requests are disclosed publicly due to server misconfiguration while performing a Web application penetration test. I use the “Advanced Access” module to check the operation to find vulnerabilities.
So here we assume that we found the sample requests of this WSDL (http://www.testfire.net/bank/ws.asmx?WSDL) and we use them to learn how to use the “Advanced Access” module in the SOA Client tool.
We will use the sample request of the “TransferBalance” operation, which can be found on (http://www.testfire.net/bank/ws.asmx?op=TransferBalance), as shown in Figure 7. The normal “Access Web Services” module is unable to parse it properly.
Figure 7: Sample request for the TransferBalance operation
Before starting the testing, first let’s have a check on the “Advanced Access” module interface to understand what data we need to start the test. The interface can be found in Figure 8.
Figure 8: Advanced Access module window
As you can see, we need a URL (which is an end point URL to perform the test). We have to specify the request type (whether we want to use GET, POST, HEADER, TRACE, or OPTIONS). We have to deal with the authentication mechanism, if any is needed, and we need to determine the communication type, synchronized or asynchronized. We also need the HTTP request header (If any specific header has to be added) and, last but not least, the SOAP request. We can find all these details in the sample request. But before that, we need to understand how to differentiate all these requirements from that one sample request, as shown in Figure 9.
  1. POST /bank/ws.asmx HTTP/1.1
  2. Host: www.testfire.net
  3. Content-Type: text/xml; charset=utf-8
  4. Content-Length: length
  5. SOAPAction: "http://www.altoromutual.com/bank/ws/TransferBalance"

  6. <!--?xml version="1.0" encoding="utf-8"?-->

  7. dateTime string
  8. string
  9. double
Figure 9: Sample request of TransferBalance operation
This is the same request from Figure 7. Here we can see in the very first line that the request method is POST. And from line 1 and line 2 we can deduce that the URL used must be http://www.testfire.net/bank/ws.asmx. In the header there is nothing special that we need to use in the “Advanced Access” module. The type of communication is not specified, so we can go with the default options. There is no authentication mechanism required for this request, so we will not touch that option in the “Advanced Access” module. And last but not least, we have the SOAP request in the second part of the sample request. This SOAP request contains four parameters.
  1. transferDate (date-time data type)
  2. debitAccount (string data type)
  3. creditAccount (string data type)
  4. transferAmount (double data type)
As it’s a black box testing, we don’t have the exact data that we can use in this request, so we will use some data with the required data type.
  1. transferDate (date-time data type) = 2009-01-01T00:00:00
  2. debitAccount (string data type) = test
  3. creditAccount (string data type) = tester
  4. transferAmount (double data type)= 1.0
When we enter all these details in the “Advanced Access” module it will look as shown in Figure 10.
Figure 10: Advanced Access window with required data
The things added or changed are marked in red in Figure 10. The rest are the default settings. Now submit the request by clicking the “Submit” button in the right top corner to get a response. The response is shown in Figure 11.
Figure 11: Response of TransferBalance request
As you can see in Figure 11, in the “Raw Response Body” tab we got the “200 OK” with some interesting information.
  1. TransferBalanceResult success is false (we are unable to transfer the balance).
  2. System.Data.OleDb.OleDbException (we got a “DB Exception”; this is a hint to a possible SQLI).
  3. d:\downloads\AltoroMutual_v6\website\App_Code\WebService.cs:line 146 (server path disclosure).
This is how we can use the “Advanced Access” module of the SOA Client tool. This is how we manually test for various vulnerabilities. As we can see, by using one request we got one vulnerability, the server path disclosure, and a hint of another vulnerability, i.e., SQLI. One/some/all of the parameters might be vulnerable to SQLI; you just need to check each of the parameter to get the result.
What we have learned so far is how to use different modules of SOA Client to perform the manual web service penetration testing. There are restrictions, such as the fact that it sometimes won’t able to parse the request properly and, to test efficiently, we need the sample request.
Conclusion
Although there are certain limitations, SOA Client is a very light-weight and user-friendly GUI tool. We can use it in most of the cases while performing the penetration testing of web services. But there are certain cases where we are bound to choose another option.
Let’s say we need to perform a black box web services penetration testing: In that case, there is no way we will get the sample request from the client. What if the sample request is not exposed to public as it is exposed in our case for testfire.net? What if SOA Client is unable to parse some requests, as we see earlier in this article? We need some other tool to perform manual web services penetration testing and we will learn about that in the next installment.
References
https://addons.mozilla.org/en-US/firefox/addon/soa-client/