Full Tutorial|| Security threats in a web world ||HTTP Security Headers | Content Security Policy

Опубликовано: 02 Ноябрь 2024
на канале: Cyber Technical knowledge
178
7

Full Tutorial|| Security threats in a web world ||HTTP Security Headers | Content Security Policy

Disclaimer:
This video is made available for educational and informational purposes only. We believe that everyone must be aware of ethical hacking and cybersecurity to avoid different types of cyberattacks on computers, websites, apps, etc. Please regard the word hacking as ethical hacking every time we use it.
All our videos have been made using our own systems, servers, routers, and websites. It does not contain any illegal activities. Our sole purpose is to raise awareness related to cybersecurity and help our viewers learn ways to defend themselves from any hacking activities. Cyber Technical Knowledge is not responsible for any misuse of the provided information.

Top 5 Security Headers
1. Content-Security-Policy (CSP)
A content security policy (CSP) helps to protect a website and the site visitors from Cross Site Scripting (XSS) attacks and from data injection attacks.
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS) exploits happen when hackers take advantage of a security hole to upload malicious scripts to a website which are then downloaded to a victim’s browser.

XSS attacks take advantage of flaws in a content management system that allows unexpected inputs to be injected because of insufficient user input file sanitization.

For example, ordinarily, an email form should be coded to expect a restricted input.

A poorly coded form may allow some other input which can then lead to an injection of malicious files.


An XSS attack can be used to steal passwords or as part of a multi-step hacking event.

Injection Attacks

The Open Web Application Security Project (OWASP) describes injection attacks as a serious security risk:

“Injection is an attacker’s attempt to send data to an application in a way that will change the meaning of commands being sent to an interpreter.

The content security policy by itself does not 100% protect a site from attacks but it does help to diminish the possibility of a cross site scripting attack.

A CSP header instructs the browser to only download resources from a set group of domains and only from those domains.

Any attacker that is downloading malicious scripts from another server outside of that trusted group will be blocked.

Creating a content security policy can be as strict or as lenient as a publisher requires.

Warning: However, setting one up can be a little tricky because you have to list all of the scripts and resources that are being downloaded from outside of your domain in order to whitelist them.

2. Strict-Transport-Security Header (HSTS)
The Strict-Transport-Security Header is also called the HTTP Strict Transport Security header (HSTS).


Many websites only have a 301 redirect from HTTP to HTTPS.

But that’s not enough to keep the website secure because the website is still vulnerable to a man-in-the-middle attack.

HSTS prevents an attacker from downgrading the HTTPS connection to an HTTP connection which then allows the attacker to take advantage of insecure redirects.

For example, if a person types in example.com to access a site, without actually typing in the https part (or they simply type http out of habit), then the opportunity exists for a man-in-the-middle attack.

That kind of attack can compromise the site visitors’ connection to the website and any sensitive information exchanged between the visitor and the website becomes visible to the attacker.

For example, an attacker can intercept cookies that contain sensitive information like login credentials.


The United States government lists three scenarios where HTTPS can be downgraded to HTTP and subsequently allow an attacker to compromise security.

The HTTP Strict Transport Security (HSTS) header tells the browser that the entire website should only be accessed by a secure HTTPS protocol.

Side Note: How To Preload HSTS Into Chrome

On a related note, Google Chrome has an HSTS Preload program where publishers can submit their sites to be listed by Chrome as only accessible via the HTTPS protocol.

#Penetrationtesting #mobilehacking #websitehacking #serverhacking #vulnerabilitymanagement #vulnerabilityassessment
#zerodayvulnerability #Nmap #burpsuite #metaspolite #Howtohackmobilephone #howtohackwebsite
#howtohackcompanywebsit #whatisvulnerability #threat #Risk #Tenable #Nessus #qualysguard #Rapid7 #Kali
#Howtoinstallkalilinux #DirectoryTraversal #Discovering #Framework #Risks #Identifying #vulnerable #targets #shodan
#OWASPtop10 #Webappsecurityrisks #SystemHacking #NetworkHacking #RouterHacking #WorkstationHacking #SwitchHacking
#Ciscofirewallhacking #fortigate #Machacking #macos