Search

How to Hack a Web Server?

Over the past decade, more individuals have access to the internet than ever before. Many organizations develop web-based applications, which their users can use to interact with them. But improper configuration and poorly written codes in web servers are a threat and can be used to gain unauthorized access to the servers' sensitive data. This article tries to give an overview on Web Servers. We will be covering some topics which include working of a server, top web servers in the industry,web server vulnerabilities, web server attacks, tools and some counter measures to protect against such attacks. Among the biggest web server attacks was the breach of GitHub in 2018.                                 GitHub is the most popular online code management service used by millions of developers. On February 28, 2018 it was hit by the largest ever DDoS attack  The platform was not prepared for the massive influx of traffic, which peaked at a record-breaking 1.3 terabits per second. In this attack, there was no involvement of botnets, but instead, attackers used a method called mem caching; a caching system used to speed up websites and networks. The attackers could spoof GitHub’s IP address and then massively amplify the traffic levels directed at the platform. Luckily, within 10 minutes of the attack the company could contain and stop the attack from continuing as the company was using a DDoS Protection Service. What are Web Servers? Web servers are hardware, computer, or software, used to host websites. Web servers run on various operating systems connected to the back-end database and run various applications. The use of Web Servers has increased in past years as most online services are implemented as web applications. Web servers are mostly used in web hosting or the hosting of data for websites and web applications. How does Web Server work?  A web server can be accessed through a websites' domain name.  It ensures delivering the site's content to the requesting user by using Hypertext Transfer Protocol (HTTP). A Web server can be considered to be a hardware that is used to store or host the Web server's software and files related to websites. So a web server can be used to indicate the hardware or software or both together. It is used in the transfer of files, email communications, and for many other purposes. Web servers are so powerful that they can efficiently deliver the same file or any other file to thousands of website visitors simultaneously. Web Server Security Issue Web Servers may be vulnerable to network-level attacks and operating system attacks. Web Server as a hardware is used to store Web server software and files related to websites such as images, scripts, etc. Usually, an attacker will target vulnerabilities in the configuration of the web server and exploit it. Some Vulnerabilities may include : Inappropriate permissions of the directory Lack of security Bugs Misconfigured SSL certificates Enables unnecessary services Default setup Top 3 standard Web Server software Apache HTTP Server - This is the most common server used in the industry. Apache Software Foundation develops it and it is a free and open-source software for Windows, Mac OS, Linux, and many other Operating systems.  Microsoft Internet Information Services (IIS) - Microsoft develops this software for Microsoft platforms. It is not free or open-source. Nginx - This free and open-source software was created by Igor Sysoev and publicly released in 2004. This web server can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. Web Server Attacks      Web Server Attacks include many techniques. Some of them are provided below: Dos/DDoS -   Denial of Service where an attacker attacks by sending numerous service request packets overwhelming the servicing capability of the web server, resulting in crashing and unavailability for the users. DNS Server Hijacking -  DNS Server Hijacking, is also known as DNS redirection, where an attacker modifies DNS configurations. DNS redirection's primary use is pharming, where attackers display unwanted ads to generate some revenue, and Phishing--where attackers show fake websites to steal credentials.  DNS Amplification Attack -  A DNS Amplification Attack happens when an attacker spoofs the lookup request to the DNS Server with the DNS recursive method. The size of the requests results in a Denial of Service attack. Directory Traversal Attacks -  Directory traversal, also is known as Path Traversal, is an HTTP attack that allows attackers to access restricted directories and reveal sensitive information about the system using dot and slash sequences. Man in the Middle Attack -  A Man in the Middle / Sniffing attack happens when an attacker positions himself between a user and the application to sniff the packets. The attacker's goal is to steal sensitive information such as login credentials, credit card details, etc. Phishing Attacks -  A Phishing attack is a social engineering attack to obtain sensitive, confidential information such as usernames, passwords, credit card numbers, etc. It is a practice of fraudulent attempts that appear to come from a reputable source. Scammers mostly use emails and text messages to trick you in a phishing attack. Website Defacement - Website Defacement is an attack where an attacker changes the website/web page's visual appearance with their messages. SQL injection attack is mainly used in web defacement. An attacker can add SQL strings to craft a query maliciously and exploit the webserver.  Web Server Misconfiguration -  Web Server Misconfiguration is when unnecessary services are enabled, and default configurations are being used. The attacker may identify weaknesses in terms of remote functions or default certifications, and can exploit them. An attacker can easily compromise systems by some attacks such as SQL Injection, Command Injection. HTTP Response Splitting Attacks -  HTTP Response Splitting is a straightforward attack when the attacker sends a splitting request to the server, which results in the splitting of a response into two responses by the server. The second response is in the hand of the attacker and is easily redirected to the malicious website. Web Cache Poisoning -  A web cache is an information technology for storing web documents such as web pages, passwords and images temporarily. Web Cache Poisoning is a technique where the attacker sends fake entry requests to the server, wipes out all the server's actual caches and redirects the user to the malicious website. SSH Brute Force Attacks -  Brute force is where an attacker uses trial and error to guess login info by submitting many passwords or paraphrases. In an SSH Brute force attack, the intruder brute forces the SSH tunnel to use an encrypted tunnel. The encrypted tunnel is for communicating between the hosts. Hence, the attacker gains unauthorized access to the tunnel. Web Server Password Cracking Attacks -  In this attack, the attacker cracks the server password and uses it to perform more attacks. Some of the common password cracking tools are Hydra, John the Ripper, Hashcat, Aircrack, etc. Hacking Methodology Information Gathering Information Gathering is a process of gathering different information about the victim/target by using various platforms such as Social engineering, internet surfing, etc. Footprinting  Footprinting is a crucial phase where an attacker may use different tools to gather information about the target. In this phase, an attacker uses passive methods to find information about the victim before performing an attack. The attacker keeps minimum interactions with the victim to avoid detection and alerting the target of the attack. Footprinting can quickly reveal the vulnerabilities of the target system and can exploit them. There are various methods to gather information such as Whois, Google Searching, Operating system detection, network enumeration, etc.  Web Server Footprinting  In webserver footprinting, information is gathered using some specific tools that are focused on web servers such as Maltego,httprecon, Nessus, etc. resulting in details like operating system, running services, type, applications, etc. 1. Vulnerability Scanning -  Vulnerability scanning is the next process taken after performing footprinting to precisely target the attack . A vulnerability scanner is a computer program made to discover system weaknesses in computers and networks. Some methods used in vulnerability scanning are port scanning, OS detection, network services, etc. Common tools used for scanning are Nmap, Nikto, Nessus, and many more. Different Types of Vulnerability Scanning Vulnerability Scanning is classified into two types: unauthenticated and authenticated scans. Authenticated Scan: In this, the tester logs in as a network user and finds the vulnerabilities that a regular user can encounter. He also checks all the possible attacks by which a hacker can take benefit. Unauthenticated Scan: In this, the tester performs all the scans that a hacker would likely do, avoiding direct access to the network. These points can reveal how to get access to a network without signing in. 2. Session Hijacking -  Session Hijacking/ cookie hijacking is an exploitation of the web session. In this attack, the attacker takes over the users' sessions to gain unauthorized access to get information about its services. Session hijacking mostly applies to web applications and browser sessions.  The attacker needs to know the Session-Id (session key ) to perform session hijacking successfully. It can be obtained by stealing the session or just by clicking on some malicious links provided by the attacker. Once the attacker gets the key, he can take over the session using just the same session key, and the server will now treat the attacker's connection as the initial session.  3. Password Attacks -  Password cracking is a method of extracting passwords to gain authorized access to the legitimate user's target system. Password cracking can be performed using social engineering attack, dictionary attack, or password guessing or stealing the stored information that can help obtain passwords that give access to the system. Password Attacks are classified as: Non-Electronic Attack  Active Online Attack Passive Online Attack Default Passwords Offline Attack Defensive measures to Protect Webserver   For Securing a web server from internal and external attacks or any other threat, the essential recommendation is to keep it in a secure zone. Security devices like firewalls, IDS, and IPS must be deployed. Maintaining the servers in an isolated environment protects them from other threats.  Website Change Detection System is a technique used to detect any unexpected activity or changes in the Web server. Scripting is focused on inspecting any modifications made in the files used to detect hacking attempts.  To defend a web server from attack, do ensure that services on the web server are minimized. Disable all unnecessary and insecure ports. Always allow encrypted traffic only. Disable tracking. Continuously monitor your traffic to ensure there is no unauthorized activity. Use Port 443 HTTPS over 80 HTTP to secure web browser communication. Conclusion:In this article, we learnt about working of the web server, security issues, and hacking methodologies with various examples. As an ethical hacker it is important to know about the common web server attacks, and understand the use of best practices and defensive measures to protect web servers against any attack.

