[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GZDM7C11V5PN3E4TYF5QC9":3,"skill-same:01M6GZDM7C11V5PN3E4TYF5QC9":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":27,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":63,"install":64,"resources":77},"01M6GZDM7C11V5PN3E4TYF5QC9","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.","micsapp\u002Fmicstec-skills","micsapp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F82411001?v=4","01M6GWCFQ6D3PV8EHNY62NN5VW","01M6GWCFVE1PA5HG0DKC7AMFJ3",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"monitoring","performing","for","paste","site","performing paste site monitoring for credentials","credentials","api","paste-monitoring","credential-leak","pastebin","data-breach","early-warning","scraping","threat","intelligence","data","threat-intelligence","breach","cybersecurity","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, API keys, and sensitive data dumps using automated scraping and keyword matching to detect breaches early.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags: [paste-monitoring, credential-leak, pastebin, data-breach, threat-intelligence, osint, early-warning]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\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":53,"author":55,"domain":47,"license":14,"version":56,"subdomain":45,"description":7},[36,37,38,39,45,54,40],"osint","mahipal","1.0","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials",0,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills","https:\u002F\u002Fgithub.com\u002Fmicsapp","2026-03-20 11:24:18",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add micsapp\u002Fmicstec-skills --skill performing-paste-site-monitoring-for-credentials",{"tool":70,"command":71},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill performing-paste-site-monitoring-for-credentials",{"tool":73,"command":74},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill performing-paste-site-monitoring-for-credentials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FSKILL.md",true,[78,83,89],{"path":79,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002FLICENSE",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fapi-reference.md","REFERENCE","参考文档",1470,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002Freferences\u002Fapi-reference.md",{"path":90,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Fagent.py","SCRIPT","脚本",7138,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-paste-site-monitoring-for-credentials\u002Fscripts\u002Fagent.py",[96,124,154,175,195,220],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":105,"publishedAt":48},"01M6HBTJ02FXBFG9NYEHHYAP52","azure-apim-architecture","Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.","MIT","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fazure-apim-architecture\u002FSKILL.md",[103,104],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},[106,107,108,109,110,111,112,113,114,35,115,116,117,118,119,120,121,122,123,30],"architecture","azure","azure apim architecture","component","authentication","gateway","topology","Optimization","network","team","environment","multi-environment","workspaces","instances","selection","strategies","azure api management","mode",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":138,"publishedAt":48},"01M6HBT7J4H082JEEA670B3EQ9","apiops-deployment","Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep\u002FTerraform), CI\u002FCD pipelines (GitHub Actions\u002FAzure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapiops-deployment\u002FSKILL.md",[130,131,134,137],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":132,"categoryName":133,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":135,"categoryName":136,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},[139,140,141,142,107,143,144,145,146,147,148,149,35,115,121,150,151,122,152,153],"deployment","apiops deployment","workflows","azure devops","infrastructure","code","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":161,"publishedAt":48},"01M6HBT2HEA23THNE9E00GYQBE","apim-policy-authoring","Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request\u002Fresponse processing logic.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapim-policy-authoring\u002FSKILL.md",[160],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[162,163,164,165,107,110,35,115,166,167,168,169,170,171,172,122,173,174,153,30],"policy","authoring","apim policy authoring","security","access","use","ready","api security","Access Control","error","processing","cors configuration","production-ready",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":183,"publishedAt":48},"01M6HBSY65SB29J9WE9KYD0K6T","api-security-review","Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapi-security-review\u002FSKILL.md",[181,182],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},[184,165,185,35,169,186,107,139,187,188,189,190,115,191,122,192,193,194,123,30],"review","security review","api security review","benchmark","verification","owasp","owasp-api","alignment","azure security","reviews","top",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":48},"01M6HBSRW4PDFE6K4F8JYPZQ05","jira-cli","Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fjira-cli\u002FSKILL.md",[],[202,203,204,141,205,206,207,208,35,209,210,211,212,213,214,215,216,217,218,219],"cli","jira","jira cli","init","tasks","create","issues","common","work","command","edit","list","view","project","project work","token","line","sprints",{"skillNo":221,"name":222,"nameZh":6,"description":223,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":224,"categories":225,"keywords":226,"publishedAt":48},"01M6HBSNS3JHMW603G47TWE31H","calculator","Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fcalculator\u002FSKILL.md",[],[222,227,228,229,230,231,232,167,233,234],"npm","js","calculate","node","math","user","compute","errors"]