Security Testing

Showing posts with label SQL Injection. Show all posts
Showing posts with label SQL Injection. Show all posts

Thursday, July 5, 2018

Difference between multiple security terms

Encoding
Encryption
Hashing
Maintaining data usability
Maintaining data confidentiality
Validating the integrity of content
Reversed data by  employing same algorithm
Reversed data by  secret key
Validate through the signature
No secret key
Use key
Signature by a sender

SQL Injection
Blind SQL Injection
Display error message
Does not see an error message
It does not ask ant question
It ask a true and false question to database
Attacker see the result
Attacker not see the result

SQL Injection
Cross-Site Scripting
Inserting query syntax
Embedded script tags in URL
Attacker send simple text based syntax
Attacker send simple text based script
Injecting SQL field value in the form of regular expression
Simple HTML tags in the form of the regular expression
It can be easily effected
It can be affect with average vulnerability

Cross-Site Scripting
Cross-Site Request Forgery
It doesn’t need authentication
Authenticated Session
Escape the basic validating
Server trust the user
Need of java script
Not need of javascript
A site that is vulnerable to XSS attacks is also vulnerable to CSRF attacks
A site that is completely protected from XSS types of attacks is still most likely vulnerable to CSRF attacks.

Denial of Service (DoS)

Denial of service attacks are most common to take website and servers down. It is easy to attack and hard to protect. The way to prevent of an attack is to block the response to the attackers. Catch the attacker as early as possible after the request has been received by the web server.

There are two challenges to blocking the attacks
               Identify the attackers
               Block the response only to the attackers
First to catch the request as early as possible, an HttpModule is the right place. It is executed before any page or any other handler so the impact on the server can be minimized. This HttpModule monitors all requests and block requests coming from IP addresses that make many requests in a short period of time. After a while the attacking IP address gets released from blocking.
Implementation
Download the DosAttackModule.cs file below and put it into the App_Code folder of your website. Then add the following lines to the web.config’s <system.web> section:
< httpModules >
< add type = " DosAttackModule " name = " DosAttackModule " />

</ httpModules >

Null byte Injection

It is also possible to pass the null character in the URL, which creates a vulnerability known as Null Byte Injection. In the URL it is represented by . A null byte is donated by \0 in C.

Exploitation:
Exploitation:
Exploitation:

Union SQL Injection

Union SQL Injection


In this attacker uses the UNION Statement for the attack which merges the two or more selected statement for retrieving the data from the database.
                                                                OR
UNION-based attacks allow the tester to easily extract information from the database. Using this extract the table name and number of column after that extract the data from the cell.
1.       url/order by 1
2.       url union select 1,2,3,4,5….
3.       url id=-1 union select 1,2,3,4,5….
4.       url id=-49 union select 1,2,@@ version,4,5,6

5.       url id=-49 union select 1,2, group_concate(database()),4,5,6

Blind SQL Injection

Blind SQL Injection 
It is nearly same as normal SQL injection but the difference is that it retrieved the data from the database. It asks a true and false question to the victim. An attacker force to steal the data by asking the question.
This attack is used when a web application is shown as a generic error message.


Two type of Blind SQL Injection

1.       Boolean based
2.       Time-based

Boolean Based:- This technique is sending a SQL query to the database which forces the different result in a True false form.
Time-based:- This technique is sending a SQL query to the database which forces the database to wait a specified time period. This allows to an attacker to inject payload used returned true or false, even though no data from the database is returned. 
Defend:
‘(Escape the single quote)= replace(input,””,””)
“(double quote)= replace(input,”””,””)
‘ ‘(close parenthesis)= replace(input,”’”,””)
;(semi-colon)

-(dash)

Thursday, May 17, 2018

Security Testing Procedure and Approaches

Security Testing
It is a type of software testing that checks whether the application or product is secured or not.
                                                Or
Security testing is performed to check whether there is any information leakage.
                                                Or
The goal of security testing is to identify the threats in the system and measure security risk.
                                                Or
Check the loopholes, weakness, and vulnerabilities of the web application.
                                                Or

Ensure that application is free from any loopholes or weakness.
Type of Security Testing
Vulnerability scanning: - This is done by the automated software to scan a system.
Security scanning: - Identify the network and system weakness and also provide the solution for reducing the risk.
Penetration Testing: - It is also known as pen test. Hacker malicious attack on the loophole or weakness of the system.
Risk Assessment: - Check the potential risk is either high or low. Analyze and evaluate the risk with the particular threats.
Security Auditing:-In this inspection of code line by line. It is a manual measurable technique of a system or application.
Ethical hacking:-It is systematical attempts to penetrate malicious script to exploit computer system or network on the behalf of the owner.
Procedure of web application security testing:-
1.       Scope of the application
2.       Check static and dynamic pages
3.       Identify the all login role of application
4.       Gather the information about the application
5.       Make profiling of the threats or security related test data.
6.       Security-related tools
7.       Test according to the threats profiling
8.       Scan application according to the threats profiling
9.       Report creation
Report submission

Approaches of web application security testing
·         Passive Approach- Actions taken to monitor the security
·         Understand the logic of the application
·         Information Gathering
·         Understand all the login role of the application
·         Active Approach-Covers all actions designed to prevent a breech
·         Configuration Management Testing.
·         Testing for file extensions which is a need or not need
·         Test file name without script tag
·         Test old, backup, temporary file not be left
·         Testing for HTTP methods
·         Testing for the business logic of the application
·         Testing for XSS(cross-site scripting)
·         Testing for SQL injection
·         Authentication Testing
·         Credentials transport over an encrypted channel
·         Testing false login credential to account lockout
·         Brute Force Testing
·         Testing for bypassing authorization schema
·         Session Management Testing
·         Test all headers for mitigating the XSS and CSRF
·         Testing for Cookies attributes- http only, secure and time validity
·         Testing for CSRF(cross-site request forgery)