How to Hack a Web Server?

8K
How to Hack a Web Server?

Over the past decade, more individuals have access to the internet than ever before. Many organizations develop web-based applications, which their users can use to interact with them. But improper configuration and poorly written codes in web servers are a threat and can be used to gain unauthorized access to the servers' sensitive data. 

This article tries to give an overview on Web Servers. We will be covering some topics which include working of a servertop web servers in the industry,web server vulnerabilitiesweb server attackstools and some counter measures to protect against such attacks. 

Among the biggest web server attacks was the breach of GitHub in 2018.                                 

GitHub is the most popular online code management service used by millions of developers. On February 28, 2018 it was hit by the largest ever DDoS attack  The platform was not prepared for the massive influx of traffic, which peaked at a record-breaking 1.3 terabits per second. 

In this attack, there was no involvement of botnets, but instead, attackers used a method called mem caching; a caching system used to speed up websites and networks. The attackers could spoof GitHub’s IP address and then massively amplify the traffic levels directed at the platform. 

Luckily, within 10 minutes of the attack the company could contain and stop the attack from continuing as the company was using DDoS Protection Service. 

What are Web Servers? 

Web servers are hardware, computer, or software, used to host websites. Web serverrun on various operating systems connected to the back-end database and run various applications. The use of Web Servers has increased in past years as most online services are implemented as web applications. Web servers are mostly used in web hosting or the hosting of data for websites and web applications. 

