# How to Initialize a Case with Authorization in reverse-skill on Windows

> Initialize a reverse-skill case with authorization on Windows using PowerShell. Learn how to set auth.status=granted to bypass authorization gates and create scope.md.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: how-to-guide
- Published: 2026-08-24

---

**To initialize a case with authorization on Windows, run `skills/scripts/case-init.ps1` using PowerShell with the `-AuthGranted` switch and required target parameters; this creates a `work/<case>/scope.md` file with `auth.status=granted`, satisfying the framework's mandatory authorization gate defined in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md).**

The *reverse-skill* repository by `zhaoxuya520/reverse-skill` enforces a strict security model that blocks all Analysis, Control, or Target (ACT) operations until a case is formally authorized. On Windows systems, the `skills/scripts/case-init.ps1` PowerShell script serves as the sole entry point for creating compliant case structures that include the required authorization metadata.

## Understanding the Authorization Requirement

According to [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) and the contract defined in [`skills/ops/scope-contract.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/scope-contract.md), every case must contain an `auth.status=granted` entry before any exploitation or reverse-engineering activity is permitted. The [`skills/MASTER-ROUTING.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/MASTER-ROUTING.md) file specifies that tools like `master-route.ps1` and `case-guard.ps1` check this flag and will abort execution if authorization is pending or missing. This design ensures that analysts explicitly document permission and scope boundaries prior to engaging with target systems.

## Step-by-Step Case Initialization with Authorization

Running the initialization script without the authorization flags creates a case with `auth.status=pending`, which cannot execute target-facing actions. To satisfy the authorization requirement during creation, you must provide the `-AuthGranted` switch along with network constraints.

### Basic Authorized Initialization

Use PowerShell with the `-NoProfile` and `-ExecutionPolicy Bypass` flags to ensure a clean execution environment. The following command creates an authorized case named `my-case`:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/case-init.ps1 `
    -Hint "web pentest" `
    -CaseName "my-case" `
    -AuthGranted `
    -TargetUrl "https://target.example.com" `
    -NetworkProfile authorized_target_only

```

### Required Authorization Parameters

- **`-AuthGranted`**: Signals that you have obtained explicit written or contractual permission to interact with the target system.
- **`-TargetUrl`**: Records the authorized target address inside `work/<case>/scope.md`.
- **`-NetworkProfile`**: Defines the network boundary context. Valid values include `authorized_target_only`, `lab_only`, and `offline`, as interpreted by the routing layer.

## Optional Configuration Parameters

The `case-init.ps1` script supports additional flags for specialized workflows. These parameters allow you to customize the case structure without manual file editing:

- **`-ProjectRoot <path>`**: Specifies a custom analysis project root directory instead of the default repository root.
- **`-Preset <name>`**: Applies a predefined configuration template. For example, `offline-sample` pre-populates the case with template files for offline analysis.
- **`-Sample <file>`**: Provides a path to a local sample file (APK, binary, packet capture, etc.) when using the `offline-sample` preset.

## Verifying Authorization Status

After script execution, confirm that authorization was properly recorded by inspecting `work/<case>/scope.md`. The file must contain the line `auth.status=granted`. If this field is absent or set to `pending`, subsequent operations will fail with an authorization error. You can also verify the `TargetUrl` and `NetworkProfile` values in the same file to ensure they match your engagement scope.

## Practical Code Examples

### Creating a Case for a CTF Lab

For capture-the-flag competitions or isolated lab environments, use the `lab_only` network profile:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/case-init.ps1 `
    -Hint "CTF web challenge" `
    -CaseName "ctf-2026" `
    -AuthGranted `
    -TargetUrl "https://challenge.example" `
    -NetworkProfile lab_only

```

### Offline Binary Analysis with a Sample

When analyzing local files without network interaction, combine the `offline` profile with a sample preset:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/case-init.ps1 `
    -Hint "offline apk reverse" `
    -CaseName "apk-sample" `
    -Preset offline-sample `
    -Sample ".\app.apk" `
    -NetworkProfile offline

```

## Summary

- The `skills/scripts/case-init.ps1` script is the mandatory Windows entry point for case creation in *reverse-skill*.
- Authorization requires the `-AuthGranted` parameter combined with `-TargetUrl` and `-NetworkProfile` to generate a valid [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md).
- The framework explicitly blocks all ACT operations unless `work/<case>/scope.md` contains `auth.status=granted`.
- Optional parameters like `-Preset` and `-Sample` streamline offline or specialized workflows.
- Always verify the generated [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) file before proceeding with target-facing actions.

## Frequently Asked Questions

### What happens if I run case-init.ps1 without the -AuthGranted flag?

Running the script without `-AuthGranted` creates the case directory and [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) with `auth.status=pending`. According to [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) and the routing logic in [`skills/MASTER-ROUTING.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/MASTER-ROUTING.md), all subsequent attempts to execute target-facing ACT operations will be blocked until the status is manually updated or the case is re-initialized with proper authorization.

### Can I authorize a case after the initial creation?

Yes, you can manually edit `work/<case>/scope.md` to change `auth.status` to `granted` and add the required `TargetUrl` and `NetworkProfile` fields. However, using the `-AuthGranted` parameter during initialization is the recommended workflow to ensure all required metadata is populated correctly according to [`skills/ops/scope-contract.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/scope-contract.md).

### Which NetworkProfile values are supported by the framework?

The source code and documentation indicate support for `authorized_target_only` (production targets with explicit permission), `lab_only` (isolated laboratory environments), and `offline` (air-gapped analysis with no network connectivity). These values constrain the operational boundaries recorded in [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) and validated by `case-guard.ps1`.

### Where does the script store the generated case files?

By default, `case-init.ps1` creates a `work/<case>/` subdirectory within the project root (or the path specified by `-ProjectRoot`). This directory contains [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md), [`timeline.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/timeline.md), and other artifacts required by the *reverse-skill* framework for the duration of the engagement.