Web Testing Basics Cheat Sheet
A quick reference for looking at a website the way a tester does. Learn what normal looks like first. Then the unusual things stand out.
Safe and legal use
Only test websites you own, lab sites built for practice, or sites where you have written permission (for example a bug bounty programme, within its rules). Testing other sites without permission is illegal, even if you do not cause damage.
HTTP methods
| Method | What it does | Example |
|---|---|---|
GET |
Ask for a resource. Data goes in the URL | GET /products?id=5 |
POST |
Send data to the server, often from a form | POST /login |
PUT |
Replace a resource | PUT /api/users/7 |
PATCH |
Change part of a resource | PATCH /api/users/7 |
DELETE |
Delete a resource | DELETE /api/posts/12 |
HEAD |
Like GET, but only headers come back | HEAD / |
OPTIONS |
Ask which methods are allowed (also used by CORS) | OPTIONS /api/users |
Status codes
| Code | Meaning | What it can tell a tester |
|---|---|---|
200 OK |
Success | The page or data was returned |
201 Created |
A new item was created | Your POST worked |
204 No Content |
Success, empty body | Often after a DELETE |
301 Moved Permanently |
Permanent redirect | Check the Location header |
302 Found |
Temporary redirect | Often sends you to a login page |
304 Not Modified |
Use your cached copy | Normal browser caching |
400 Bad Request |
The server could not understand the request | Your input broke something. Look closer |
401 Unauthorized |
You need to log in | Authentication is required |
403 Forbidden |
You are logged in (or not) but not allowed | The page exists but is protected |
404 Not Found |
Nothing at this path | Some apps return 404 for hidden pages too |
405 Method Not Allowed |
Wrong method for this path | Try the method the app expects |
429 Too Many Requests |
Rate limit reached | The app has brute-force protection |
500 Internal Server Error |
The server crashed handling the request | Your input may have caused an error. Interesting |
502 Bad Gateway |
A proxy got a bad answer from the app server | Back-end problem |
503 Service Unavailable |
Server overloaded or down | Stop and wait |
Quick rule: 2xx success, 3xx redirect, 4xx your request was wrong, 5xx the server failed.
Security headers
| Header | What it protects against | Good example |
|---|---|---|
Strict-Transport-Security |
Forces HTTPS, stops downgrade to plain HTTP | max-age=31536000; includeSubDomains |
Content-Security-Policy |
Limits where scripts and other content can load from. Reduces XSS damage | default-src 'self' |
X-Content-Type-Options |
Stops the browser guessing file types (MIME sniffing) | nosniff |
X-Frame-Options |
Stops other sites putting your page in a frame (clickjacking) | DENY or SAMEORIGIN |
Referrer-Policy |
Controls how much of the URL is sent to other sites | strict-origin-when-cross-origin |
Permissions-Policy |
Turns off browser features the site does not need (camera, microphone, location) | camera=(), microphone=() |
Content-Security-Policy with frame-ancestors is the modern replacement for X-Frame-Options.
Headers that leak information and are worth noting: Server (for example Apache/2.4.41) and X-Powered-By (for example PHP/7.4.3). Version numbers help attackers find known bugs.
Check headers fast:
curl -I https://lab.example/
Cookie flags
| Flag | What it does | Why it matters |
|---|---|---|
Secure |
Cookie is only sent over HTTPS | Stops it leaking on plain HTTP |
HttpOnly |
JavaScript cannot read the cookie | XSS cannot simply steal the session cookie |
SameSite=Strict |
Never sent on requests from other sites | Strong protection against CSRF |
SameSite=Lax |
Sent only on top-level navigation from other sites | Good default against CSRF |
SameSite=None |
Sent on all cross-site requests (must also be Secure) |
Weakest. Check why it is needed |
Expires / Max-Age |
When the cookie ends | Session cookies should not live for months |
Domain / Path |
Where the cookie is sent | Too wide a domain shares it with more sites |
A session cookie should normally have Secure, HttpOnly and SameSite set.
Browser DevTools tips
Open with F12 or Ctrl + Shift + I (Cmd + Option + I on Mac).
| Tab | What to use it for |
|---|---|
| Elements (Inspector in Firefox) | See the real HTML. Find hidden fields, comments and disabled buttons |
| Console | See errors and run JavaScript |
| Network | Watch every request and response, status codes and headers |
| Application (Storage in Firefox) | View and edit cookies, local storage and session storage |
| Sources (Debugger in Firefox) | Read JavaScript files. Look for API paths and comments |
Useful tricks:
- In Network, tick "Preserve log" so requests are kept when the page redirects.
- Right-click a request and choose Copy as cURL to repeat it in the terminal.
- Search all loaded files with
Ctrl + Shift + Fin Chrome DevTools for words likeapi,adminortoken. - Press
Ctrl + Uto view the page source.
Quick checks: IDOR (broken access control)
An IDOR happens when you can reach another user's data just by changing an ID.
| Check | What to look for |
|---|---|
| Change a number in the URL | /invoice?id=1001 to /invoice?id=1002 shows someone else's invoice |
| Change an ID in a POST body or JSON | "user_id": 7 to "user_id": 8 |
| Use two test accounts | Log in as A, copy a request, replay it with B's cookie |
| Try admin paths as a normal user | /admin, /api/users return data instead of 403 |
Quick checks: SQL injection signs
| Test input | Possible sign |
|---|---|
A single quote ' in a field or parameter |
A database error, a 500 error or a broken page |
' versus '' |
One breaks the page, the other works again |
| Error text in the page | Words like SQL syntax, mysql, ORA-, SQLite, unterminated |
| A search that shows more results than it should | The query logic may be changing |
Quick checks: XSS signs
| Test input | Possible sign |
|---|---|
A harmless unique word like xsstest123 |
Find where it appears in the page source |
<b>hello</b> |
Text shows in bold, so your HTML was not escaped |
Your input appears inside a <script> block or an attribute |
Higher risk, because breaking out is easier |
| Your input is saved and shown to other users (comments, profiles) | Stored XSS is more serious than reflected XSS |
If your input is shown as <b> in the source, the site is escaping it correctly.
Reporting what you find
Write down the URL, the request, the response, what you expected and what actually happened. Take screenshots. Report it to the site owner through their official channel.
SECUREK Learn · learn.securek.co/cheat-sheets/web-testing-basics
Spotted a mistake or something unclear? Report a mistake