How does Web Server work?  

How does Web Server work?  A web server can be accessed through a websites' domain name.  It ensures delivering the site's content to the requesting user by using Hypertext Transfer Protocol (HTTP). Web server can be considered to be a hardware that is used to store or host the Web server's software and files related to websites. So a web server can be used to indicate the hardware or software or both together. It is used in the transfer of files, email communications, and for many other purposes. Web servers are so powerful that they can efficiently deliver the same file or any other file to thousands of website visitors simultaneously. 

Web Server Security Issue 

Web Servermay be vulnerable to network-level attacks and operating system attacks. Web Server as hardware is used to store Web server software and files related to websites such as images, scripts, etc. Usually, an attacker will target vulnerabilities in the configuration of the web server and exploit it. 

Some Vulnerabilities may include : 

  • Inappropriate permissions of the directory 
  • Lack of security 
  • Bugs 
  • Misconfigured SSL certificates 
  • Enables unnecessary services 
  • Default setup 

Top 3 standard Web Server software 

  • Apache HTTP Server - This is the most common server used in the industry. Apache Software Foundation develops it and it is a free and open-source software for Windows, Mac OS, Linux, and many other Operating systems.  
  • Microsoft Internet Information Services (IIS) - Microsoft develops this software for Microsoft platforms. It is not free or open-source. 
  • Nginx - This free and open-source software was created by Igor Sysoev and publicly released in 2004. This web server can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. 

Web Server Attacks      

Web Server Attacks include many techniques. Some of them are provided below: 

  • Dos/DDoS -   

Denial of Service where an attacker attacks by sending numerous service request packets overwhelming the servicing capability of the web serverresulting in crashing and unavailability for the users. 

  • DNS Server Hijacking -  

DNS Server Hijacking, is also known as DNS redirection, where an attacker modifies DNS configurations. DNS redirection's primary use is pharming, where attackers display unwanted ads to generate some revenue, and Phishing--where attackers show fake websites to steal credentials.  

  • DNS Amplification Attack -  

DNS Amplification Attack happens when an attacker spoofs the lookup request to the DNS Server with the DNS recursive method. The size of the requests results in a Denial of Service attack. 

  • Directory Traversal Attacks -  

Directory traversal, also is known as Path Traversal, is an HTTP attack that allows attackers to access restricted directories and reveal sensitive information about the system using dot and slash sequences. 

  • Man in the Middle Attack -  

A Man in the Middle / Sniffing attack happens when an attacker positions himself between a user and the application to sniff the packets. The attacker's goal is to steal sensitive information such as login credentials, credit card details, etc. 

  • Phishing Attacks -  

A Phishing attack is a social engineering attack to obtain sensitive, confidential information such as usernames, passwords, credit card numbers, etc. It is a practice of fraudulent attempts that appear to come from a reputable source. Scammers mostly use emails and text messages to trick you in a phishing attack. 

  • Website Defacement - 

