[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EW0PTQG58Y3PFDEP2WZ7MX":3,"skill-same:01M6EW0PTQG58Y3PFDEP2WZ7MX":110},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":71,"commitSha":72,"skillDirectory":73,"forksCount":14,"repositoryHtmlUrl":74,"repositoryHomepageUrl":75,"ownerHtmlUrl":76,"ownerBlogUrl":6,"ownerDescription":77,"updatedAt":78,"install":79,"resources":92},"01M6EW0PTQG58Y3PFDEP2WZ7MX","performing-paste-site-monitoring-for-credentials",null,"Monitor paste sites like Pastebin and GitHub Gists for leaked credentials, API keys, and sensitive data dumps using automated scraping and keyword matching to detect breaches early.","henriquescastilho\u002Fmy-claude","henriquescastilho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153296945?v=4","01M6ESH7EXPXTH9CVQ4K16SRG8","Henrique Scheer","01M6ESH7JHEK2PTNNH4HEH787Z",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"monitoring","credentials","site","performing paste site monitoring for credentials","de","cybersecurity","intelligence","cm","threat","scraping","data-breach","pastebin","credential-leak","paste-monitoring","api","t1003","early-warning","data","threat-intelligence","osint","2026-11-10 10:12:30",false,"---\nname: performing-paste-site-monitoring-for-credentials\ndescription: Monitor paste sites like Pastebin and GitHub Gists for leaked credentials,\n  API keys, and sensitive data dumps using automated scraping and keyword matching\n  to detect breaches early.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- paste-monitoring\n- credential-leak\n- pastebin\n- data-breach\n- threat-intelligence\n- osint\n- early-warning\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-01\n- ID.RA-05\n- DE.CM-01\n- DE.AE-02\nmitre_attack:\n- T1591\n- T1592\n- T1593\n- T1589\n- T1003\n---\n# Performing Paste Site Monitoring for Credentials\n\n## Overview\n\nPaste sites (Pastebin, GitHub Gists, Ghostbin, Dpaste, Hastebin) are frequently used as staging areas for leaked credentials, database dumps, API keys, and sensitive data before wider distribution on dark web forums and Telegram channels. Monitoring these sites provides early breach detection, enabling organizations to respond before stolen data is weaponized. This skill covers building automated paste site monitors using the Pastebin Scraping API, keyword-based alerting, credential pattern matching, and integration with incident response workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing paste site monitoring for credentials\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `requests`, `beautifulsoup4`, `regex`, `pymisp` libraries\n- Pastebin PRO account with Scraping API access ($49.95\u002Fmonth for programmatic access)\n- GitHub API token for Gist monitoring\n- Keyword lists specific to your organization (domains, project names, internal terms)\n- Elasticsearch or database for paste storage and search\n\n## Key Concepts\n\n### Paste Site Threat Landscape\n\nOver 300,000 user credentials are posted on Pastebin annually, averaging 1,000 username\u002Fpassword pairs per leak. Paste sites serve three primary threat intelligence purposes: early breach detection (credentials appear on paste sites before dark web), threat actor profiling (actors use paste sites for C2 configuration, data staging, tool sharing), and malware discovery (encoded payloads, configuration files, C2 addresses).\n\n### Monitoring Approaches\n\nActive monitoring queries paste site APIs or scraping endpoints at regular intervals. The Pastebin Scraping API provides real-time access to new public pastes. For GitHub, the search API allows monitoring Gists and repository commits for exposed secrets. Passive monitoring uses services like IntelX, Dehashed, or Have I Been Pwned that aggregate paste site data.\n\n### Credential Pattern Detection\n\nEffective monitoring uses regex patterns for email:password combinations, API keys (AWS, Azure, GCP, Stripe, Twilio), database connection strings, private keys (SSH, PGP), JWT tokens, and internal hostnames\u002FURLs. Organization-specific keywords (domain names, product names, employee names) reduce false positives.\n\n## Workflow\n\n### Step 1: Pastebin Scraping API Monitor\n\n```python\nimport requests\nimport re\nimport json\nimport time\nfrom datetime import datetime\n\nclass PastebinMonitor:\n    SCRAPING_URL = \"https:\u002F\u002Fscrape.pastebin.com\u002Fapi_scraping.php\"\n    RAW_URL = \"https:\u002F\u002Fscrape.pastebin.com\u002Fapi_scrape_item.php\"\n\n    def __init__(self, keywords, output_dir=\"paste_alerts\"):\n        self.keywords = [k.lower() for k in keywords]\n        self.output_dir = output_dir\n        self.seen_keys = set()\n        self.credential_patterns = {\n            \"email_password\": re.compile(\n                r'[\\w.+-]+@[\\w-]+\\.[\\w.]+[\\s:;|,]+[\\S]{6,}', re.IGNORECASE),\n            \"aws_key\": re.compile(\n                r'AKIA[0-9A-Z]{16}'),\n            \"aws_secret\": re.compile(\n                r'[0-9a-zA-Z\u002F+=]{40}'),\n            \"github_token\": re.compile(\n                r'ghp_[0-9a-zA-Z]{36}'),\n            \"slack_token\": re.compile(\n                r'xox[baprs]-[0-9a-zA-Z-]+'),\n            \"private_key\": re.compile(\n                r'-----BEGIN (?:RSA |EC |DSA )?PRIVATE KEY-----'),\n            \"jwt_token\": re.compile(\n                r'eyJ[A-Za-z0-9-_]+\\.eyJ[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+'),\n            \"connection_string\": re.compile(\n                r'(?:mongodb|postgres|mysql|redis):\u002F\u002F[^\\s]+'),\n            \"api_key_generic\": re.compile(\n                r'(?:api[_-]?key|apikey|access[_-]?token)[\\s]*[=:]\\s*[\"\\']?[\\w-]{20,}',\n                re.IGNORECASE),\n        }\n\n    def fetch_recent_pastes(self, limit=100):\n        \"\"\"Fetch recent public pastes from Pastebin Scraping API.\"\"\"\n        params = {\"limit\": limit}\n        try:\n            resp = requests.get(self.SCRAPING_URL, params=params, timeout=30)\n            if resp.status_code == 200:\n                pastes = resp.json()\n                print(f\"[+] Fetched {len(pastes)} recent pastes\")\n                return pastes\n            else:\n                print(f\"[-] API error: {resp.status_code}\")\n                return []\n        except Exception as e:\n            print(f\"[-] Fetch error: {e}\")\n            return []\n\n    def get_paste_content(self, paste_key):\n        \"\"\"Get the raw content of a paste.\"\"\"\n        params = {\"i\": paste_key}\n        try:\n            resp = requests.get(self.RAW_URL, params=params, timeout=15)\n            if resp.status_code == 200:\n                return resp.text\n            return \"\"\n        except Exception:\n            return \"\"\n\n    def analyze_paste(self, content, paste_metadata):\n        \"\"\"Analyze paste content for credentials and keywords.\"\"\"\n        findings = {\n            \"keyword_matches\": [],\n            \"credential_matches\": {},\n            \"severity\": \"low\",\n        }\n\n        content_lower = content.lower()\n\n        # Check keywords\n        for keyword in self.keywords:\n            if keyword in content_lower:\n                count = content_lower.count(keyword)\n                findings[\"keyword_matches\"].append({\n                    \"keyword\": keyword,\n                    \"count\": count,\n                })\n\n        # Check credential patterns\n        for pattern_name, pattern in self.credential_patterns.items():\n            matches = pattern.findall(content)\n            if matches:\n                findings[\"credential_matches\"][pattern_name] = {\n                    \"count\": len(matches),\n                    \"samples\": matches[:3],\n                }\n\n        # Calculate severity\n        cred_count = sum(\n            m[\"count\"] for m in findings[\"credential_matches\"].values()\n        )\n        if findings[\"keyword_matches\"] and cred_count > 0:\n            findings[\"severity\"] = \"critical\"\n        elif findings[\"keyword_matches\"]:\n            findings[\"severity\"] = \"high\"\n        elif cred_count > 10:\n            findings[\"severity\"] = \"high\"\n        elif cred_count > 0:\n            findings[\"severity\"] = \"medium\"\n\n        return findings\n\n    def monitor_loop(self, interval=120, iterations=None):\n        \"\"\"Continuous monitoring loop.\"\"\"\n        count = 0\n        while iterations is None or count \u003C iterations:\n            pastes = self.fetch_recent_pastes()\n            alerts = []\n\n            for paste in pastes:\n                paste_key = paste.get(\"key\", \"\")\n                if paste_key in self.seen_keys:\n                    continue\n                self.seen_keys.add(paste_key)\n\n                content = self.get_paste_content(paste_key)\n                if not content:\n                    continue\n\n                findings = self.analyze_paste(content, paste)\n                if findings[\"severity\"] != \"low\":\n                    alert = {\n                        \"paste_key\": paste_key,\n                        \"title\": paste.get(\"title\", \"Untitled\"),\n                        \"user\": paste.get(\"user\", \"Anonymous\"),\n                        \"date\": paste.get(\"date\", \"\"),\n                        \"size\": paste.get(\"size\", 0),\n                        \"url\": f\"https:\u002F\u002Fpastebin.com\u002F{paste_key}\",\n                        \"findings\": findings,\n                        \"detected_at\": datetime.now().isoformat(),\n                    }\n                    alerts.append(alert)\n                    print(f\"  [ALERT-{findings['severity'].upper()}] \"\n                          f\"{paste_key}: {findings['keyword_matches']}\")\n\n            if alerts:\n                self._save_alerts(alerts)\n\n            count += 1\n            if iterations is None or count \u003C iterations:\n                time.sleep(interval)\n\n        return alerts\n\n    def _save_alerts(self, alerts):\n        \"\"\"Save alerts to JSON file.\"\"\"\n        filename = f\"{self.output_dir}\u002Falerts_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json\"\n        import os\n        os.makedirs(self.output_dir, exist_ok=True)\n        with open(filename, \"w\") as f:\n            json.dump(alerts, f, indent=2)\n        print(f\"[+] Saved {len(alerts)} alerts to {filename}\")\n\nmonitor = PastebinMonitor(\n    keywords=[\"mycompany.com\", \"internal-project\", \"employee-name\"],\n)\nalerts = monitor.monitor_loop(interval=120, iterations=5)\n```\n\n### Step 2: GitHub Gist and Code Search Monitoring\n\n```python\nclass GitHubSecretMonitor:\n    def __init__(self, github_token, org_keywords):\n        self.token = github_token\n        self.keywords = org_keywords\n        self.headers = {\n            \"Authorization\": f\"token {github_token}\",\n            \"Accept\": \"application\u002Fvnd.github.v3+json\",\n        }\n\n    def search_code(self, query, per_page=30):\n        \"\"\"Search GitHub code for leaked secrets.\"\"\"\n        url = \"https:\u002F\u002Fapi.github.com\u002Fsearch\u002Fcode\"\n        params = {\"q\": query, \"per_page\": per_page}\n        resp = requests.get(url, headers=self.headers, params=params)\n        if resp.status_code == 200:\n            results = resp.json().get(\"items\", [])\n            print(f\"[+] GitHub code search: {len(results)} results for '{query}'\")\n            return results\n        return []\n\n    def search_gists(self, keyword):\n        \"\"\"Search public Gists for sensitive data.\"\"\"\n        url = \"https:\u002F\u002Fapi.github.com\u002Fgists\u002Fpublic\"\n        params = {\"per_page\": 100}\n        resp = requests.get(url, headers=self.headers, params=params)\n        matches = []\n        if resp.status_code == 200:\n            gists = resp.json()\n            for gist in gists:\n                description = (gist.get(\"description\") or \"\").lower()\n                files = gist.get(\"files\", {})\n                for filename, file_info in files.items():\n                    if keyword.lower() in description or keyword.lower() in filename.lower():\n                        matches.append({\n                            \"gist_id\": gist[\"id\"],\n                            \"description\": gist.get(\"description\", \"\"),\n                            \"filename\": filename,\n                            \"url\": gist[\"html_url\"],\n                            \"created_at\": gist[\"created_at\"],\n                        })\n        return matches\n\n    def monitor_org_secrets(self, org_domain):\n        \"\"\"Monitor for organization secrets leaked on GitHub.\"\"\"\n        queries = [\n            f'\"{org_domain}\" password',\n            f'\"{org_domain}\" api_key',\n            f'\"{org_domain}\" secret',\n            f'\"{org_domain}\" token',\n            f'\"{org_domain}\" credentials',\n        ]\n        all_findings = []\n        for query in queries:\n            results = self.search_code(query)\n            for result in results:\n                all_findings.append({\n                    \"query\": query,\n                    \"repo\": result.get(\"repository\", {}).get(\"full_name\", \"\"),\n                    \"path\": result.get(\"path\", \"\"),\n                    \"url\": result.get(\"html_url\", \"\"),\n                    \"score\": result.get(\"score\", 0),\n                })\n            time.sleep(10)  # GitHub rate limiting\n        return all_findings\n\ngh_monitor = GitHubSecretMonitor(\"YOUR_GITHUB_TOKEN\", [\"mycompany.com\"])\nfindings = gh_monitor.monitor_org_secrets(\"mycompany.com\")\n```\n\n### Step 3: Alert and Incident Response Integration\n\n```python\ndef generate_credential_leak_alert(alert_data):\n    \"\"\"Generate incident alert for credential leak detection.\"\"\"\n    alert = {\n        \"title\": f\"Credential Leak Detected - {alert_data.get('severity', 'unknown').upper()}\",\n        \"source\": alert_data.get(\"url\", \"\"),\n        \"detected_at\": alert_data.get(\"detected_at\", \"\"),\n        \"severity\": alert_data.get(\"severity\", \"medium\"),\n        \"summary\": f\"Paste containing organization keywords and credentials found\",\n        \"keyword_matches\": alert_data.get(\"findings\", {}).get(\"keyword_matches\", []),\n        \"credential_types\": list(alert_data.get(\"findings\", {}).get(\"credential_matches\", {}).keys()),\n        \"recommended_actions\": [\n            \"Verify if leaked credentials are valid\",\n            \"Force password reset for affected accounts\",\n            \"Rotate exposed API keys and tokens\",\n            \"Check access logs for unauthorized usage\",\n            \"Report paste for takedown\",\n            \"Update monitoring keywords if new patterns found\",\n        ],\n    }\n    return alert\n```\n\n## Validation Criteria\n\n- Pastebin Scraping API queried successfully with rate limiting\n- Credential patterns detected (email:password, API keys, private keys)\n- Organization-specific keywords matched with context\n- GitHub code search identifies exposed secrets\n- Alerts generated with severity classification\n- Integration with incident response workflow\n\n## References\n\n- [Authentic8: Pastebin for CTI Research](https:\u002F\u002Fwww.authentic8.com\u002Fblog\u002Fwhat-is-pastebin-cyberthreat-intelligence)\n- [PasteHunter GitHub](https:\u002F\u002Fgithub.com\u002Fdibsy\u002Fpastehunter)\n- [Scavenger Credential Crawler](https:\u002F\u002Fgithub.com\u002Frndinfosecguy\u002FScavenger)\n- [Bitdefender: Credentials on Pastebin](https:\u002F\u002Fwww.bitdefender.com\u002Fen-us\u002Fblog\u002Fhotforsecurity\u002Fmore-than-300000-user-credentials-posted-on-pastebin-over-the-last-year)\n- [zSecurity: Pastebin Monitoring](https:\u002F\u002Fzsecurity.org\u002Fglossary\u002Fpastebin-monitoring\u002F)\n- [SecurityBoulevard: Need to Monitor Paste Sites](https:\u002F\u002Fsecurityboulevard.com\u002F2019\u002F11\u002Forvis-data-leak-and-the-need-to-monitor-paste-sites\u002F)\n","# Performing Paste Site Monitoring for Credentials\n\n## Overview\n\nPaste sites (Pastebin, GitHub Gists, Ghostbin, Dpaste, Hastebin) are frequently used as staging areas for leaked credentials, database dumps, API keys, and sensitive data before wider distribution on dark web forums and Telegram channels. Monitoring these sites provides early breach detection, enabling organizations to respond before stolen data is weaponized. This skill covers building automated paste site monitors using the Pastebin Scraping API, keyword-based alerting, credential pattern matching, and integration with incident response workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing paste site monitoring for credentials\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `requests`, `beautifulsoup4`, `regex`, `pymisp` libraries\n- Pastebin PRO account with Scraping API access ($49.95\u002Fmonth for programmatic access)\n- GitHub API token for Gist monitoring\n- Keyword lists specific to your organization (domains, project names, internal terms)\n- Elasticsearch or database for paste storage and search\n\n## Key Concepts\n\n### Paste Site Threat Landscape\n\nOver 300,000 user credentials are posted on Pastebin annually, averaging 1,000 username\u002Fpassword pairs per leak. Paste sites serve three primary threat intelligence purposes: early breach detection (credentials appear on paste sites before dark web), threat actor profiling (actors use paste sites for C2 configuration, data staging, tool sharing), and malware discovery (encoded payloads, configuration files, C2 addresses).\n\n### Monitoring Approaches\n\nActive monitoring queries paste site APIs or scraping endpoints at regular intervals. The Pastebin Scraping API provides real-time access to new public pastes. For GitHub, the search API allows monitoring Gists and repository commits for exposed secrets. Passive monitoring uses services like IntelX, Dehashed, or Have I Been Pwned that aggregate paste site data.\n\n### Credential Pattern Detection\n\nEffective monitoring uses regex patterns for email:password combinations, API keys (AWS, Azure, GCP, Stripe, Twilio), database connection strings, private keys (SSH, PGP), JWT tokens, and internal hostnames\u002FURLs. Organization-specific keywords (domain names, product names, employee names) reduce false positives.\n\n## Workflow\n\n### Step 1: Pastebin Scraping API Monitor\n\n```python\nimport requests\nimport re\nimport json\nimport time\nfrom datetime import datetime\n\nclass PastebinMonitor:\n    SCRAPING_URL = \"https:\u002F\u002Fscrape.pastebin.com\u002Fapi_scraping.php\"\n    RAW_URL = \"https:\u002F\u002Fscrape.pastebin.com\u002Fapi_scrape_item.php\"\n\n    def __init__(self, keywords, output_dir=\"paste_alerts\"):\n        self.keywords = [k.lower() for k in keywords]\n        self.output_dir = output_dir\n        self.seen_keys = set()\n        self.credential_patterns = {\n            \"email_password\": re.compile(\n                r'[\\w.+-]+@[\\w-]+\\.[\\w.]+[\\s:;|,]+[\\S]{6,}', re.IGNORECASE),\n            \"aws_key\": re.compile(\n                r'AKIA[0-9A-Z]{16}'),\n            \"aws_secret\": re.compile(\n                r'[0-9a-zA-Z\u002F+=]{40}'),\n            \"github_token\": re.compile(\n                r'ghp_[0-9a-zA-Z]{36}'),\n            \"slack_token\": re.compile(\n                r'xox[baprs]-[0-9a-zA-Z-]+'),\n            \"private_key\": re.compile(\n                r'-----BEGIN (?:RSA |EC |DSA )?PRIVATE KEY-----'),\n            \"jwt_token\": re.compile(\n                r'eyJ[A-Za-z0-9-_]+\\.eyJ[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+'),\n            \"connection_string\": re.compile(\n                r'(?:mongodb|postgres|mysql|redis):\u002F\u002F[^\\s]+'),\n            \"api_key_generic\": re.compile(\n                r'(?:api[_-]?key|apikey|access[_-]?token)[\\s]*[=:]\\s*[\"\\']?[\\w-]{20,}',\n                re.IGNORECASE),\n        }\n\n    def fetch_recent_pastes(self, limit=100):\n        \"\"\"Fetch recent public pastes from Pastebin Scraping API.\"\"\"\n        params = {\"limit\": limit}\n        try:\n            resp = requests.get(self.SCRAPING_URL, params=params, timeout=30)\n            if resp.status_code == 200:\n                pastes = resp.json()\n                print(f\"[+] Fetched {len(pastes)} recent pastes\")\n                return pastes\n            else:\n                print(f\"[-] API error: {resp.status_code}\")\n                return []\n        except Exception as e:\n            print(f\"[-] Fetch error: {e}\")\n            return []\n\n    def get_paste_content(self, paste_key):\n        \"\"\"Get the raw content of a paste.\"\"\"\n        params = {\"i\": paste_key}\n        try:\n            resp = requests.get(self.RAW_URL, params=params, timeout=15)\n            if resp.status_code == 200:\n                return resp.text\n            return \"\"\n        except Exception:\n            return \"\"\n\n    def analyze_paste(self, content, paste_metadata):\n        \"\"\"Analyze paste content for credentials and keywords.\"\"\"\n        findings = {\n            \"keyword_matches\": [],\n            \"credential_matches\": {},\n            \"severity\": \"low\",\n        }\n\n        content_lower = content.lower()\n\n        # Check keywords\n        for keyword in self.keywords:\n            if keyword in content_lower:\n                count = content_lower.count(keyword)\n                findings[\"keyword_matches\"].append({\n                    \"keyword\": keyword,\n                    \"count\": count,\n                })\n\n        # Check credential patterns\n        for pattern_name, pattern in self.credential_patterns.items():\n            matches = pattern.findall(content)\n            if matches:\n                findings[\"credential_matches\"][pattern_name] = {\n                    \"count\": len(matches),\n                    \"samples\": matches[:3],\n                }\n\n        # Calculate severity\n        cred_count = sum(\n            m[\"count\"] for m in findings[\"credential_matches\"].values()\n        )\n        if findings[\"keyword_matches\"] and cred_count > 0:\n            findings[\"severity\"] = \"critical\"\n        elif findings[\"keyword_matches\"]:\n            findings[\"severity\"] = \"high\"\n        elif cred_count > 10:\n            findings[\"severity\"] = \"high\"\n        elif cred_count > 0:\n            findings[\"severity\"] = \"medium\"\n\n        return findings\n\n    def monitor_loop(self, interval=120, iterations=None):\n        \"\"\"Continuous monitoring loop.\"\"\"\n        count = 0\n        while iterations is None or count \u003C iterations:\n            pastes = self.fetch_recent_pastes()\n            alerts = []\n\n            for paste in pastes:\n                paste_key = paste.get(\"key\", \"\")\n                if paste_key in self.seen_keys:\n                    continue\n                self.seen_keys.add(paste_key)\n\n                content = self.get_paste_content(paste_key)\n                if not content:\n                    continue\n\n                findings = self.analyze_paste(content, paste)\n                if findings[\"severity\"] != \"low\":\n                    alert = {\n                        \"paste_key\": paste_key,\n                        \"title\": paste.get(\"title\", \"Untitled\"),\n                        \"user\": paste.get(\"user\", \"Anonymous\"),\n                        \"date\": paste.get(\"date\", \"\"),\n                        \"size\": paste.get(\"size\", 0),\n                        \"url\": f\"https:\u002F\u002Fpastebin.com\u002F{paste_key}\",\n                        \"findings\": findings,\n                        \"detected_at\": datetime.now().isoformat(),\n                    }\n                    alerts.append(alert)\n                    print(f\"  [ALERT-{findings['severity'].upper()}] \"\n                          f\"{paste_key}: {findings['keyword_matches']}\")\n\n            if alerts:\n                self._save_alerts(alerts)\n\n            count += 1\n            if iterations is None or count \u003C iterations:\n                time.sleep(interval)\n\n        return alerts\n\n    def _save_alerts(self, alerts):\n        \"\"\"Save alerts to JSON file.\"\"\"\n        filename = f\"{self.output_dir}\u002Falerts_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json\"\n        import os\n        os.makedirs(self.output_dir, exist_ok=True)\n        with open(filename, \"w\") as f:\n            json.dump(alerts, f, indent=2)\n        print(f\"[+] Saved {len(alerts)} alerts to {filename}\")\n\nmonitor = PastebinMonitor(\n    keywords=[\"mycompany.com\", \"internal-project\", \"employee-name\"],\n)\nalerts = monitor.monitor_loop(interval=120, iterations=5)\n```\n\n### Step 2: GitHub Gist and Code Search Monitoring\n\n```python\nclass GitHubSecretMonitor:\n    def __init__(self, github_token, org_keywords):\n        self.token = github_token\n        self.keywords = org_keywords\n        self.headers = {\n            \"Authorization\": f\"token {github_token}\",\n            \"Accept\": \"application\u002Fvnd.github.v3+json\",\n        }\n\n    def search_code(self, query, per_page=30):\n        \"\"\"Search GitHub code for leaked secrets.\"\"\"\n        url = \"https:\u002F\u002Fapi.github.com\u002Fsearch\u002Fcode\"\n        params = {\"q\": query, \"per_page\": per_page}\n        resp = requests.get(url, headers=self.headers, params=params)\n        if resp.status_code == 200:\n            results = resp.json().get(\"items\", [])\n            print(f\"[+] GitHub code search: {len(results)} results for '{query}'\")\n            return results\n        return []\n\n    def search_gists(self, keyword):\n        \"\"\"Search public Gists for sensitive data.\"\"\"\n        url = \"https:\u002F\u002Fapi.github.com\u002Fgists\u002Fpublic\"\n        params = {\"per_page\": 100}\n        resp = requests.get(url, headers=self.headers, params=params)\n        matches = []\n        if resp.status_code == 200:\n            gists = resp.json()\n            for gist in gists:\n                description = (gist.get(\"description\") or \"\").lower()\n                files = gist.get(\"files\", {})\n                for filename, file_info in files.items():\n                    if keyword.lower() in description or keyword.lower() in filename.lower():\n                        matches.append({\n                            \"gist_id\": gist[\"id\"],\n                            \"description\": gist.get(\"description\", \"\"),\n                            \"filename\": filename,\n                            \"url\": gist[\"html_url\"],\n                            \"created_at\": gist[\"created_at\"],\n                        })\n        return matches\n\n    def monitor_org_secrets(self, org_domain):\n        \"\"\"Monitor for organization secrets leaked on GitHub.\"\"\"\n        queries = [\n            f'\"{org_domain}\" password',\n            f'\"{org_domain}\" api_key',\n            f'\"{org_domain}\" secret',\n            f'\"{org_domain}\" token',\n            f'\"{org_domain}\" credentials',\n        ]\n        all_findings = []\n        for query in queries:\n            results = self.search_code(query)\n            for result in results:\n                all_findings.append({\n                    \"query\": query,\n                    \"repo\": result.get(\"repository\", {}).get(\"full_name\", \"\"),\n                    \"path\": result.get(\"path\", \"\"),\n                    \"url\": result.get(\"html_url\", \"\"),\n                    \"score\": result.get(\"score\", 0),\n                })\n            time.sleep(10)  # GitHub rate limiting\n        return all_findings\n\ngh_monitor = GitHubSecretMonitor(\"YOUR_GITHUB_TOKEN\", [\"mycompany.com\"])\nfindings = gh_monitor.monitor_org_secrets(\"mycompany.com\")\n```\n\n### Step 3: Alert and Incident Response Integration\n\n```python\ndef generate_credential_leak_alert(alert_data):\n    \"\"\"Generate incident alert for credential leak detection.\"\"\"\n    alert = {\n        \"title\": f\"Credential Leak Detected - {alert_data.get('severity', 'unknown').upper()}\",\n        \"source\": alert_data.get(\"url\", \"\"),\n        \"detected_at\": alert_data.get(\"detected_at\", \"\"),\n        \"severity\": alert_data.get(\"severity\", \"medium\"),\n        \"summary\": f\"Paste containing organization keywords and credentials found\",\n        \"keyword_matches\": alert_data.get(\"findings\", {}).get(\"keyword_matches\", []),\n        \"credential_types\": list(alert_data.get(\"findings\", {}).get(\"credential_matches\", {}).keys()),\n        \"recommended_actions\": [\n            \"Verify if leaked credentials are valid\",\n            \"Force password reset for affected accounts\",\n            \"Rotate exposed API keys and tokens\",\n            \"Check access logs for unauthorized usage\",\n            \"Report paste for takedown\",\n            \"Update monitoring keywords if new patterns found\",\n        ],\n    }\n    return alert\n```\n\n## Validation Criteria\n\n- Pastebin Scraping API queried successfully with rate limiting\n- Credential patterns detected (email:password, API keys, private keys)\n- Organization-specific keywords matched with context\n- GitHub code search identifies exposed secrets\n- Alerts generated with severity classification\n- Integration with incident response workflow\n\n## References\n\n- [Authentic8: Pastebin for CTI Research](https:\u002F\u002Fwww.authentic8.com\u002Fblog\u002Fwhat-is-pastebin-cyberthreat-intelligence)\n- [PasteHunter GitHub](https:\u002F\u002Fgithub.com\u002Fdibsy\u002Fpastehunter)\n- [Scavenger Credential Crawler](https:\u002F\u002Fgithub.com\u002Frndinfosecguy\u002FScavenger)\n- [Bitdefender: Credentials on Pastebin](https:\u002F\u002Fwww.bitdefender.com\u002Fen-us\u002Fblog\u002Fhotforsecurity\u002Fmore-than-300000-user-credentials-posted-on-pastebin-over-the-last-year)\n- [zSecurity: Pastebin Monitoring](https:\u002F\u002Fzsecurity.org\u002Fglossary\u002Fpastebin-monitoring\u002F)\n- [SecurityBoulevard: Need to Monitor Paste Sites](https:\u002F\u002Fsecurityboulevard.com\u002F2019\u002F11\u002Forvis-data-leak-and-the-need-to-monitor-paste-sites\u002F)\n",{"name":5,"tags":57,"author":58,"domain":37,"license":15,"version":59,"nist_csf":60,"subdomain":50,"description":7,"mitre_attack":65},[45,44,43,42,50,51,48],"mahipal","1.0",[61,62,63,64],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[66,67,68,69,70],"T1591","T1592","T1593","T1589","T1003","main","7925716f065257435fdb12e97f7e52842147d5ad",".claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude","https:\u002F\u002Fclaude.com\u002Fclaude-code","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho","Software · Applied AI · Quantitative Modeling · Building with Claude.","2026-06-10 12:24:46",{"source":8,"skillName":5,"commands":80,"prompt":90,"zipAvailable":91},[81,84,87],{"tool":82,"command":83},"npx","npx skills add henriquescastilho\u002Fmy-claude --skill performing-paste-site-monitoring-for-credentials",{"tool":85,"command":86},"bunx","bunx skills add henriquescastilho\u002Fmy-claude --skill performing-paste-site-monitoring-for-credentials",{"tool":88,"command":89},"pnpm","pnpm dlx skills add henriquescastilho\u002Fmy-claude --skill performing-paste-site-monitoring-for-credentials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FSKILL.md",true,[93,98,104],{"path":94,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FLICENSE",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fapi-reference.md","REFERENCE","参考文档",1470,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002Freferences\u002Fapi-reference.md",{"path":105,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":108,"sourceHtmlUrl":109},"scripts\u002Fagent.py","SCRIPT","脚本",7138,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002Fscripts\u002Fagent.py",[111,150,159,168,190,216],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":130,"publishedAt":52},"01M6F0B6XPQ65AX2X0DWK8KT3E","markitdown","Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.","MIT","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[118,121,124,127],{"categoryNo":119,"categoryName":120,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":125,"categoryName":126,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":128,"categoryName":129,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000034","行政与办公人员",[113,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],"docx","PDF","pptx","xlsx","documents","csv","ocr","Audio","Bash","markdown","convert","read","write","edit","html","images","files","youtube","with",{"skillNo":151,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":158,"publishedAt":52},"01M6F06SBHR9F0SDWE282Y8075","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fscientific_writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[154,155,156,157],{"categoryNo":119,"categoryName":120,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":125,"categoryName":126,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":128,"categoryName":129,"taxonomyType":29,"taxonomyTypeDesc":30},[113,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],{"skillNo":160,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":167,"publishedAt":52},"01M6F02D4R14EJAPBWVDF9J9VQ","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[163,164,165,166],{"categoryNo":119,"categoryName":120,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":125,"categoryName":126,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":128,"categoryName":129,"taxonomyType":29,"taxonomyTypeDesc":30},[113,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":52},"01M6F000KS6YB4MKS774G4R8ND","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fzarr-python\u002FSKILL.md",[],[175,176,177,178,179,180,181,182,183,184,185,186,187,188,189],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":197,"publishedAt":52},"01M6EZZJWFXM1GR78KTW6J0DN8","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fwhat-if-oracle\u002FSKILL.md",[196],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[198,199,200,201,202,203,204,205,206,207,208,142,143,209,210,211,212,213,214,215],"oracle","what if oracle","go","run","ux","futures","analysis","explore","decision","branch","question","idea","exploration","options","stress-test","strategies","scenario","stress",{"skillNo":217,"name":218,"nameZh":6,"description":219,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":115,"licenseFileUrl":6,"sourceHtmlUrl":220,"categories":221,"keywords":232,"publishedAt":52},"01M6EZZCXAEB49RXGQCJX5E8GB","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fvenue-templates\u002FSKILL.md",[222,225,228,229],{"categoryNo":223,"categoryName":224,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":226,"categoryName":227,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":230,"categoryName":231,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000036","内容创作者",[233,234,235,236,237,238,239,240,139,241,142,143,144,242,243,244,245,246,189,247],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements","formatting","journal","chi"]