Day 2 of 2160 minShell WalkerHands-on lab

Day 2: Scope, Rules and What Never Goes Into a Prompt

Taught by Mr Elite Updated

By the end of today you can

  • Read a bounty policy and extract what is in scope, out of scope and protected by safe harbour
  • Explain why tokens, cookies and customer data never go into a prompt
  • Redact a realistic paste using a repeatable checklist
  • Save a reusable redaction checklist in your notes

Warm-up

Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.

Which curl flag shows the status line, headers and body in one view?

curl -i

What did you write next to each assistant claim in your Day 1 evidence file, and why?

A verdict (confirmed, wrong or unclear), because only your own requests prove anything.

Picture this. You find something odd on a website, the response looks wrong, and you copy the whole request into an AI chatbot to ask what it means. Inside that paste sits your session cookie, an API key in a header and a customer's email address. You hit enter. You have now sent live secrets to a third party, and you never checked whether the site was even allowed to be tested.

Two habits prevent that. First, read the rules before you touch anything. Second, clean everything before it leaves your machine. Today I will teach you both, and by the end you will have a checklist you can reuse on every hunt.

Scope: the rules of the game

A bug bounty programme is a company's open invitation to test its systems and report flaws, usually for a reward. The invitation has limits, and those limits live in a document called the policy. Reading it is the first job on every target, before any tool runs.

In scope
The systems, domains or apps you are allowed to test, such as app.example.com or a named mobile app.
Out of scope
Anything not listed, or listed as excluded. Testing it can get you banned or in legal trouble.
Safe harbour
A promise that the company will not take legal action against you if you follow the policy in good faith.
Rules of engagement
Limits on how you test, such as no denial of service, no social engineering, no touching other users' data.

Safe harbour only covers you when you stay inside the policy. If you test an out-of-scope host, you have stepped outside the promise. Wildcards like *.example.com look generous, but read the exclusions beneath them, because they often carve out payment systems or partner sites.

Policies are long and written in a hurry, so I want you to read them in a fixed order. Below is a short made-up policy for a fictional company. Nothing here is real and no real host is involved. Read it once, then I will show you how I pull it apart.

text
ExampleShop Vulnerability Disclosure Policy

In scope:
  - app.exampleshop.test
  - api.exampleshop.test
  - ExampleShop Android app (latest release)

Out of scope:
  - pay.exampleshop.test (third-party processor)
  - Any *.exampleshop.test host not listed above
  - Social engineering, phishing, physical attacks
  - Denial of service or automated scanning above 5 requests/second

Rules:
  - Use only accounts you created yourself
  - Do not access, change or keep other users' data
  - Report privately to security@exampleshop.test

Safe harbour: if you act in good faith and follow this policy,
we will not pursue legal action against you.
A fictional policy. Practise reading it in the same order every time: in scope, out of scope, rules, safe harbour, reporting.

Here is how I read it. In scope gives me three assets, and I write them down exactly. Out of scope tells me the payment host is banned and that the word wildcard does not apply, because anything unlisted is excluded. Rules tell me I may only use my own accounts and must stay under five requests a second. Safe harbour is conditional on all of that. Last, I note where reports go, so I never post a finding in public.

Quick check

A policy lists app.example.com as in scope. You notice admin.example.com looks interesting. What do you do?

Why secrets stay out of prompts

When you paste text into a public chatbot, it leaves your control. It may be stored, logged, reviewed by staff or used to improve models, depending on the provider and your settings. You should assume anything you paste could be seen by someone else later.

Here is what that means for bounty work. A session cookie or bearer token is a key to someone's account, so a leaked one can be replayed. Customer data, such as names, emails or order details, belongs to people who never agreed to be in your chat. And programme policies often forbid sharing vulnerability details outside the programme at all.

Think of three questions before any paste. Could this value log someone in? Could it identify a real person? Could it point to a system or a bug that the programme wants kept private? If the answer to any of them is yes, it does not go in as it is.

The assistant does not need any of it. It needs the shape of the problem: the method, the path, the header names, the status codes, and the odd behaviour. Placeholders carry that shape perfectly well. A bearer token of 200 random characters tells the assistant nothing more than the word BEARER does.

A redaction checklist you can reuse

Redaction means replacing sensitive values with labelled placeholders so the meaning survives and the secret does not. Use the same placeholders every time so you can map them back in your own notes. Angle brackets make them easy to spot and easy to search for.

Credentials and tokens
Cookies, Authorization headers, API keys, JWTs, passwords, reset links. Replace with , , .
Personal data
Names, emails, phone numbers, addresses, IDs. Replace with , .
Infrastructure
Internal hostnames, private IPs, file paths with usernames. Replace with , .
Programme detail
The target name and unreported bug specifics, if the policy asks for confidentiality. Replace with .

Work through the four categories in order, every time, rather than hunting for whatever looks scary. Secrets rarely sit where you expect them. They turn up in query strings, in redirect URLs, in error messages and in the middle of a long log line. A fixed order stops you from stopping early.

Quick check

Which redacted line still lets an assistant explain the problem?

Watch me do it

I will redact a realistic request on your own machine. Nothing here touches a real site. We use a text file and a few sed commands, so you can see the process and confirm it worked. You need a Linux or macOS terminal, or WSL on Windows. Both grep and sed are already installed.

bash
cat > raw-request.txt <<'EOF'
POST /api/orders HTTP/1.1
Host: shop.test.local
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.fake.payload
Cookie: sessionid=a91f33c0de55
X-Api-Key: sk_live_FAKE1234567890

