Skip to main content

Web Services Testing vs Web Application Testing

I have just performed Web Services Security Testing. It was my first encounter with WS testing. Learned a lot from the experience I gained. It's still premature thing, I mean there' s no an pr defined standard frameworks available as how to proceed for testing. Web Services Testing is much similar to conventional web application security testing , however it differs in some aspects. Web Services presents a new and expanded sphere to explore in addition to Web Applications. So it's critical to defend the web services also apart from Web Applications. For overview of Web Services please refer to my earlier post.
The similarities I found while testing Web Services:
  • Almost same cycle of testing as Web Apps like Information Gathering etc.
  • Almost all the OWASP top 10 vulnerabilities.
  • Susceptible to MITM ( Man in the middle) attack, however was not possible in our case as we have implemented certificate based encryption.
Few dissimilarities I came through was:
  • It's not a front end, it's totally a middle ware sort of thing or you can say back end services. So testing it involves a little different approach from testing web applications. You can't see a script gets executed on the front page, you have to carefully examine the SOAP response re tuned by the server. So identifying injection attacks is critical in this case.
  • As I said it's back end service, so you need some different tools to capture it. Traditional Web Application tools like Burp, Paros etc are not much helpful. You have got to get SOAP generating tools like SOAP UI, WS Digger, for manual testing or all automated tools have Web Services scanning capacity.
  • At conceptual level it's a bit confusing when you test it first time. You have to be sure about the internal structure of Web Services. Like Web App returning filed name is considered a flaw but in WS testing case it's not flaw.
  • You have to be familiar with SOAP request,headers,Message Encryption etc. everything is different from Web Apps.
  • In contrast to SSL, WS uses Message level encryption harder to break SSL.
In addition to conventional Web Application vulnerabilities these are few vulnerabilities I found during the testing:
  • XML Injection:Occurs when user input passed to XML stream XML parsed by second-tier app, Mainframe, or DB XML can be injected through application, stored in DB When retrieved from DB, XML is now part of the stream
    • <UserRecord>
      <Name>Henry Ackerman</Name>
      <Address>123 Disk Drive</Address>
It will add another node into the above XML tree as UniqueID=0

  • X Path Injection: If your application is using any XML file to authenticate the user then it might be susceptible to X Path Injection. X Paths are similar to using SQL queries to SQL server. It retrieves records from database based on the value. If not properly validated can be used to pass the authentication.
With Simple XPath Injection: ‘ or 1=1 or ‘’=‘

//user[name=‘nilesh’ or 1=1 or ‘’=‘’ and pass=‘anypassword’]

//user[name=‘nilesh’ or userid=1 or ‘’=‘’ and pass=‘anypassword’]/userid

The above queries retrieves username and passwords for against a given value. They are similar to SQL query 'select * form table where usrename='' and password='';'

  • WSDL Scanning: Web Services Description Language (WSDL) is an advertising mechanism for web services to dynamically describe the parameters used when connecting with specific methods. These files are often built automatically using utilities. These utilities, however, are designed to expose and describe all of the information available in a method.
    In addition, the information provided in a WSDL file may allow an attacker to guess at other methods. For example, a service that offers stock quoting and trading services may advertise query methods like requestStockQuote, however also includes an unpublished transactional method such as tradeStockQuote. It is simple for a persistent hacker to cycle thru method string combinations (similar to cryptographic cipher unlocking) in order to discover unintentionally related or unpublished application programming interfaces.
However there are more attacks apart form above described like authentication, MITM, clear text, Replay, Tampering but luckily or unluckily I didn't to test it as there was already message level encryption implemented using signed X 509 certificates. :)


justincarlos said…
Web Services which do not have typical user interfaces and cannot be readily tested with traditional automation tools often pose multiple challenges. Application Testing Services

Popular posts from this blog

File Upload through Null Byte Injection

Sometimes, during file upload we come across situation wherein there would be check on the file extension at the client side as well as server side too. If the application does allow only .jpeg extension to be uploaded, the client side java script checks for the extension of the file before passing the request. We all know that how easily this can be defeated.
Some applications, checks for the extension at the server side also. That's not easy to bypass. However there are some ways with which it still can be bypassed. Most of server side scripts are written in high level languages such as Php, Java etc who still use some C/C++ libraries to read the file name and contents. That leads to the problem. In C/C++ a line ends with /00 or which is called Null Byte. So whenever the interpreter sees a null byte at the end of the a string, it stops reading thinking it has reached at the end of the string.
This can be used for the bypass. It works for many servers, specially php servers. Th…

SQL Injection in search field

Earlier I had written about performing SQL injection in search field and how to do a DoS attack and privilege escalation using 'Like' operators. Now another SQLi exploitation I came across recently. That too in the search field. This becomes important as lots of people don't pay much attention on the search forms/ fields in the application. My aim is to show that a search form can also be exploited with SQL Injection. The following queries are based on a real world exploitation. The steps and data are for just illustration purpose only. Suppose, the search form provides the details of users who have accessed the application some time and their login time details etc, we just need to provide their name in the search box provided. All the data were being going as Post request. So, to just fingerprint the database, I provide, 'nil'+'esh' in the search field and it successfully gives me the results. That means the database behind the application is concatenat…

Insecure protocols

Some basic insecure protocols and risk associated with them: