├── days
├── day5.md
├── day14.md
├── day12.md
├── day2.md
├── day13.md
├── day16.md
├── day1.md
├── day15.md
├── day17.md
├── day8.md
├── day18.md
├── day4.md
├── day3.md
├── day10.md
├── day7.md
├── day11.md
├── day6.md
└── day9.md
└── README.md
/days/day5.md:
--------------------------------------------------------------------------------
1 | # Client-Side Template Injection (CSTI)
2 | Index | Section
3 | --- | ---
4 | **1** | What is CSTI
5 | **2** | Method
6 |
7 | ___
8 | #### What is CSTI
9 | ```
10 | 1. This occurs at the client-side like other JS attacks such as XSS.
11 | 2. This is mainly seen in the various JS libraries like AngularJS, VueJS etc which utilize the template engines at the client-side.
12 | 3. The presence of "ng-app" in the page source identifies the use of templates.
13 | 4. If the application directly accepts the input and process it without any validation, it may be vulnerable to CSTI.
14 | 5. CSTI leads to perform cross-site scripting attacks by escaping
15 | 6. Testing this issue is similar to Server-Side Template Injection.
16 | ```
17 | #### Method
18 | ```
19 | a. In the suspected field, provide a payload like {{11*5}}
20 | b. If the response reflected is 55, this tells that there is the use of the template and further you can try performing CSTI to XSS
21 | ```
22 |
--------------------------------------------------------------------------------
/days/day14.md:
--------------------------------------------------------------------------------
1 | # WebSocket Vulns (part - 2)
2 |
3 | Index | Section
4 | --- | ---
5 | **1** | Testing for IDOR in WebSockets
6 | **2** | Denial of Service
7 | ___
8 | #### Testing for IDOR in WebSockets
9 | ```
10 | 1. Intercept WebSocket Communication.
11 |
12 | 2. Look for any pattern/trace of ID/UUID/user/role and another similar parameter that may uniquely define an object/entity.
13 |
14 | 3. Assume the WebSocket communication is of a chatting application and consists of a request, where the Attacker is sending a message to the victim. There is a parameter called "sid" which is the attacker's user id.
15 |
16 | 4. Now, change this "sid" to some victim B's "sid" and if Victim A receives a message from Victim B. That's an issue.
17 |
18 | Look for all IDORs cases that you look for in normal HTTP workflow
19 | ```
20 | #### Denial of Service
21 | ```
22 | 1. WS allows any number of connections to the target server.
23 | 2. This behavior can be abused by an attacker to exhaust resources and perform a Denial of Service Attack.
24 |
25 | - Try sending multiple requests to initiate a WS connection in a short time, this may trigger some lagging in the app processing which can be lead to App Level DoS.
26 | ```
--------------------------------------------------------------------------------
/days/day12.md:
--------------------------------------------------------------------------------
1 | # Unicode Normalization
2 |
3 | This attack is hard to explain with out proper graphics. \
4 | Please refer to the references mentioned for a detailed explanation. \
5 | This is a really good attack vector to try and consider while doing PT/BB.
6 |
7 | ___
8 | #### Unicode to ASCII Transformation is a two-step process
9 | ```
10 | 1. Normalization: Where the characters are converted to a standardized form
11 |
12 | 2. Punycoding: Where the Unicode is turned into ASCII
13 | ```
14 | #### There are two overall types of equivalence between characters
15 | ```
16 | 1. Canonical Equivalence: Characters are assumed to have the same appearance and meaning when printed or displayed.
17 |
18 | 2. Compatibility Equivalence: This is a weaker equivalence, in that two values may represent the same abstract character but can be displayed differently.
19 | ```
20 | #### There are 4 Normalization AlgoDefined by Unicode Standard
21 | ```
22 | 1. Normalization Form D (NFD): Canonical Decomposition
23 | 2. Normalization Form C (NFC): Canonical Decomposition, followed by Canonical Composition
24 | 3. Normalization Form KD (NFKD): Compatibility Decomposition
25 | 4. Normalization Form KC (NFKC): Compatibility Decomposition, followed by Canonical Composition
26 | ```
27 | #### Some Vulnerabilities that can be exploited using this abuse
28 | ```
29 | 1. WAF & Filter Bypass for Attacks like XSS, SQLi, etc.
30 | 2. Account Takeovers
31 | 3. Text Transformation Attacks
32 | ```
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # learn365
2 |
3 | This repository contains all the information shared during my Learn 365 Challenge. Learn 365 is a challenge to keep the learning spirit going on and challenge myself to learn something daily for the whole year, it can be anything from infosec to general life. Follow me on Twitter for Regular Updates: [Harsh Bothra](https://twitter.com/harshbothra_). Huge thanks to [Mehedi Hasan Remon](https://twitter.com/remonsec), who originally created and maintained this repository.
4 | ___
5 |
6 |
7 | Day | Topic
8 | --- | ---
9 | **1** | [2FA Bypass Techniques](/days/day1.md)
10 | **2** | [Regular Expression Denial Of Service](/days/day2.md)
11 | **3** | [SAML Vulnerabilities](/days/day3.md)
12 | **4** | [Unauthenticated & Exploitable JIRA Vulnerabilities ](/days/day4.md)
13 | **5** | [Client-Side Template Injection(CSTI)](/days/day5.md)
14 | **6** | [Cross-Site Leaks (XS-Leaks)](/days/day6.md)
15 | **7** | [Cross-Site Script Includes (XSSI)](/days/day7.md)
16 | **8** | [JSON Padding Attacks](/days/day8.md)
17 | **9** | [JSON Attacks](/days/day9.md)
18 | **10** | [Abusing Hop-by-Hop Headers](/days/day10.md)
19 | **11** | [Cache Poisoned Denial of Service (CPDos)](/days/day11.md)
20 | **12** | [Unicode Normalization](/days/day12.md)
21 | **13** | [WebSocket Vulns (Part-1)](/days/day13.md)
22 | **14** | [WebSocket Vulns (Part-2)](/days/day14.md)
23 | **15** | [WebSocket Vulns (Part-3)](/days/day15.md)
24 | **16** | [Web Cache Deception Attack](/days/day16.md)
25 | **17** | [Session Puzzling Attack](/days/day17.md)
26 | **18** | [Mass Assignment Attack](/days/day18.md)
27 |
--------------------------------------------------------------------------------
/days/day2.md:
--------------------------------------------------------------------------------
1 | # Regular Expression Denial of Service
2 |
3 | Index | Section
4 | --- | ---
5 | **1** | What is ReDos
6 | **2** | Method
7 | **3** | Evaluation
8 | **4** | Resources
9 | **5** | Prevention
10 | **6** | References
11 |
12 | ___
13 | #### What is ReDos
14 | ```
15 | Due to weakly implemented RegEx Sometimes it is possible to perform a DoS attack by making this expression to evaluate an expression which will make the application work relatively slow.
16 |
17 | Usually this attack is explored and exploited when the source code is available and you can figure out what regular expressions are used in the code at what fields.
18 |
19 | For example, at the mobile no input field, what is the regex that validates the mobile no input field.
20 | However, you can also try to find this in Black/Gray Box engagements.
21 | ```
22 |
23 | #### Method
24 |
25 | ```
26 | Open the JavaScript files and search for the "RegExp(" function and try to figure out what function utilize that particular Regex.
27 | ```
28 | #### Evaluation
29 | ```
30 | https://github.com/2bdenny/ReScue
31 |
32 | This is a good tool to evaluate and identify if the given regex is vulnerable or not.
33 | This tool will also provide a string that will make the vulnerable RegEx go into potential ReDoS Attacks.
34 |
35 | It is important to understand how RegEx works and not only with ReDoS attack but it is useful overall.
36 | ```
37 | #### Resources
38 | ```
39 | Some of the good websites to learn about Regex are
40 |
41 | https://rexegg.com
42 | https://regexone.com
43 | https://speakerdeck.com/harshbothra/having-fun-with-regex
44 | ```
45 | #### Prevention
46 | ```
47 | https://regular-expressions.info/redos.html
48 | ```
49 | #### References
50 | ```
51 | https://hackerone.com/reports/511381
52 | https://hackerone.com/reports/661722
53 | ```
54 |
--------------------------------------------------------------------------------
/days/day13.md:
--------------------------------------------------------------------------------
1 | # WebSocket Vulns
2 |
3 | WebSocket is a network protocol that enables 2-way communication b/w client & server. \
4 | In the HTTP standard, where the one-party has to wait for the req./res from another party before performing the next action.
5 |
6 | The major goal of WebSocket is to enable real-time communication and can widely be seen in IM applications.
7 |
8 | I will be diving the WebSocket learning into 3 parts and I will post more about various attacks in the next two days.
9 |
10 |
11 | Index | Section
12 | --- | ---
13 | **1** | Web socket Protocol Scheme
14 | **2** | WebSocket Connection Process
15 | **3** | How to work with Websocket Messages
16 | **4** | General Security Implications
17 | **5** | References
18 | ___
19 | #### Web socket Protocol Scheme
20 | ```
21 | 1. Websockets use wss:// and ws:// as the protocol scheme.
22 | 2. This is similar to HTTPS and HTTP. Here, the WSS:// is a secure channel where WS:// is an insecure channel.
23 | ```
24 | #### WebSocket Connection Process
25 | ```
26 | 1. The application will send an HTTP request with two additional Headers: Upgrade: WebSocket & Connection: Upgrade to the server.
27 | 2. This request basically initiates the Web Socket connection process.
28 | 3. In return the server will return 101 Switching Protocols status code.
29 | 4. After this, WebSocket communication will start to take place.
30 | ```
31 | #### How to work with Websocket Messages
32 | ```
33 | 1. Burp Suite allows an option to capture the WebSocket Traffic, modify it, and replay it.
34 | 2. Additionally, you can use the Simple Web Socket browser extension to check for some test cases and communicating with the Web Socket.
35 | ```
36 | #### General Security Implications
37 | ```
38 | 1. Denial of Service
39 | 2. Insecure Communication
40 | 3. Missing Access Controls & Authorization Checks
41 | 4. Missing Input Validation in User-Controlled Data
42 | 5. Lack of/Improper Authentication
43 | 6. Tunneling
44 | 7. Cross-Site Web Socket Hijacking
45 | 8. Server-Side Issues & OOB (out of band) Issues
46 | ```
47 | #### References
48 | ```
49 | WebSocket Top 7 Vuln: https://www.neuralegion.com/blog/websocket-security-top-vulnerabilities/
50 | ```
--------------------------------------------------------------------------------
/days/day16.md:
--------------------------------------------------------------------------------
1 | # Web Cache Deception Attack
2 |
3 | This attack mainly happens when the Cache-Control directives are misconfigured and can be leveraged by an attacker to get hold of sensitive information.
4 |
5 | Index | Section
6 | --- | ---
7 | **1** | [About the attack](#About-the-attack)
8 | **2** | [Path confusion attacks](#Path-confusion-attacks)
9 | **3** | [Cause](#cause)
10 | **4** | [Scenario](#Scenario)
11 | **5** | [How to test](#How-to-test)
12 | ___
13 |
14 | ### About the attack
15 | ```
16 | - This attack requires User Interaction.
17 | - One of the important vectors is "Path Confusion Attack."
18 | - Path Confusion Attack/Flexible URL Rewriting plays an important role in this Attack
19 | ```
20 |
21 | ### Path confusion attacks
22 | ```
23 | - Many Web Applications have URL Rewriting Rules.
24 | - In such scenarios depending upon the configuration of the webserver, both of these URLs will be considered as (http://harshbothra.tech/myprofile).
25 | - http://harshbothra.tech/myprofile
26 | - http://harshbothra.tech/myprofile/test.css
27 | ```
28 |
29 | ### Cause
30 | ```
31 | - The following example code uses a regex that will consider both of the above examples as the same treaty:
32 |
33 | from django.conf.urls import url
34 |
35 | patterns = [url(r'^myprofile/', ...)]
36 | ```
37 |
38 | ### Scenario
39 | ```
40 | - Now, when the user requests for a static resource such as CSS, JPG, JS, etc., the web cache will consider to cache it considering it as static content (Expected Behavior) and this is where the web cache deception attack will come into the picture.
41 | ```
42 |
43 | ### How to Test
44 | ```
45 | 1. Navigate to an application and look for a page that may contain sensitive information such as http://harshbothra.tech/myprofile
46 | 2. Now add any static file after /myprofile such as test.css, test.jpg, etc. For Ex: http://harshbothra.tech/myprofile/test.jpg
47 | 3. Now, if the app displays the same /myprofile page, it might be cached.
48 | 4. Now, From another session (where this user is not logged in), navigate to the same URL: http://harshbothra.tech/myprofile/test.jpg
49 | 5. If you can see the information about the victim user. The attack is successful.
50 | ```
51 |
--------------------------------------------------------------------------------
/days/day1.md:
--------------------------------------------------------------------------------
1 | # 2FA Bypass Techniques
2 |
3 | ### [Mindmap](https://mm.tt/1736437018?t=SEeZOmvt01)
4 |
5 | Index | Technique
6 | --- | ---
7 | **1** | Response Manipulation
8 | **2** | Status Code Manipulation
9 | **3** | 2FA Code Leakage in Response
10 | **4** | JS File Analysis
11 | **5** | 2FA Code Reusability
12 | **6** | Lack of Brute-Force Protection
13 | **7** | Missing 2FA Code Integrity Validation
14 | **8** | CSRF on 2FA Disabling
15 | **9** | Password Reset Disable 2FA
16 | **10** | Backup Code Abuse
17 | **11** | Clickjacking on 2FA Disabling Page
18 | **12** | Enabling 2FA doesn't expire Previously active Sessions
19 | **13** | Bypass 2FA with null or 000000
20 | ___
21 | #### Response Manipulation
22 | ```
23 | In response if "success":false
24 | Change it to "success":true
25 | ```
26 |
27 | #### Status Code Manipulation
28 |
29 | ```
30 | If Status Code is 4xx
31 | Try to change it to 200 OK and see if it bypass restrictions
32 | ```
33 | #### 2FA Code Leakage in Response
34 | ```
35 | Check the response of the 2FA Code Triggering Request to see if the code is leaked.
36 | ```
37 | #### JS File Analysis
38 | ```
39 | Rare but some JS Files may contain info about the 2FA Code, worth giving a shot
40 | ```
41 | #### 2FA Code Reusability
42 | ```
43 | Same code can be reused
44 | ```
45 | ### Lack of Brute-Force Protection
46 | ```
47 | Possible to brute-force any length 2FA Code
48 | ```
49 | #### Missing 2FA Code Integrity Validation
50 | ```
51 | Code for any user acc can be used to bypass the 2FA
52 | ```
53 | #### CSRF on 2FA Disabling
54 | ```
55 | No CSRF Protection on disabling 2FA, also there is no auth confirmation
56 | ```
57 | #### Password Reset Disable 2FA
58 | ```
59 | 2FA gets disabled on password change/email change
60 | ```
61 | #### Backup Code Abuse
62 | ```
63 | Bypassing 2FA by abusing the Backup code feature
64 | Use the above mentioned techniques to bypass Backup Code to remove/reset 2FA restrictions
65 | ```
66 | #### Clickjacking on 2FA Disabling Page
67 | ```
68 | Iframing the 2FA Disabling page and social engineering victim to disable the 2FA
69 | ```
70 | #### Enabling 2FA doesn't expire Previously active Sessions
71 | ```
72 | If the session is already hijacked and there is a session timeout vuln
73 | ```
74 | #### Bypass 2FA with null or 000000
75 | ```
76 | Enter the code 000000 or null to bypass 2FA protection.
77 | ```
78 |
--------------------------------------------------------------------------------
/days/day15.md:
--------------------------------------------------------------------------------
1 | # WebSocket Vulns (part - 3)
2 |
3 | Index | Section
4 | --- | ---
5 | **1** | Insecure WS Connection
6 | **2** | Cross-Site Scripting
7 | **3** | Sensitive Information in WS
8 | **4** | Server-Side Injections
9 | **5** | Other Server-Side issues
10 | **6** | Learn & Practice
11 | **7** | References
12 | ___
13 | #### Insecure WS Connection
14 | ```
15 | - If the WS is using WS:// instead of WSS://, this is like using HTTP:// instead of HTTPS://.
16 | - The WSS:// sends the traffic over SSL/TLS & prevents MiTM attacks.
17 | - If any sensitive action is happening through WebSocket over WS://, try traffic intercepts, and create a proof of concept to show the impact.
18 | - If the WebSocket is using WSS://, try degrading it to WS:// and see if the WS:// is supported.
19 | ```
20 | #### Cross-Site Scripting
21 | ```
22 | - Check if the WebSocket is sending data that is displayed back on the application interface or somewhere in another panel (if you have access to it)
23 | - Also, if the data is reflecting somewhere else say admin panel, always try to perform Blind XSS
24 | - Send XSS payloads in interesting parameters & if the app fails to perform Input Validation in WS, it can allow an attacker to trigger XSS.
25 | ```
26 | #### Sensitive Information in WS
27 | ```
28 | - Read the Message sent through WS & keep an eye for any sensitive information that can be utilized
29 | - Just like reading response or JavaScript files in the usual web workflow.
30 | ```
31 | #### Server-Side Injections
32 | ```
33 | - Check all the WebSocket Parameters for potential Server Side Injection like SQLi
34 | - Fuzz the Parameters based on how various payloads and inputs are handled.
35 | ```
36 | #### Other Server-Side issues
37 | ```
38 | It is always a good idea to test the interesting parameters for all potential security vulnerabilities that are usually tested in normal HTTP Workflow.
39 | ```
40 | #### Learn & Practice
41 | ```
42 | PortSwigger: https://portswigger.net/web-security/websockets
43 | ```
44 | #### References
45 | ```
46 | - https://hackerone.com/reports/178990
47 | - https://hackerone.com/reports/409850
48 | - https://hackerone.com/reports/395729
49 | - https://hackerone.com/reports/163464
50 | - https://github.com/github/securitylab/issues/65
51 | - https://hackerone.com/reports/512065
52 | - https://hackerone.com/reports/1023669
53 | - https://hackerone.com/reports/86283
54 | ```
--------------------------------------------------------------------------------
/days/day17.md:
--------------------------------------------------------------------------------
1 | # Session Puzzling Attack
2 |
3 | Also known as Session Variable Overloading Attack.
4 | An app-level issue that may allow an attacker to bypass authentication, elevate privileges, skip MFA, or exploit any related issues.
5 |
6 | Index | Section
7 | --- | ---
8 | **1** | [About the attack](#About-the-attack)
9 | **2** | [Scenario](#Scenario)
10 | **3** | [How to test](#How-to-test)
11 | **4** | [Practice](#Practice)
12 | **5** | [How to test](#How-to-test)
13 | ___
14 |
15 | ### About the attack
16 | ```
17 | - When an application utilizes the same session variable for multiple purposes, this can be abused by an attacker to trick the application and perform the action as an authenticated or privileged user.
18 | - In Simple Words, For example, if the application generates a session identifier at an unauthenticated page and later that can be used to access the authenticated page, it is a session puzzling vulnerability.
19 |
20 | ```
21 |
22 |
23 | ### Scenario
24 | ```
25 | - An attacker navigates to the /forget_pass page of the application.
26 | - He provides the username of the victim user and initiate a password reset request and observes the application assigns a session identifier by looking at the cookies.
27 | - Now, the attacker utilizes the same session identifier in cookies to access an authenticated page /my_profile and the page is accessed successfully with the victim user's information.
28 | - This is Session Puzzling/Session Variable Overloading Attack.
29 | ```
30 |
31 | ### How to Test
32 | ```
33 | - Always check for the session identifier generation at various unauthenticated or lower privileged pages and see if they can be used to access authenticated or higher privileged pages.
34 | ```
35 |
36 | ### Remediation
37 | ```
38 | - Session variables should only be used for a single consistent purpose.
39 | ```
40 |
41 | ### Practice
42 |
43 | - https://owasp-skf.gitbook.io/asvs-write-ups/kbid-250-session-puzzling
44 |
45 | ### References
46 | - https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/06-Session_Management_Testing/08-Testing_for_Session_Puzzling
47 | - https://dzone.com/articles/using-session-puzzling-to-bypass-two-factor-authen
48 | - https://medium.com/bugbountywriteup/hunting-session-overloading-d2ec860c49c0
49 | - https://code.google.com/archive/p/puzzlemall/downloads
50 | - https://medium.com/@maheshlsingh8412/session-puzzling-attack-bypassing-authentication-29f4ff2fd4f5
51 | - https://deepsec.net/docs/Slides/2013/DeepSec_2013_Shay_Chen_-_The_Boomerang_Effect_-_Using_Session_Puzzling_To_Attack_Apps_From_The_Backend.pdf
52 |
--------------------------------------------------------------------------------
/days/day8.md:
--------------------------------------------------------------------------------
1 | # Json Padding (JSONP) Attack
2 | Index | Section
3 | --- | ---
4 | **1** | What is JSONP & JSONP Attack
5 | **2** | Callback Parameter
6 | **3** | Security Risks with JSONP
7 | **4** | Tools
8 | **5** | References
9 | ___
10 | #### What is JSONP & JSONP Attack
11 | ```
12 | 1. JSONP stands for JavaScript Object Notation with Padding which allows sending JSON data across domains without worrying about Cross-Domain Issues.
13 |
14 | 2. It utilizes