Web applications and APIs
How a web application works, how it fails, and how to fix an API and prove the fix.
How to use the lab files
The zip keeps the files of each lesson apart, and the lessons work in one flat folder. After you unzip it, sh kr-lab.sh LESSON FOLDER builds that folder as it stands after a lesson, for example sh kr-lab.sh 00-set-up-your-lab ~/krlab/web-apis.
You will build
You need
A computer with Linux, macOS, or Windows with WSL. No GPU, no cloud account and no paid tool.
Next course
- 00Set up and check your web labCreate the folder ~/krlab/web-apis for the whole courseSet-up15 min
- 01Build a tiny web server and call itName the parts of a web application and say what each one doesBuild30 min
- 02Build a notes API and call it with curlMap resources and methods to the right URL, status code and content typeBuild40 min
- 03Log in with a session cookie and an API keyBuild a login that issues a random session cookie with safe flags40 min
- 04Find and fix a broken access checkExplain the difference between authentication and authorisation35 min
- 05Break and fix a query and a page with injectionExplain why mixing data with code causes injection35 min
- 06Stop a server from fetching what it should notShow how a "fetch this URL" feature reaches an internal service40 min
- 07Keep secrets out of code and limit what a client can cost youLoad keys from the environment and a .env file that version control ignores40 min
- 08Fix token, origin and cross-site flaws and test each fixRead a bearer token and check a signed token for its algorithm, signature and expiry50 min
- 09Stop shell injection and mass assignment and test each fixRun a program from a server without a shell and allow only a safe name pattern35 min
- 10Build a secure notes API and prove every controlCombine authentication, an owner check, validation, limits and safe logging in one programBuild50 min
- 11Review and fix a colleague's APIFind planted flaws in an unfamiliar API by reading its code and by sending requestsTest90 min
More practice
Labs and workbooks on the same skills, from the practice library. Do the lessons first.
Work roles
Work roles this course supports
The course helps you to prepare for these roles of the NICE Workforce Framework for Cybersecurity (NIST SP 800-181 Rev. 1). No single course covers a whole role, and KaliRange is not a certification body.
- Secure Software Development
DD-WRL-003a main skill of the roleYou build an API and fix access, injection, token and secret flaws in its code. - Software Security Assessment
DD-WRL-005a supporting skillYou find planted flaws in a colleague's API and prove each fix with a test.