Website Defacement is an attack where an attacker changes the website/web page's visual appearance with their messages. SQL injection attack is mainly used in web defacement. An attacker can add SQL strings to craft a query maliciously and exploit the webserver.  

  • Web Server Misconfiguration -  

Web Server Misconfiguration is when unnecessary services are enabled, and default configurations are being used. The attacker may identify weaknesses in terms of remote functions or default certifications, and can exploit them. An attacker can easily compromise systems by some attacks such as SQL Injection, Command Injection. 

  • HTTP Response Splitting Attacks -  

HTTP Response Splitting is a straightforward attack when the attacker sends a splitting request to the server, which results in the splitting of a response into two responses by the server. The second response is in the hand of the attacker and is easily redirected to the malicious website. 

  • Web Cache Poisoning -  

A web cache is an information technology for storing web documents such as web pages, passwords and images temporarily. Web Cache Poisoning is a technique where the attacker sends fake entry requests to the serverwipes out all the server's actual caches and redirects the user to the malicious website. 

  • SSH Brute Force Attacks -  

Brute force is where an attacker uses trial and error to guess login info by submitting many passwords or paraphrases. In an SSH Brute force attack, the intruder brute forces the SSH tunnel to use an encrypted tunnel. The encrypted tunnel is for communicating between the hosts. Hence, the attacker gains unauthorized access to the tunnel. 

  • Web Server Password Cracking Attacks -  

In this attack, the attacker cracks the server password and uses it to perform more attacks. Some of the common password cracking tools are Hydra, John the Ripper, Hashcat, Aircrack, etc. 

Hacking Methodology 

  • Information Gathering 

Information Gathering is a process of gathering different information about the victim/target by using various platforms such as Social engineering, internet surfing, etc. How to Hack a Web Server?

  • Footprinting 

 Footprinting is a crucial phase where an attacker may use different tools to gather information about the target. In this phase, an attacker uses passive methods to find information about the victim before performing an attack. The attacker keeps minimum interactions with the victim to avoid detection and alerting the target of the attack. Footprinting can quickly reveal the vulnerabilities of the target system and can exploit them. There are various methods to gather information such as Whois, Google Searching, Operating system detection, network enumeration, etc.  

  • Web Server Footprinting  

In webserver footprinting, information is gathered using some specific tools that are focused on web servers such as Maltego,httprecon, Nessus, etc. resulting in details like operating system, running services, type, applications, etc. 

1. Vulnerability Scanning -  

Vulnerability scanning is the next process taken after performing footprinting to precisely target the attack . A vulnerability scanner is a computer program made to discover system weaknesses in computers and networks. Some methods used in vulnerability scanning are port scanning, OS detection, network services, etc. Common tools used for scanning are Nmap, Nikto, Nessus, and many more. 

Different Types of Vulnerability Scanning 

Vulnerability Scanning is classified into two types: unauthenticated and authenticated scans. 

  • Authenticated Scan: In this, the tester login as a network user and finds the vulnerabilities that a regular user can encounter. He also checks all the possible attacks by which a hacker can take benefit. 
  • Unauthenticated Scan: In this, the tester performs all the scans that a hacker would likely do, avoiding direct access to the network. These points can reveal how to get access to a network without signing in. 

2. Session Hijacking -  

Session Hijacking/ cookie hijacking is an exploitation of the web session. In this attack, the attacker takes over the users' sessions to gain unauthorized access to get information about its services. Session hijacking mostly applies to web applications and browser sessions.  

The attacker needs to know the Session-Id (session key ) to perform session hijacking successfully. It can be obtained by stealing the session or just by clicking on some malicious links provided by the attacker. Once the attacker gets the key, he can take over the session using just the same session key, and the server will now treat the attacker's connection as the initial session.  

3. Password Attacks -  

Password cracking is a method of extracting passwords to gain authorized access to the legitimate user's target system. Password cracking can be performed using social engineering attack, dictionary attack, or password guessing or stealing the stored information that can help obtain passwords that give access to the system. 

Password Attacks are classified as: 

  • Non-Electronic Attack  
  • Active Online Attack 
  • Passive Online Attack 
  • Default Passwords 
  • Offline Attack 

Defensive measures to Protect Webserver   

