Why DevTools first
Before you install a single hacking tool, you already own a powerful one: the developer tools built into your browser. Every lab in this platform runs in a browser, and so does most real-world web testing. DevTools let you:
- See every request and response behind a page, including the API calls fired by JavaScript.
- Read and modify the live page (the DOM) and the cookies and storage it uses.
- Run JavaScript in the context of the page.
- Read the front-end source code and find endpoints, secrets and hidden features that the UI never shows.
- Copy any request, edit it and replay it.
A proxy such as Burp Suite (next lesson) adds interception, history across sessions and automation. But a surprising number of bugs can be found, understood and proven using DevTools alone, and the skills transfer directly because a proxy shows the same requests.
DevTools exists in Chrome, Edge, Firefox and Safari. Names and layouts differ slightly. This lesson uses Chrome/Edge naming and notes Firefox differences. Open them with F12, Ctrl+Shift+I (Cmd+Option+I on macOS), or right-click and choose Inspect.
Layout and general tips
The panels are tabs: Elements (Inspector in Firefox), Console, Sources (Debugger), Network, Performance, Memory, Application (Storage), Security and others. You can dock DevTools to the bottom, right, left or a separate window (the three-dot menu). Press Ctrl+Shift+P (Command Menu) to find any feature by name, e.g. "Show Network request blocking". Ctrl+Shift+C starts "select an element to inspect".
Use a separate browser profile for security testing (or a dedicated Firefox/Chromium) so your testing cookies, extensions and proxy settings never mix with your personal browsing.
Elements: the live DOM
The Elements panel shows the DOM, the browser's live object model of the page, not the original HTML text. The difference matters.
| "View source" (Ctrl+U) | Elements panel |
|---|---|
| The raw HTML the server sent | The DOM after parsing and after JavaScript ran |
| Static | Live; updates as scripts change the page |
| Good for seeing what the server returned | Good for seeing what actually renders and executes |
Security uses:
- Find where your input lands. Search the DOM (Ctrl+F inside Elements) for a value you typed. Is it in text, inside an attribute, inside a
<script>block, in a comment? The context determines which XSS payloads could work. - Check how special characters survived. If you typed
"><b>x, see whether the quotes and angle brackets were escaped as entities or inserted raw. - Reveal hidden things. Hidden form fields (
<input type="hidden" name="price" value="100">), disabled buttons, HTML comments with notes or paths,data-*attributes with ids, and elements hidden withdisplay:noneare all visible here. - Edit the DOM. Double-click any element or attribute to modify it: remove
disabled, changemaxlength, changetype="password"totype="text", edit a hidden field value, and then submit the form. This shows that client-side restrictions are only suggestions. - Break on DOM changes. Right-click a node, Break on, then subtree modifications or attribute modifications, to find the JavaScript that touches it. Useful for DOM XSS.
- Event listeners. The side pane Event Listeners lists handlers attached to an element and where they are defined.
Edits you make in Elements are local to your browser. They change nothing on the server unless you then submit the changed form. That is exactly the point: you control the client.
Console: JavaScript in the page's context
The Console shows logged messages, errors and warnings, and lets you run JavaScript with the page's own privileges (same origin, same cookies that are not HttpOnly, same variables).
Useful things to read:
- Errors and logs from the app, which sometimes leak tokens, internal URLs, debug messages and stack traces.
- Mixed-content, CORS and CSP violation messages, which tell you what the browser blocked and why. When you test XSS, a CSP report in the Console tells you which directive stopped you.
Useful things to run:
document.cookie // non-HttpOnly cookies
localStorage // all keys in localStorage
JSON.stringify(sessionStorage)
location.href, location.origin
document.forms // forms on the page
[...document.querySelectorAll('input[type=hidden]')].map(i => [i.name, i.value])
[...document.querySelectorAll('a')].map(a => a.href)
Calling the app's own API with your session (the browser attaches cookies automatically):
fetch('/api/me').then(r => r.json()).then(console.log)
fetch('/api/orders/1001', { credentials: 'include' })
.then(r => r.text()).then(console.log)
fetch('/api/profile', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ displayName: 'test' })
}).then(r => console.log(r.status))
Handy helpers (Chrome): $0 is the element selected in Elements, $_ the last result, $$('sel') is querySelectorAll, copy(obj) copies to clipboard, monitorEvents($0) prints events, and getEventListeners($0) lists handlers.
Console considerations:
- Self-XSS warning. Never paste code that someone else gave you into your Console on a site where you are logged in; it runs with your privileges. The browser warns about this for a reason.
- A Console lets you test whether a sink is exploitable (for example confirm that a function exists and what it does) but a real finding must be reproducible through normal user interaction or a crafted link, not by typing into your own Console.
Network: the heart of web testing
The Network panel records every request. Open it before loading or acting on a page, or reload with it open.
Reading the list
Columns of interest (right-click the header to add more): Name, Status, Method, Domain, Type, Initiator, Size, Time, Protocol (h2/h3), Set-Cookies, Remote Address.
Filter buttons: Fetch/XHR (API calls; your usual focus), JS, CSS, Img, Doc, WS (WebSockets), Other. Use the filter box: method:POST, status-code:403, domain:api.example.com, -mime-type:image/png, larger-than:10k, has-response-header:set-cookie, or plain text for URLs.
Useful toggles: Preserve log (keep requests across navigations and redirects, essential when a login redirects), Disable cache (see fresh responses), and throttling (simulate slow connections to observe race windows and loading states).
Inspecting one request
Click a request to see tabs:
- Headers: request line, request headers (note
Cookie,Authorization,Origin,Referer,Content-Type), response headers (Set-Cookie,Location, security headers,Server, caching). - Payload (Request tab in older versions): the parameters or JSON body that was sent, with view-source for the raw form.
- Preview and Response: rendered and raw response body.
- Initiator: the exact line of JavaScript that triggered the request (click through to Sources), plus the call stack.
- Timing: DNS, connect, TLS, waiting (TTFB), download. Timing differences can reveal behaviour (a slower response when a username exists, for example).
- Cookies: which cookies were sent and which were blocked, with reasons (SameSite, Secure).
Following a flow
To understand a login, tick Preserve log, clear the list, and then log in. Look for: the POST with credentials, the Set-Cookie in the response, any 302 redirect chain (Location), and the first authenticated API call. Do the same for a purchase, password reset, file upload, or profile change. Write down every request in the flow; each is an attack surface.
Edit and replay requests
DevTools is not only an observer.
- Copy as cURL: right-click a request, Copy, Copy as cURL (bash). Paste it into a terminal, change one parameter, and run it. Add
-ito see response headers or-x http://127.0.0.1:8080to send it through your proxy. Also available: Copy as fetch (paste into the Console and edit), Copy as PowerShell, and Copy as HAR. - Replay XHR (Chrome): right-click a Fetch/XHR request and choose Replay XHR to resend it unchanged.
- Edit and Resend (Firefox): right-click a request and choose Edit and Resend to change method, URL, headers and body in the panel, then send. This is the closest thing to a mini-Repeater inside a browser.
- Override content (Chrome, "Local overrides"): in Sources, enable local overrides and save modified versions of responses (for example JavaScript files or API JSON) so the browser uses your edited copy on reload. Useful to test how the client behaves when the server's answer changes, e.g. flipping
"isAdmin": falsetotruein a response and seeing which UI appears (which only demonstrates client trust, not a server bug by itself). - Request blocking: right-click, Block request URL, to see what breaks when a resource such as a security script fails.
- Search: Ctrl+F in Network searches all responses, headers and bodies; handy for finding where a token or email address appears.
WebSockets and streaming
The WS filter lists WebSocket connections; click one and open Messages to see frames in both directions. Many real-time apps hide logic and authorization mistakes there. Also look for EventSource (server-sent events) and GraphQL requests (one endpoint, queries in the body).
Application (Chrome) / Storage (Firefox)
This panel exposes client-side state.
- Cookies: every cookie for the site with Name, Value, Domain, Path, Expires, Size, HttpOnly, Secure, SameSite, Priority. Double-click a value to edit it, right-click to delete. Combined with Network, you can see which request set which cookie. Look for sensitive data in cookies, session ids that look predictable, tokens in
localStorage, unsigned role flags and cookies scoped to the entire parent domain. - Local storage and Session storage: key/value stores readable by any script of the origin. Tokens (JWTs), user profiles, feature flags and cached API data often appear here; XSS can read all of it.
- IndexedDB: structured storage used by offline apps.
- Cache storage and Service workers: a service worker can intercept every request for the origin; a malicious or buggy one is persistent. Unregister it to see the site without it, and tick Bypass for network when testing.
- Manifest: PWA configuration.
- Clear site data: wipe cookies and storage to test the logged-out state or fresh sessions.
Sources: reading the front-end code
The Sources (Debugger in Firefox) panel is a file browser for everything the page loaded: HTML, JavaScript, CSS, source maps.
- Search across all files: Ctrl+Shift+F. Search for
api/,/v1/,fetch(,XMLHttpRequest,Authorization,apiKey,secret,token,password,admin,isAdmin,debug,TODO,innerHTML,eval(,postMessage,document.write,location.hash. Front-end code often reveals endpoints the UI never links to, feature flags, role checks done client-side, and the sources (user-controlled values) and sinks (dangerous functions) that cause DOM XSS. - Pretty-print minified code: click the
{}button at the bottom of the editor. - Source maps: if the site ships
.mapfiles, DevTools shows the original un-minified source tree, sometimes with comments and unbundled modules. Exposed source maps are an information-disclosure finding in themselves. - Breakpoints: click a line number to pause when it runs. Use Step over and Step into to follow how input flows through the code, watch variable values in the Scope pane, and use XHR/fetch breakpoints to pause when a request to a URL containing some text is made, and Event listener breakpoints to pause on clicks, keystrokes or message events.
- Snippets: save reusable Console scripts.
- Workspaces and overrides: edit a file locally and let DevTools serve your edited version (see local overrides above), for instance to disable a client-side validation function and observe whether the server validates independently.
Reading JavaScript is a core hunting skill. Spend time in Sources whenever you land on a new application; the API surface it reveals is usually larger than what the interface shows.
Other useful panels
- Security (Chrome): shows the TLS certificate and any mixed content.
- Lighthouse: audits including some best-practice and security checks.
- Performance and Memory: rarely needed for security, but useful to understand heavy scripts.
- Issues (Chrome): lists cookie, CORS, CSP and mixed-content problems as the browser sees them.
- Device toolbar (Ctrl+Shift+M): emulate mobile user agents, which sometimes route to different endpoints or less-hardened code paths.
- Network conditions: override the
User-Agent.
Limits of DevTools (and why you will want a proxy)
DevTools shows what the browser does. It cannot easily:
- Intercept a request before it leaves, modify it and then send it.
- Keep a searchable history across many pages, tabs and sessions with project saving.
- Send hundreds of automated variations (Intruder, Turbo-style tools).
- Show or modify requests from non-browser clients such as a mobile app.
- Craft malformed requests the browser would refuse to send (invalid headers, conflicting
Content-LengthandTransfer-Encoding).
That is the job of an intercepting proxy, which is the next lesson.
Hands-on exercises
Use your own browser against practice targets, or sites you own. Public sites: observation only.
- Hidden fields. On any signup form, run
[...document.querySelectorAll('input[type=hidden]')].map(i=>[i.name,i.value]). What do you find? Which look like they should be server-controlled? - Where does my input land? Search for a unique string, like
zzTESTzz, in a site's search box. In Elements, find every place it appears: text, attribute, script. Describe the context for each. - Trace a login. With Preserve log on, log in to a practice app. Record each request in order: method, URL, status, which sets cookies, which redirects.
- Copy as cURL and replay. Right-click one API call, copy as cURL, run it in a terminal, then change a numeric id or a field and compare the output. Note any behavior that surprises you.
- Edit and resend / replay. In Firefox use Edit and Resend on a request to change a parameter; in Chrome use Copy as fetch, edit it in the Console, and run it.
- Cookie audit. In Application, list every cookie, and for each fill a table: HttpOnly, Secure, SameSite, Domain, Expires. Flag anything that looks like a session identifier without the right flags.
- Source hunt. In Sources, press Ctrl+Shift+F and search the loaded JavaScript for
/api/. List five endpoints. Which are not reachable from the visible UI? - Local override. Enable Local Overrides, modify one JavaScript file or JSON response on a practice app, reload and see what changes. Explain why this does not prove a server vulnerability.
- Client restriction removal. On a practice form, remove a
maxlengthordisabledattribute using Elements, submit, and see whether the server enforces the restriction on its own.
Checklist
- I can open each major DevTools panel and say what it is for.
- I know the difference between page source and the live DOM.
- I can follow a login or checkout using Network with Preserve log.
- I can copy a request as cURL, edit it and replay it.
- I can audit cookies and storage for sensitive data and missing flags.
- I can search JavaScript for endpoints and dangerous sinks.
- I understand why changes made in DevTools are local, and what that teaches.
Key takeaways
- DevTools is a full testing toolkit you already have; learn it deeply before adding tools.
- Network shows reality; Elements shows where input lands; Application shows state; Sources shows logic.
- Every client-side restriction can be edited away, so servers must enforce rules.
- Copy-as-cURL and Edit-and-Resend bridge DevTools to hands-on request tampering.
- A proxy extends DevTools with interception, history and automation.
Further reading
- Chrome DevTools documentation (developer.chrome.com/docs/devtools)
- Firefox Source Docs: Network Monitor, Page Inspector, Storage Inspector, Debugger
- MDN: "Browser developer tools" overview
- PortSwigger Web Security Academy: DOM-based vulnerabilities and "Using DevTools"-style guidance in the DOM XSS topics
- OWASP Web Security Testing Guide: Testing for client-side vulnerabilities