This is an Open forum for Learn about security testing.Share your experience on security testing and tools.
Monday, March 30, 2009
SQL Injection
to construct SQL statements.
The following process helps you locate SQL injection vulnerabilities:
1. Look for code that accesses the database. Scan for the strings “SqlCommand,” “OleDbCommand,” or “OdbcCommand.”
2. Check that your code uses parameters in SQL statements.
If you do not use stored procedures, check that your code uses parameters in the
SQL statements it constructs, as shown in the following example:
select status from Users where UserName=@userName
Check that the following approach is not used, where the input is used directly to
construct the executable SQL statement using string concatenation:
String sql = "select status from Users where UserName='"+ txtUserName.Text + "'";
3. Check whether or not your code attempts to filter input.
A common approach is to develop filter routines to add escape characters to
characters that have special meaning to SQL. This is an unsafe approach, and you
should not rely on it because of character representation issues.
Code Review
reviews focus on identifying insecure coding techniques and vulnerabilities that
could lead to security issues. The review goal is to identify as many potential security
vulnerabilities as possible before the code is deployed. The cost and effort of fixing
security flaws at development time is far less than fixing them later in the product
deployment cycle.
Wednesday, March 25, 2009
Securing your network
High-Level Network Threats
- Information gathering
- Sniffing
- Spoofing
- Session Hijacking
- Denial of Service
Information gathering
Information gathering can reveal detailed information about network topology,System configuration, and network devices.
Sniffing :
Sniffing is an act of network monitoring for traffic data.There are lot many packet sniffing tools are available to monitor the network.(Ex :ethereal)
Spoofing :
Spoofing means hide one's own identity. A fake source address is used for attack the target.
Session Hijacking:
The session hijacking, also known as man in the middle attacks, the attacker uses an
application that masquerades as either the client or the server.
Denial of Service:
A Denial of Service attack is the act of denying users to access the server or services.
Snapshot of a Secure Network:
Router :
- Patches and Updates of Router operating system is patched with up-to-date software.
Protocols :
- Unused protocols and ports are blocked.
- Ingress and egress filtering is implemented.
ICMP traffic is screened from the internal network. - TTL expired messages with values of 1 or 0 are blocked (route tracing is
disabled). - Directed broadcast traffic is not forwarded.
- Large ping packets are screened.
- Routing Information Protocol (RIP) packets, if used, are blocked at the outermost router.
Administrative access:
- Unused management interfaces on the router are disabled.
- A strong administration password policy is enforced.
- Static routing is used.
- Web-facing administration is disabled
Services:
- Unused services are disabled.
Auditing and Logging :
- Logging is enabled for all denied traffic.
- Logs are centrally stored and secured.
- Auditing against the logs for unusual patterns is in place.
Intrusion detection :
- IDS is in place to identify and notify of an active attack.
Network ACLs :
- The network is structured so ACLs can be placed on hosts and networks.
Thursday, March 19, 2009
Web Application Vulnerablilites
Design- Input Validation: Attacks performed by embedding malicious strings in query strings, form fields ,cookies , and Http headers. (Command execution,cross-site scripting(XSS),SQL injection ,buffer overflow attacks).
- Authentication : spoofing,password cracking, and unauthorized access.
- Authorization : Access to confidential or restricted data,tampering and execution of unauthorized operations
- Configuration Management : Unauthorized access to administrative interfaces,unauthorized access to user accounts and profiles.
- Sensitive Data : Information disclosure and data tampering
- Auditing Logging : Failure to identify the intrusion,difficulties of identification
- Session Management : Capturing the session and hijacking them
- Cryptography : Breaking the Encrypted data by using encrypt and decrypt algorithms
- Exception Management : Handling the exceptions if the exceptions are not handled properly there may be a chance to crash the application.
Wednesday, March 18, 2009
Buffer Overflows Stack and Heap Manupulation
- Stack overflows .
- Integer overflows.
- Heap overruns.
- Format string attacks.
- Stack overflows : occur when variable size data is copied into fixed length buffers located on the program stack without any bounds checking.
- Integer overflows: Integer overflows occur when a specific data type or CPU register meant to hold values within a certain range is assigned a value outside that range.
- Heap overruns: Heap overrun occurs when data is written on outside of the space(Heap)
- Format string attacks :Format string attacks occur when the %n parameter of the format string is used to write data outside the target buffer
What is the meaning for Security
The Foundations of Security :
- Authentication : Authentication addresses Who are you?
- Authorization : Authorization addresses what can you do?
- Auditing : Effective Auditing is the key to non-reputation.
- Confidentiality : Confidentiality is also referred to as privacy.
- Integrity : Integrity is the guarantee for that the data is protected.
- Availability : Availability means the system remains available for legitimate users.
Tuesday, March 17, 2009
Threat Modeling
Threat model has three distinct
- Description of the security issues designer cares about.
- Description of a set of security aspects.
- Determining threats
Before you start the threat modeling you should understand the following basic terminology
- Asset : A resource of value such as a data in the data base or a file system .
- Threat: A potential occurrence
- Vulnerability : A weakness in some aspect ,vulnerability may exist at the network ,host, application levels
- Attack: An Action taken by some one following through the threat or vulnerability.
- Countermeasure : A safeguard that addresses a threat and mitigates the risk.
Threat Modelling Process:
- Identify the assets : Identify the valuable assets that your system can protect.
- Create an Architecture Overview: Use simple diagrams and tables to document the architecture of the application.
- Decompose the Application: Decompose the architecture of the application including the underlying network and host infrastructure.
- Identify the threats: Identify the threat that could affect the application.
- Document the threats: Document the threats using common threat template.
- Rate the threats : Rate the threats and prioritize the most significant threat first.
Threat model has become an integral part of Microsoft's SDL (Security Development Life Cycle). For more details about threat modeling please visit :
http://msdn.microsoft.com/en-us/security/aa570411.aspx.
Threat Modeling Tool :
The threat modeling tool allows the user to create a threat model documents for application.
For more details for download please visit:
An Approach to Security Testing
- Understand what you are testing
- Implement your ideas to find vulnerabilities on target
- Think like an attacker or a hacker
- Use some tools to identify the target defects(opensource,commercial)