For Securing a web server from internal and external attacks or any other threat, the essential recommendation is to keep it in secure zone. Security devices like firewalls, IDS, and IPS must be deployed. Maintaining the servers in an isolated environment protects them from other threats.  

Website Change Detection System is a technique used to detect any unexpected activity or changes in the Web server. Scripting is focused on inspecting any modifications made in the files used to detect hacking attempts.  

To defend a web server from attack, do ensure that services on the web server are minimized. Disable all unnecessary and insecure ports. Always allow encrypted traffic only. Disable tracking. Continuously monitor your traffic to ensure there is no unauthorized activity. Use Port 443 HTTPS over 80 HTTP to secure web browser communication. 

How to Hack a Web Server?

Conclusion:

In this article, we learnt about working of the web server, security issues, and hacking methodologies with various examples. As an ethical hacker it is important to know about the common web server attacks, and understand the use of best practices and defensive measures to protect web servers against any attack.

KnowledgeHut

KnowledgeHut

Author

KnowledgeHut is an outcome-focused global ed-tech company. We help organizations and professionals unlock excellence through skills development. We offer training solutions under the people and process, data science, full-stack development, cybersecurity, future technologies and digital transformation verticals.
Website : https://www.knowledgehut.com

Join the Discussion

Your email address will not be published. Required fields are marked *

Suggested Blogs

How To Clear CEH in First Attempt?

