‼️ Always look into HTML source code- Your file name can be a SQL query
- SQL Injection Remediation
- Input validation
- Seperate code and data
- Parameterized queries and ORM (Object Relational Mapping)
- For example: https://stackoverflow.com/questions/1279613/what-is-an-orm-how-does-it-work-and-how-should-i-use-one
- Install Firefox
- Install Burpsuite
- It is an intercepting proxy that allows you to intercept HTTP requests to a website, making it easy to inspect payloads, modify them, replay them, etc.
- Comparing with wireshark, this tool works at the application level in an interactive way
- Download the community version and install with default settings: https://portswigger.net/burp/releases/professional-community-2021-8?requestededition=community
- It is an intercepting proxy that allows you to intercept HTTP requests to a website, making it easy to inspect payloads, modify them, replay them, etc.
- Install OWASP JuiceShop
- Install nodejs: https://nodejs.org/en/download/
- In your terminal, type
git clone https://github.com/bkimminich/juice-shop.git
- Juice Shop is a website with lots of vulnerabilities and allows you to practice different types of attacks
- Then
cd
to juice-shop folder, typenpm install
just once- There might be lots of warnings, but that's expected
- Type
npm start
- Now go to http://localhost:3000 and you should be able to see the juiceshop website
- Register at CMD+CTRL: https://cmdnctrl.net/ranges
- You will get an email for temporary password setup, and the email is not a phishing email...
- It's a platform that provides vulnerable sites to attack
- After installing Burpsuite, go to
localhost:8080
- Click
CA Certification
at top right, then click "Save File"
- Click
- In Firefox search bar type
about:config
, accept the risk and move forward- In the appeared search bar, type
localhost
- Then set
network.proxy.allow_hijacking_localhost
as "True"
- In the appeared search bar, type
- In Firefox search bar type
about:preferences
- Click
Connection Settings
- Choose
Manual proxy configuration
- Type
127.0.0.1
as HTTP Proxy, with Port8080
- Check "Always use this proxy for HTTPS"
- Choose
- Type
cert
in the search var underabout:preferences
, then click "View Certificates"- Click "Import" and import the certificate downloaded from Burpsuite from above step
- Click
- After finishing above steps, open Burpsuite app, click "Proxy" tab --> click "Intercept is on"
- Make sure "Intercept is on" everytime
- Click "Proxy" tab --> Click "HTTP history" tab
- Right click a host starts with "http://localhost:3000/" and click "Add to scope"
- If didn't see it, try to refresh Burp interface
- The click "Target" tab --> then click "Site Map", you should be able to see "http://localhost:3000"
- Right click a host starts with "http://localhost:3000/" and click "Add to scope"
- Parameter Tampering: https://securityinnovation.hubs.vidyard.com/watch/x5BvhRRbvbMFJ2zPy8Hp3E
- Browser params are changable
- Hidden field values are also changable
- SQL Injection https://www.securityinnovation.com/training/cmd-ctrl-cyber-range-security-training/cyber-range-suite/cmdctrl-cyber-range-shadow-bank/
- XSS: https://securityinnovation.hubs.vidyard.com/watch/uUCj6UBp95eWa5pK7o6JoZ
- It's an attack game in Cmd + Ctrl
- If you read the title of "challenges" in https://cmdnctrl.net/teams/summary, you will get some hints about what to attack
- Check HTML source code, and you will find the username and password in the comment
- Who will really do this in the real world...
- Example of SQL injection
- By typing
' 1=1 #
in the username and put whatever in the password field, you can login - I think, most website won't be this vulnerable...
- A 7 min simple tutorial in sql injection: https://securityinnovation.hubs.vidyard.com/watch/fThcxjLgvA9zxDWvFhaNaC
- By typing
- Example of data exfiltration through SQL Injection
- SQL injection can be done not only in web field, but also in URL
- In this example, type something like
' or 1=1 --
and you will see the query the web page is using. Then type1 --
after "currentThreadID=" will help you copy everything of threadID 1 from the database
- Exmaples of XSS (cross site scripting), JS injection
- XSS on any empty web form, such as "Search" bar by fill in things like
<script>alert(1)</script>
- XSS on login page by adding
loginError.action?errorMsg=<script>alert(1)</script>
to the URL before login - XSS on transfer page by adding
doTransfer.action?destId=<script>alert(1)</script>&amount=2222
to the URL after login
- XSS on any empty web form, such as "Search" bar by fill in things like
- Example of denial of service attack: http://fjordengineering.com/posts/version-2.3-vulnerability/
- Add
kill?shutDownToken=ae450g9dg
after the URL could shuts down the serve...
- Add
- Example of foreceful browsing & XML injection
- Add
/admin
after the URL - Under this admin login page, type
blah' or 1=1 or 'a'='a
as username and click submit, you will achieve XML injection
- Add
- Example of authorization bypass
- If you see user settings URL has params in it, such as "/users/profile/3/settings", you can change the params
- Example of cryptanalysis of Vigenere Cipher
- Add
/cheshire
at the end of the URL - I really don't know why this could get the score....
- Add
- Examples of Hidden Form Field Manipulation
- Exmaple of post as others
- Open HTML source, and find "newPost"
- Remove
type=""hidden
to make those visible - Replace the value of threadId; repalce the value of postBy to a user name you know; set the value of staffPost to "true"
- Click "Submit" on the website
- Exmaple of post as others
- Example of Bypass approval form
- If you find the hidden approval field, you can remove
type="hidden"
and set the value as "0" - If it needs other actions such as upload a .pdf file, you might need to do those before clicking submit
- If you find the hidden approval field, you can remove
- Example of Price Gouging
- Still remove
type="hidden"
, and change the values of the hidden field. - Increase the stock price and make sure the numbers you set are sellable
- Still remove
- Example of disabled button
- Add
/debug
after the URL to see whether there is anything - If you see disabled buttons in the web page, there might be something interesting to explore. So find that hidden button in the source HTML, and change
disabled=""
toenabled=""
- Add
- Example of hidden buttton
- Similar to the disabled button, sometimes in HTML source code, the hidden button might give you more privileges. In this example, just remove
style="display : none"
and click the approve button on the webpage
- Similar to the disabled button, sometimes in HTML source code, the hidden button might give you more privileges. In this example, just remove
- Example of weak password reset
- If you know a user's name, check his/her facebook to see whether you can find answers for password set
- Exmaple of threadID integer overflow
- Add
/users/messages/threads/3999999999999999
after the URL
- Add