--- name: Title class: middle, center # Introduction *** Who we are!
OWASP Kerala lead OWASP Testing Guide Maintainer OWASP SecureTea Project Lead Developer AppSec Browser Bundle ### Join Chat: https://cutt.ly/sec-suyati --- name: restting-vs-reverting class: middle, center, changebg # Day 1 --- # Why web application security is of high importance *** -- - World Wide Web has become a powerful platform for application delivery -- -- - Sensitive data increasingly made available through web applications -- -- -
breachlevelindex
-- -- - 98 % of the web applications are vulnerable. -- -- - 78% of easily exploitable weakness occur in web applications. -- --- # Famous last words... *** -- - “Nobody would bother to hack us.” -- -- - “Our network firewall will keep us safe.” -- -- - “We will add security to the system later.” -- -- - “What's the worst that could actually happen?” -- --- # Basic Methodology of Security testing *** -- 1. Information Gathering -- -- 2. Scanning -- -- 3. Gaining Access -- -- 4. Post Exploitation -- -- 5. Reporting -- --- # Information Gathering *** - The reconnaissance phase is the most important phase of the hacking methodology. - The importance of reconnaissance is to accumulate important information and facts about the selected target. Two types of reconnaissance 1. Active reconnaissance 2. Passive reconnaissance --- # Passive reconnaissance *** Passive reconnaissance is what happens when you don’t communicate with the target. This is accomplished by inspecting the webpage, exploring Google, studying social media accounts for information and much more. In short, you’re watching for any data that can be applied to hold against the target. Search for common user names for the website. If its an indian website there will be some - Rahul - Manu :) --- # Robots.txt ***
www.google.com/robots.txt
- shows files that the administrator does not want search engines to crawl - Don’t show confidential information in this file --- # Search engine discovery *** ## Google Dorks - Site: - Inurl: - Intext: - Cache: - Filetype: - link:
--- # To Do ***
https://bit.ly/2s4Gieh
https://bit.ly/35l2D5r
HackSearch
--- # Public and Restricted Websites *** -
www.netcraft.com
-
www.archive.org
-
www.shodan.io
-
https://osint.link
-
https://osintframework.com
-
https://web.archive.org/web/19981202230410/http://www.google.com/
--- # shodan *** ## TO_DO ### Basic Search Filters **port**: Search by specific port **net**: Search based on an IP/CIDR **hostname**: Locate devices by hostname **os**: Search by Operating System **city**: Locate devices by city --- # shodan *** ### Basic Search Filters **country**: Locate devices by country **geo**: Locate devices by coordinates **org**: Search by organization **before/after**: Timeframe delimiter **hash**: Search based on banner hash **has_screenshot**:true Filter search based on a screenshot being present **title**: Search based on text within the title --- # To Do -
www.builtwith.com -
www.netcraft.com
- wappalyzer --- # Active reconnaissance *** - Active reconnaissance is the phase you apply when you are investigating your target. - It involves communicating directly with the target. It is necessary to perceive that during this method, the target may log your IP address and log your movement. --- # Scanning *** - After footprinting and reconnaissance, scanning is the next stage of information gathering that hackers apply. Scanning is where hackers enter into the system to scan for relevant data and settings in a particular IP address series. --- # Nmap *** Nmap, short for Network Mapper, is a free, open-source tool for vulnerability scanning and network discovery. Network administrators use Nmap to identify what devices are running on their systems, discovering hosts that are available and the services they offer, finding open ports and detecting security risks. --- # Hands_on *** ## nmap - Tcp scan - Udp scan - Packet fragmentation for evading IDS/IPS - MAC Spoofing - Full Port scan --- # CVE *** - https://cve.mitre.org/ - https://www.cvedetails.com/vulnerability-list/vendor_id-10938/Unrealircd.html --- # Gaining Access/exploitation *** In the simplest words, exploitation is the method of gaining authority over a system. However, it is necessary to know that not every exploit points to complete system compromise. More precisely described, an exploit is a method to avoid a security defect or bypass security checks. This method can take many diverse patterns. --- # Hands_on *** ## Metasploit Hacking linux server running unreal irc client. Exploit server using metasploit. and getting touch with the tool. --- # Post Exploitation *** post exploitation essentially means the stages of the ethical hacking job once a sufferer’s system has been jeopardized by the hacker. The condition of the endangered system is defined by the utility of the real data stored in it and how a hacker may gain the advantage of it for wicked ideas. --- # Reporting *** - Like every other phase we have mentioned, drafting a sound ethical hacking report is crucial. - Mastering to put a well-written report is important for getting clients and getting a prospective job.
https://www.owasp-risk-rating.com/
https://www.first.org/cvss/calculator/3.1
--- # Password Attacks *** ## Password Cracking Password cracking is the process of recovering passwords from data that have been stored in or transmitted by a computer system. Ex: Hashcat(tool) ## Brute-Force A brute force attack is a trial and error method used by application programs to decode encrypted data such as passwords or Data Encryption Standard (DES) keys, through exhaustive effort (using brute force) rather than employing intellectual strategies. Ex: John the ripper(tool) --- # Password Attack *** ## Cracking Hash cracking md5 hash using john the ripper. --- # Password Attack *** ## Brute Forcing Bruteforcing Wordpress admin panel using wpscan tool. --- # Packet Sniffing *** When any data has to be transmitted over the computer network, it is broken down into smaller units at the sender’s node called data packets and reassembled at receiver’s node in original format. It is the smallest unit of communication over a computer network. It is also called a block, a segment, a datagram or a cell. The act of capturing data packet across the computer network is called packet sniffing. --- # Wireshark *** Wireshark is a network or protocol analyzer. Wireshark intercepts traffic and converts that binary traffic into human-readable format. This makes it easy to identify what traffic is crossing your network --- # Packet Sniffing *** ## Wireshark - Capturing telnet packets, analysing and retrieving password in plain text. - Capturing HTTPS packets, and analysing --- # Malware *** The term malware is a contraction of malicious software. Put simply, malware is any piece of software that was written with the intent of damaging devices, stealing data, and generally causing a mess. Types of malwares are - Viruses - Worms - Ransomware --- # Virus *** A computer virus is a malicious program that self-replicates by copying itself to another program. In other words, the computer virus spreads by itself into other executable code or documents. The purpose of creating a computer virus is to infect vulnerable systems, gain admin control and steal user sensitive data. --- # Worms *** A computer virus is a malicious program that self-replicates by copying itself to another program. In other words, the computer virus spreads by itself into other executable code or documents. The purpose of creating a computer virus is to infect vulnerable systems, gain admin control and steal user sensitive data. --- # Ransomware *** - Ransomware, is a type of malware that prevents users from accessing their system or personal files and demands ransom payment in order to regain access. - There are a number of vectors ransomware can take to access a computer. One of the most common delivery systems is phishing spam — attachments that come to the victim in an email, masquerading as a file they should trust. --- # Cryptography *** Cryptography refers to secure information and communication techniques derived from mathematical concepts and a set of rule-based calculations called algorithms to transform messages in ways that are hard to decipher. - Symmetric-key Cryptography - Public-Key Cryptography - Hash Functions --- # Encryption *** Encryption is the method by which information is converted into secret code that hides the information's true meaning. The science of encrypting and decrypting information is called cryptography. Encryption algorithms: - AES - Diffie-Hellman key exchange - RSA --- name: restting-vs-reverting class: middle, center, changebg # THANK YOU --- name: restting-vs-reverting class: middle, center, changebg # Day 2 --- # SSL Testing *** A Secure Socket Layer test (SSL test) is the testing of an SSL server, certificate or site. SSL tests help to indicate the approval of an SSL certificate, or whether an SSL system is set up correctly. --- # How HTTPS works *** Why we need: - Privacy - Integrity - Identification --- # HTTPS Explained *** - https://howhttps.works/why-do-we-need-https/ - https://howhttps.works/the-handshake/ --- # To Do *** - https://pypi.org/project/sslcheck/ - https://observatory.mozilla.org/ - https://www.ssllabs.com/ - https://github.com/nabla-c0d3/sslyze - SSLscan - Kali --- # Web vulnerability and exploitation *** ## Cross-Site Scripting Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker to compromise the interactions that users have with a vulnerable application. ## Types of XSS - Reflected XSS, where the malicious script comes from the current HTTP request. - Stored XSS, where the malicious script comes from the website's database. - DOM-based XSS, where the vulnerability exists in client-side code rather than server-side code. --- # XSS *** ## Hands_on real world examples to for xss. Google dorks: - inurl:”.php?file=” - inurl:”.php?from=” - inurl:”.php?keyword=” - inurl:”.php?mail=” --- # Content Security Policy (CSP) *** Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to distribution of malware. --- # Content Security Policy (CSP) *** `Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com` Here, by default, content is only permitted from the document's origin, with the following exceptions: Images may load from anywhere (note the "*" wildcard). Media is only allowed from media1.com and media2.com (and not from subdomains of those sites). Executable script is only allowed from userscripts.example.com. --- # Cross-Origin Resource Sharing (CORS) *** Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own. --- # SameOriginPolicy *** To explain the CORS header, first we need to understand SameOriginPolicy. If `xyzapp.com` wants to access details from abcapp.com/userinfo. `SameOriginPolicy` prevents xyzapp.com from making an AJAX request to `abcapp.com/userinfo` and get the response. `SameOriginPolicy` is the default policy followed in all browsers which prevents data sharing between two different domains. --- # Improper Cross-Origin Resource Sharing (CORS) *** Improper configuration of CORS headers leads to security risk as I have seen in most of the web applications that CORS header is set as `Access-Control-Allow-Origin: ‘*’` or `Access-Control-Allow-Origin: ‘any’` --- # CORS vs CSP *** Content Security Policy(CSP) header is used to define what content can run on its own domain. For example, abcapp.com domain wants to access a javascript library only from `userscripts.example.com` and not from any other third-party libraries then abcapp.com can set the header as --- # Subresource Integrity (SRI) *** Subresource Integrity (SRI) is a security feature that enables browsers to verify that resources they fetch (for example, from a CDN) are delivered without unexpected manipulation. It works by allowing you to provide a cryptographic hash that a fetched resource must match. `` You use the Subresource Integrity feature by specifying a `base64-encoded` cryptographic hash of a resource (file) you are telling the browser to fetch, in the value of the integrity attribute of any `