Cybercrime and hacking attacks are doubling year on year. Not just corporate giants and government entities, but even small scale companies and start-ups are afraid of being victims of cyber theft. Organizations may face major losses not just in their profits but also loss of reputation, data, and customers. Therefore, almost all organizations want to keep their data and privacy of their customers safe from cyber criminals. These organizations spend a fortune on implementing robust technology architecture and on hiring professionals who can identify loopholes in the cyber security systems and patch them up before hackers can get through. These professionals, known as ethical hackers or white hat hackers, can help organizations protect their assets (people, process, and technology) from cybercriminals.Why CEH? The exponential rise in data, and our dependence on virtual systems has also consequently raised attacks from cyber criminals and data breaches. This has made the role of the ethical hacker among the most important job roles in these times. There is a huge demand for cybersecurity experts in almost all types of businesses. To hire security experts, organizations have some basic or minimum benchmarks set. These security experts are expected to have a good understanding of security concepts, and knowledge of the latest tools, processes, and frameworks so that they can be one step ahead of cyber criminals and prevent data breach.  This is where certifications such as the CEH - Certified Ethical Hacker by EC-Council comes into play. The CEH is the most comprehensive program for ethical hackers as it covers the latest hacking trends and familiarises professionals with the technologies that will help prevent data breaches. This international accreditation is recognised world over, so no matter where you are, your skills and knowledge will be considered valid by all organizations, anywhere in the world. To defeat the hacker, you need to think like a hacker. This program is all about developing the hacker mindset but in an ethical way. Once you are ready to jump into this, passing the CEH exam is your 1st milestone in your career. In this article, we will learn how to become a certified ethical hacker in the very first attempt, for which hard work and dedication are highly recommended.  Preparation Steps We will discuss here the 5 steps to prepare for CEH certification.  1. Plan the training Once you decide to achieve the certification, you need a concrete plan for training as well as practice. Choose the best source for training. We highly recommend choosing offline classroom training if you are a student or novice in cybersecurity. Usually, you can complete training in 3-4 months or less.  The reason we recommend an offline course is that meeting other like-minded learners and professionals will help you  develop the ethical hacker mindset. You can get in touch with proper mentors, people with similar mind-sets and take advantage of group study which can reveal many unknown issues, incidents, and examples. Of course, this will cost you more but you can’t learn to swim without getting wet.2. Get your hands dirty – Practice! The plus point of the latest version of CEH v11 is that it is more focused,  practical based and scenario-based with the latest content that equips students with hands-on skills. Remember, security is all about practice and implementation rather than a bunch of documents and do’s and don’ts checklist. In the course of gaining the credential you will learn about methods and tools that you can use to protect the organization such as security implementations, testing, and monitoring. Just bookish knowledge won’t help there. We recommend that spending at least 2 hours daily practice apart from training will improve your skills dramatically.3. Study Guides  While we did mention above not to be bookish, books are a treasure trove of knowledge and even for clearing the CEH you must do a thorough read of the recommended books.  You can religiously follow study guides and clear your concept on every topic in a very descriptive manner. This will answer all your “What and Why” in terms of cybersecurity and ethical hacking. Of course, this is world-class content and therefore you will get exact definitions, descriptions, and diagrams for almost all topics. We recommend studying at least 1 hour daily to get clear on all topics during the training.  4. Study groups - Community Study groups will polish your knowledge and skills for CEH topics. There are many study groups you can join where you can resolve your queries, clear your doubts, take help to learn something, and help others too. This will help you to stay in the company of like-minded people and you will get to learn fast.  However, it is recommended not to share any personal/sensitive information. Beware of any unknown person who asks for sensitive information like your IP address, location, personal information, or anything apart from CEH courseware.   We recommend making a study group with the people you know who are also attempting the exam. You can take the help of your trainer or mentor to manage this group. Be active and participate in group activities like quizzes or group discussions. 5. Self-assessment Keep learning is the key element of CEH training. Brush up your knowledge for the exam perspective as that is your main goal to become certified. For this, you need to learn how to give the exam and what type of questions are asked. For a second, let’s imagine the scenario of a war. If a new trainee soldier having knowledge of arms and wearing his 15 kgs protective suit jumped into the warzone, do you think he can fight better and save the lives of others without having any practice? Probably not, because he is unaware of war scenarios, combat methods, and ways of attack and defense in real war zones where the situation is uncertain. The same concept applies to CEH exams. You may face a lot of weird-looking or twisted or tricky questions with confusing multiple answers. Therefore, once you are done with your CEH training and you have knowledge of all topics, you need to test it like a mock drill of the war zone.There are many sources available where you can practice the exam questions. This platform will help you to understand the methods to ace the exam questions, and complete them within the required timeframe. Here we are sharing some links to practice for your exams. ( Note: We do not promote any website or any platform here. These links are shared to help students find good options for studying.) CEH ASSESSMENT- EC-CouncilEC-Council® CEH™ Exam PrepCEH practice examApart from this, you can follow blogs, industry experts, and relevant videos for more understanding and guidance.Required soft skills Every job roles needs certain skills apart from the core skills needed to perform on the job. These include soft skills that will help you grow as an individual and as a professional.Be Curious – Be hungry for knowledge and for learning new things and gaining new skills.  Be Enthusiastic - Be enthusiastic and motivated throughout your journey as a hacker and you will be rewarded.  Eliminate the distractions - Avoid time-wasting or non-productive activities during the training like spending time on online games or social media. About the exam After getting trained and completing your practice, it is time for the exam. The CEH exam is a 4 hour exam with 125 multiple choice questions. Check the below link for the exam blueprint to get an idea of the percentage ratio of each module during the CEH exam. Examination centres can be chosen based on your location. Keep your exam code with you. The exam organizers have a process to determine the difficulty rating of each question. For more information, you can check out the EC-Council website and get in touch with your training center.Conclusion So, start your journey on becoming a certified cyber security professional with the CEH course and credential. As with anything else, practice makes perfect and you will become better as an ethical hacker with practice. Work hard and you will definitely achieve your CEH certification at the very first attempt. 
9620
How To Clear CEH in First Attempt?

Cybercrime and hacking attacks are doubling year o... Read More

What Is SQL Injection (SQLi)