{"email":"jane.doe@example.org","item":42}
EOF
Creates a sample request containing fake secrets for practice. The quoted EOF stops the shell changing anything inside.
bash
grep -nEi 'authorization|cookie|api-key|@' raw-request.txt
Finds lines that look sensitive. -n shows line numbers, -E allows alternatives, -i ignores case.

Expected output from that grep is these four lines, with their line numbers in front:

text
3:Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.fake.payload
4:Cookie: sessionid=a91f33c0de55
5:X-Api-Key: sk_live_FAKE1234567890
7:{"email":"jane.doe@example.org","item":42}
What you should see. The host line and the POST line are not flagged, which is right.
bash
sed -E \
 -e 's/(Authorization: Bearer ).*/\1<BEARER>/' \
 -e 's/(Cookie: ).*/\1<SESSION>/' \
 -e 's/(X-Api-Key: ).*/\1<API_KEY>/' \
 -e 's/[A-Za-z0-9._-]+@[A-Za-z0-9.-]+/<EMAIL>/g' \
 raw-request.txt > clean-request.txt
cat clean-request.txt
Swaps each secret for a placeholder and prints the cleaned file. The backslash at the end of a line just continues the command.
text
POST /api/orders HTTP/1.1
Host: shop.test.local
Authorization: Bearer <BEARER>
Cookie: <SESSION>
X-Api-Key: <API_KEY>

{"email":"<EMAIL>","item":42}
Expected content of clean-request.txt. The request is still easy to understand, and no secret remains.
bash
grep -nEi 'eyJ|sessionid=|sk_live|@' clean-request.txt
Checks for leftovers. Empty output means the patterns are gone.

Now try one yourself before moving on. Add a line to raw-request.txt such as a name field containing a made-up customer name, and a query string like /api/orders?token=abc123 in the first line. Run the same sed script. You will find that the name and the token survive, because none of my rules match them. Write one new rule for the token, run it, and fix the name by hand. That gap is exactly why the read-through matters.

Lab: Secrets in the Context Window

Now you practise on a messier paste. The lab gives you a developer's stack trace, config snippet and logs, and your job is to redact every secret before it would go into a public chatbot. Use the checklist from today, in the same four-category order. This is the named SecurityElites practice lab, so everything in it is safe to handle.

Do the lab before you open the mission. Give yourself about fifteen minutes. Do not hunt for a single answer. Treat it as a sweep, where you read the whole thing, mark candidates, then replace them. Afterwards, compare what you caught against the hints below and add any category you missed to your own checklist.

Your turn

Secrets in the Context Window

Real pastes are untidy. Secrets hide in stack traces, connection strings and log lines you would not think to check. This lab trains your eye on exactly that, using the checklist you just built.

Open the lab in a new tab

What to try

What to notice

  • Secrets appear in places other than headers, such as environment dumps and error messages.
  • Placeholders keep the bug understandable, so redaction does not stop you getting help.
  • A secret repeated twice needs redacting twice.

If it did not work

Redacting only the obvious Authorization header

Scan the whole paste, including URLs, query strings, JSON bodies, cookies and stack traces. Use grep first, then read by eye.

Partly masking a secret, such as keeping the first and last characters

Replace the whole value with a placeholder. Partial values still help an attacker and may be enough to identify a key.

Starting to test before reading the policy

Read scope, exclusions and testing rules first, and write down the in-scope hosts before any request.

Assuming a wildcard scope covers every subdomain

Read the exclusions under it. Check each host against the list before you touch it.

Trusting a clean grep result as proof the paste is safe

Treat grep as a first pass. Read the cleaned text line by line, looking for names, hostnames and anything a pattern would not match.

Recap

  • Scope is the line between research and unauthorised access, so read the policy first
  • Safe harbour only protects you while you follow the policy
  • Anything pasted into a public chatbot should be treated as no longer private
  • Tokens, cookies, customer data and internal details never go into a prompt
  • Placeholders keep the shape of the problem while hiding the secret
  • Tools find patterns, but your own read-through is the final check

Cheat sheet

In scope
Systems the policy explicitly allows you to test
Out of scope
Anything unlisted or excluded; do not touch
Safe harbour
Legal protection for good-faith testing inside the policy
<SESSION>, <BEARER>, <API_KEY>
Standard placeholders for credentials
<EMAIL>, <USER_ID>
Placeholders for personal data
<INTERNAL_HOST>, <PATH>, <TARGET>
Placeholders for infrastructure and programme detail
grep -nEi 'pattern' file
Search a file for sensitive patterns with line numbers
sed -E 's/old/new/' file > clean
Write a redacted copy and keep the original

Before the next day

Mission: Policy summary and redaction checklist

Pick any well-known public bounty programme and read its policy page. This is reading only, so do not send a single request to the target. The aim is to practise pulling the rules out of a long document and to leave yourself a checklist you will use on every later day.

About 30 min

You are done when: notes-day2.md with a five-line scope summary, plus redaction-checklist.md saved in your workbench folder.

Want more? Extend the sed script to also catch JWTs and long hex strings, then test it on a new fake file you write yourself.

Quiz

4 questions. Your score is saved with your progress.

1. Why is safe harbour not a blanket permission to test anything on a company's domain?

2. A response shows an odd 500 error and contains a customer's name. What do you paste into an assistant?

3. Why does a grep check on your cleaned file not prove it is safe?

4. Which replacement best keeps a request useful for an assistant?

Finish the day

Mark the day complete to save your progress.

Go to Day 3

Next: Day 3 is about catching an assistant when it sounds sure and is wrong. The clean, scoped notes you build today give you safe material to test its claims against.

Tell someone you are doing this:WhatsAppXLinkedIn

Your notes

Private to this device. Write what you want to remember from today.