In today’s world cyber-attacks are triggered to alter or steal the information of a person or an organization in a huge volume of data. It is very much important to protect the data/database from security related attacks.SQL injection is one of the top trending cyber attack techniques recognized by the world’s top non-profit security foundation OWASP (Open Web Application Security Project). SQL injection attacks are made by inserting or injecting the SQL query input from the client end of the application. In this article, we will learn about the SQL injection, types of attacks using SQL injection and preventive steps.  What is SQL Injection? SQL injection attack is used to insert malicious SQL statements into an entry field for execution. This injection technique is the most common web application hacking attack that allows an attacker to get unauthorised access, commit identity spoofing, tamper, take control or destroy your database. This is an attack that is very simple and easy to carry out even for script kiddies.  As we can see in the above picture, this is the second most common vulnerability that can impact databases. SQL injection flaws occur because of poorly designed web applications that can exploit SQL statements that execute malicious code.  How SQL injection is used is very much dependent on the intention of the hacker. With unauthorized access to a database server, what can attackers do? Here are some examples: Download unauthorized data of a person or an organization Delete/modify data Permanently destroy data/backups Add a virus to a system Alter security Encrypt/steal/alter data and hold it for ransom Publicly shame an organization via a web or social media hack Use data to harm business operations How does SQL injection work? To understand SQL injection, you need to know what SQL is.   SQL – SQL stands for Structured Query Language. This language is mainly developed for interacting with the relational database. For data manipulation, Query is used to insert data, modify the database, or just to access the required data.Image SourceSQL Injection is one of the most vulnerable threats which may exploit the entire database of any private organization or government sector where code is injected in a web page.  An SQL statement will be altered in a manner which goes with ALWAYS TRUE as constraint. (In simple words 1=1  This will be always true) It allows an attacker to view unauthorized data. This might include data belonging to other users, or any other data that the application itself is able to access. An attacker can modify or delete this data, causing persistent changes to the application’s content or behavior.SQL injection TypesThere are a wide variety of SQL injection vulnerabilities, attacks, and techniques, which arise in different situations. Some common SQL injection examples include:Tautologies – Used to Bypass AuthenticationSelect * from USERTable where uid=‘xyz’ and pwd =’x’ or ‘5’=’5’;Union – Used to Extract Data. A different dataset is returned from the Database.  Illegal/Logically Incorrect Queries - Used to Identify injectable parameters.  Piggybacked Queries - Multiple queries are executed without the knowledge of the user which may lead to Database exploitation. Injected queries are added to the normal executable query. Inference - Different responses from the database are cross checked by changing its behavior.  Stored procedure - Injection is done to the stored procedure present in the Database.Common Causes and how to avoid SQL Injection Attack-If we are assuming our application’s code/web forms are well protected against any kind of attack by default, application changes and assumptions that were true in the past or present may not be true in the future and may require additional changes. These assumptions eventually lead to compliance and security auditing failures. Using unsupported or legacy software/code/tools or features may lead to security holes and there could be chances of delay in catching or fixing such issues. Running patched and upgraded versions of code is critical to avoid security exploits. Continuously monitoring for new security vulnerabilities and reacting as needed is an important step towards avoiding unnecessary surprises. Reviewing old code is very important, and timely changes in the code are highly recommended as technologies keeps changing. The versions, functions, and extensions require regular upgrades. Older versions or codes are quite vulnerable and might be unable to maintain the integrity of your application. How to detect SQL injection vulnerabilitiesAs a pentester, you can use two techniques to find SQL injection vulnerabilities with high efficiency - manual and automated testing.Manual Testing During application development there are set of tests performed on each level, that help to detect any SQL injection vulnerability, if it exists. Check with the single ' character ‘ and look for errors or other anomalies. The tester can add some SQL specific syntax into code that can evaluate the original value of the entry point and other values, and check for different responses by the application. Another method is to create a Boolean condition, for example “OR 1=1” and “OR 1=2”, and check again to see if the application response is different.  There are some payloads available that are designed to trigger time delays if executed in SQL query, and you can check if there is any delay in response. Automated TestingThere are many good tools and frameworks available in the market. Here is the list of some of the best tools for SQL injection detection. SQLMap Appsider by Rapid7 Accunetix Wapiti Netsparker etc.How to prevent SQL injection vulnerability? To prevent or avoid SQL injection vulnerability, we must first understand why it occurs, and why it is listed as one of the vulnerabilities in the OWASP top 10.  The SQL injection is so easy to perform, that even a script kiddie can make an attempt.  Another reason is the treasure of critical data that lures the attacker to use SQL injection.  Below is the vulnerable code for SQL injection where the user input is concatenated directly into the query: String query = “;SELECT * FROM products WHERE category = ‘";+ input + "’" Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(query); Check out the code below that helps to prevents the user input from interfering with the query structure: PreparedStatement statement = connection.prepareStatement("SELECT * FROM products WHERE category = ?");  statement.setString(1, input);  ResultSet resultSet = statement.executeQuery(); Primary recommendations: Use Parameterised queries  Least Privilege Use stored procedures if required White listing the input fields Avoid displaying detailed error messages that are useful to an attacker. It is also important to get patch updates regularly, as every day there are many new vulnerabilities that are found.  It is also recommended to use a Web Application Firewall to protect your application, which can help you to filter and find malicious data.  Where Do We Go Next? It is very important to identify and mitigate this notorious vulnerability and take immediate actions to keep your systems secure. Many skilled attackers are waiting to take advantage of your mistakes, like poor code, so that they can hack into the database. We know this vulnerability is very old but we have to be aware of the outcomes of this type of vulnerability and try to prevent this during the development phase, rather than covering up the liability later.  
7374
What Is SQL Injection (SQLi)

In today’s world cyber-attacks are triggered to ... Read More

The Importance Of PCI ; Data Security Standard (DSS)

As the world moves towards digital means of payments and transactions, there has also been concerns over the security and protection of cardholder information. According to the PCI Security Standards Council, more than 500 million card holder records with confidential information have been breached since 2005. Merchants, who accept digital forms of payments, are at the centre of digital payments, and can become a victim of financial fraud at multiple points, including: • The point-of-sale device or machine • Wireless hotspots • Connected computer or any other device • Transmission of the cardholder data to the service provider. Risk factors According to a business survey conducted by Forrester Consulting, a majority of businesses conduct activities increase the risk of card fraud, including storage of card number, expiration date, any verification code, and customer date. Introduction to Data Security Standard (DSS) The Payment Card Industry’s Data Security Standard (PCI-DSS) is a security standard mandatory for organizations that handle payments using cards, issued from major card types including MasterCard, Visa, and American Express. This PCI standard is mandatory for all card brands and is administered by the PCI Security Standards Council. The sole aim of the PCI standards is to protect cardholder data and to reduce card frauds. Objectives The objective of PCI-DSS course is the protection of cardholder data during storage, processing, and transmission. Cardholder account information includes the unique primary account number (PAN) printed in the front of every card. Merchants or any service provider, who process card payments, must never store sensitive information about the transaction after the authorization. This includes confidential data that is stored in the magnetic stripe of the card, along with any personal identification information entered by the cardholder. Requirements The PCI Data Security Standards specifies a list of 12 mandatory requirements, which are grouped under 6 control objectives, as listed below: 1) Build and maintenance of a high-security network, which includes: * Installation of a secure firewall to protect cardholder data. This restricts (or blocks) all traffic from untrusted networks, and prohibit direct public access between the Internet and the cardholder data environment. * Changing of the vendor-provided default password and other security measures. This is important as most card fraudsters are able to break into the cardholder’s internal network using the default passwords. 2) Protection of cardholder information, which includes: * Encryption of cardholder information that is transmitted over public networks. Encryption technology renders the transmitted data unreadable by any unauthorized person. Use of cryptography and security protocols such as SSL/TLS or IPSec can be used to safeguard customer data. * Protection of the stored cardholder data. Sensitive data on the magnetic chip of the card must not be stored. In case the PAN needs to be stored, it must be stored in an unreadable format. Limit the duration of storage of cardholder data. 3) Maintenance of a vulnerability management program, which includes: * Use and regular updates of anti-virus software programs on all systems. Harmful viruses can enter the user network through email and other online activities. Anti-virus software is an effective tool to protect computer systems from external attacks. * Development and maintenance of secure systems and applications. Security vulnerabilities in the system and applications can enable cyber criminals to access PAN and other secure data. Ensure that all the systems and application are updated with the latest security patch from the vendor. 4) Secure access control measures, which includes: * Restricting business access to cardholder information. Limit access to confidential cardholder data to only those users whose work requires this information. Additionally, restrict the access to the least amount of data required for business purpose. * Assigning of a unique ID to every person with computer access. This is important to be able to trace if the access to critical data has been executed by only authorized persons. 5). Restricting of the physical access to cardholder data. Physical access to cardholder data must be restricted to all onsite personnel, visitors, and all paper and electronic media. 6) Regular monitoring and testing of networks, which includes: * Tracking and monitoring of all access points to network resources and cardholder data. Use of logging mechanisms and tracking of user activities are included. * Regular testing of security procedures and processes. Periodic testing of security controls is important, along with internal and external network scans. 7) Maintaining of an information security policy, which includes: * Maintenance of a company policy that addresses information security. This includes establishing a security policy that addresses all the PCI-DSS requirements, along with an annual process to detect any vulnerability. These set of requirements is mandatory for companies that manufacture devices that accept and process PIN-based transactions or any other type of digital payments. Financial institutions, merchants, and service providers must ensure that they only use devices, approved for PTS (PIN transaction security).
The Importance Of PCI ; Data Security Standard (DS...

As the world moves towards digital means of paymen... Read More