[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EPSTSHW19ZGPPW4D3CTBGJ":3,"skill-same:01M7EPSTSHW19ZGPPW4D3CTBGJ":93},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M7EPSTSHW19ZGPPW4D3CTBGJ","performing-cloud-storage-forensic-acquisition",null,"Perform forensic acquisition of cloud storage services including Google Drive, OneDrive, Dropbox, and Box by pulling API-based remote data such as revision history and audit logs, and collecting local sync-client artifacts including KAPE targets and OneDrive databases from endpoints. Use during incident response or e-discovery when evidence resides in cloud-synced storage and both cloud-side and endpoint-side artifacts must be preserved.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-cloud-storage-forensic-acquisition\ndescription: Perform forensic acquisition of cloud storage services including Google\n  Drive, OneDrive, Dropbox, and Box by pulling API-based remote data such as revision\n  history and audit logs, and collecting local sync-client artifacts including KAPE\n  targets and OneDrive databases from endpoints. Use during incident response or e-discovery\n  when evidence resides in cloud-synced storage and both cloud-side and endpoint-side\n  artifacts must be preserved.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- cloud-forensics\n- google-drive\n- onedrive\n- dropbox\n- box\n- cloud-acquisition\n- api-forensics\n- sync-client\n- endpoint-artifacts\n- magnet-axiom\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_ai_rmf:\n- MEASURE-2.7\n- MAP-5.1\n- MANAGE-2.4\natlas_techniques:\n- AML.T0070\n- AML.T0066\n- AML.T0082\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1005\n- T1074\n- T1119\n- T1070\n- T1059\n---\n\n# Performing Cloud Storage Forensic Acquisition\n\n## Overview\n\nCloud storage forensic acquisition involves collecting digital evidence from services like Google Drive, OneDrive, Dropbox, and Box through both API-based remote acquisition and local endpoint artifact analysis. Modern investigations must address the challenge that cloud-synced files may exist in multiple states: locally synchronized, cloud-only (on-demand), cached, and deleted. Endpoint devices that have synchronized with cloud storage contain a wealth of metadata about locally synced files, files present only in the cloud, and even deleted items recoverable from cache folders. API-based acquisition using service-specific APIs provides direct access to remote data with valid credentials and proper legal authorization.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing cloud storage forensic acquisition\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- Legal authorization (warrant, consent, or corporate policy) for cloud data access\n- Valid user credentials or administrative access tokens\n- Magnet AXIOM Cloud, Cellebrite Cloud Analyzer, or equivalent tool\n- KAPE with cloud storage target files\n- Python 3.8+ with google-api-python-client, msal, dropbox SDK\n- Network connectivity for API-based acquisition\n\n## Acquisition Methods\n\n### Method 1: API-Based Remote Acquisition\n\n#### Google Drive API Acquisition\n\n```python\nfrom google.oauth2.credentials import Credentials\nfrom googleapiclient.discovery import build\nfrom googleapiclient.http import MediaIoBaseDownload\nimport io\nimport os\nimport json\nfrom datetime import datetime\n\n\nclass GoogleDriveForensicAcquisition:\n    \"\"\"Forensically acquire files and metadata from Google Drive via API.\"\"\"\n\n    def __init__(self, credentials_path: str, output_dir: str):\n        self.creds = Credentials.from_authorized_user_file(credentials_path)\n        self.service = build(\"drive\", \"v3\", credentials=self.creds)\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n        self.acquisition_log = []\n\n    def list_all_files(self, include_trashed: bool = True) -> list:\n        \"\"\"List all files including trashed items.\"\"\"\n        files = []\n        page_token = None\n        query = \"\" if include_trashed else \"trashed = false\"\n\n        while True:\n            results = self.service.files().list(\n                q=query,\n                pageSize=1000,\n                fields=\"nextPageToken, files(id, name, mimeType, size, \"\n                       \"createdTime, modifiedTime, trashed, trashedTime, \"\n                       \"owners, sharingUser, permissions, md5Checksum, \"\n                       \"parents, webViewLink, driveId)\",\n                pageToken=page_token\n            ).execute()\n\n            files.extend(results.get(\"files\", []))\n            page_token = results.get(\"nextPageToken\")\n            if not page_token:\n                break\n\n        return files\n\n    def download_file(self, file_id: str, file_name: str, mime_type: str) -> str:\n        \"\"\"Download a file from Google Drive preserving forensic integrity.\"\"\"\n        output_path = os.path.join(self.output_dir, file_name)\n\n        if mime_type.startswith(\"application\u002Fvnd.google-apps\"):\n            export_formats = {\n                \"application\u002Fvnd.google-apps.document\": \"application\u002Fpdf\",\n                \"application\u002Fvnd.google-apps.spreadsheet\": \"application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n                \"application\u002Fvnd.google-apps.presentation\": \"application\u002Fpdf\",\n            }\n            export_mime = export_formats.get(mime_type, \"application\u002Fpdf\")\n            request = self.service.files().export_media(fileId=file_id, mimeType=export_mime)\n        else:\n            request = self.service.files().get_media(fileId=file_id)\n\n        with io.FileIO(output_path, \"wb\") as fh:\n            downloader = MediaIoBaseDownload(fh, request)\n            done = False\n            while not done:\n                _, done = downloader.next_chunk()\n\n        self.acquisition_log.append({\n            \"timestamp\": datetime.utcnow().isoformat(),\n            \"file_id\": file_id,\n            \"file_name\": file_name,\n            \"output_path\": output_path,\n            \"action\": \"downloaded\"\n        })\n        return output_path\n\n    def get_activity_log(self, file_id: str) -> list:\n        \"\"\"Retrieve activity\u002Frevision history for a specific file.\"\"\"\n        revisions = self.service.revisions().list(\n            fileId=file_id,\n            fields=\"revisions(id, modifiedTime, lastModifyingUser, size, md5Checksum)\"\n        ).execute()\n        return revisions.get(\"revisions\", [])\n\n    def export_acquisition_report(self) -> str:\n        \"\"\"Export acquisition log for chain of custody documentation.\"\"\"\n        report_path = os.path.join(self.output_dir, \"acquisition_log.json\")\n        with open(report_path, \"w\") as f:\n            json.dump({\n                \"acquisition_start\": self.acquisition_log[0][\"timestamp\"] if self.acquisition_log else None,\n                \"acquisition_end\": datetime.utcnow().isoformat(),\n                \"total_files\": len(self.acquisition_log),\n                \"entries\": self.acquisition_log\n            }, f, indent=2)\n        return report_path\n```\n\n#### OneDrive \u002F Microsoft 365 API Acquisition\n\n```python\nimport msal\nimport requests\nimport os\nimport json\nfrom datetime import datetime\n\n\nclass OneDriveForensicAcquisition:\n    \"\"\"Forensically acquire files and metadata from OneDrive via Microsoft Graph API.\"\"\"\n\n    def __init__(self, client_id: str, tenant_id: str, client_secret: str, output_dir: str):\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n\n        authority = f\"https:\u002F\u002Flogin.microsoftonline.com\u002F{tenant_id}\"\n        self.app = msal.ConfidentialClientApplication(\n            client_id, authority=authority, client_credential=client_secret\n        )\n        token_result = self.app.acquire_token_for_client(\n            scopes=[\"https:\u002F\u002Fgraph.microsoft.com\u002F.default\"]\n        )\n        self.access_token = token_result.get(\"access_token\")\n        self.headers = {\"Authorization\": f\"Bearer {self.access_token}\"}\n        self.base_url = \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\"\n\n    def list_user_files(self, user_id: str) -> list:\n        \"\"\"List all files in user's OneDrive.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Froot\u002Fchildren\"\n        files = []\n        while url:\n            response = requests.get(url, headers=self.headers)\n            data = response.json()\n            files.extend(data.get(\"value\", []))\n            url = data.get(\"@odata.nextLink\")\n        return files\n\n    def download_file(self, user_id: str, item_id: str, filename: str) -> str:\n        \"\"\"Download a file from OneDrive.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Fitems\u002F{item_id}\u002Fcontent\"\n        response = requests.get(url, headers=self.headers, stream=True)\n        output_path = os.path.join(self.output_dir, filename)\n        with open(output_path, \"wb\") as f:\n            for chunk in response.iter_content(chunk_size=8192):\n                f.write(chunk)\n        return output_path\n\n    def get_deleted_items(self, user_id: str) -> list:\n        \"\"\"Retrieve items from OneDrive recycle bin.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Fspecial\u002Frecyclebin\u002Fchildren\"\n        response = requests.get(url, headers=self.headers)\n        return response.json().get(\"value\", [])\n```\n\n### Method 2: Local Endpoint Artifact Collection\n\n#### KAPE Targets for Cloud Storage\n\n```powershell\n# Collect all cloud storage artifacts using KAPE\nkape.exe --tsource C: --tdest C:\\Output\\CloudArtifacts --target GoogleDrive,OneDrive,Dropbox,Box\n\n# OneDrive artifacts\n# %USERPROFILE%\\AppData\\Local\\Microsoft\\OneDrive\\logs\\\n# %USERPROFILE%\\AppData\\Local\\Microsoft\\OneDrive\\settings\\\n# %USERPROFILE%\\OneDrive\\\n\n# Google Drive artifacts\n# %USERPROFILE%\\AppData\\Local\\Google\\DriveFS\\\n# Contains metadata SQLite databases and cached files\n\n# Dropbox artifacts\n# %USERPROFILE%\\AppData\\Local\\Dropbox\\\n# %USERPROFILE%\\Dropbox\\.dropbox.cache\\\n# Contains filecache.dbx (encrypted SQLite), host.dbx, config.dbx\n```\n\n#### OneDrive Local Database Analysis\n\n```python\nimport sqlite3\nimport os\n\ndef analyze_onedrive_sync_engine(db_path: str) -> list:\n    \"\"\"Analyze OneDrive SyncEngineDatabase for file metadata.\"\"\"\n    conn = sqlite3.connect(db_path)\n    cursor = conn.cursor()\n\n    # Query for all tracked files including cloud-only items\n    cursor.execute(\"\"\"\n        SELECT fileName, fileSize, lastChange,\n               resourceID, parentResourceID, eTag\n        FROM od_ClientFile_Records\n        ORDER BY lastChange DESC\n    \"\"\")\n\n    files = []\n    for row in cursor.fetchall():\n        files.append({\n            \"filename\": row[0],\n            \"size\": row[1],\n            \"last_change\": row[2],\n            \"resource_id\": row[3],\n            \"parent_id\": row[4],\n            \"etag\": row[5]\n        })\n\n    conn.close()\n    return files\n```\n\n## Cloud Storage Artifacts Summary\n\n| Service | Local Database | Cache Location | Log Files |\n|---------|---------------|----------------|-----------|\n| OneDrive | SyncEngineDatabase.db | %LOCALAPPDATA%\\Microsoft\\OneDrive\\cache\\ | %LOCALAPPDATA%\\Microsoft\\OneDrive\\logs\\ |\n| Google Drive | metadata_sqlite_db | %LOCALAPPDATA%\\Google\\DriveFS\\{account}\\content_cache\\ | %LOCALAPPDATA%\\Google\\DriveFS\\Logs\\ |\n| Dropbox | filecache.dbx (encrypted) | %APPDATA%\\Dropbox\\.dropbox.cache\\ | %APPDATA%\\Dropbox\\logs\\ |\n| Box | sync_db | %LOCALAPPDATA%\\Box\\Box\\cache\\ | %LOCALAPPDATA%\\Box\\Box\\logs\\ |\n\n## References\n\n- SANS Cloud Storage Acquisition: https:\u002F\u002Fwww.sans.org\u002Fblog\u002Fcloud-storage-acquisition-from-endpoint-devices\n- Magnet AXIOM Cloud: https:\u002F\u002Fwww.magnetforensics.com\u002Fblog\u002Fhow-to-acquire-and-analyze-cloud-data-with-magnet-axiom\u002F\n- AWS Cloud Forensics Framework: https:\u002F\u002Fdocs.aws.amazon.com\u002Fprescriptive-guidance\u002Flatest\u002Fsecurity-reference-architecture\u002Fcyber-forensics.html\n- API-Based Forensic Acquisition of Cloud Drives: https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.06542\n\n## Example Output\n\n```text\n$ python3 cloud_forensic_acquire.py --provider google-drive --auth \u002Ftokens\u002Fgdrive_token.json \\\n    --user jsmith@corporate.com --output \u002Facquisition\u002Fgdrive\n\nCloud Storage Forensic Acquisition Tool v3.2\n==============================================\nProvider:    Google Drive\nAccount:     jsmith@corporate.com\nStart Time:  2024-01-19 08:00:15 UTC\nAuth Method: Admin SDK (domain-wide delegation)\n\n[+] Enumerating files...\n    Total files:        2,345\n    Total folders:      178\n    Shared with me:     456\n    Trashed items:      89 (included in acquisition)\n    Total size:         14.7 GB\n\n[+] Acquiring file contents...\n    Downloaded:    2,345 \u002F 2,345  [████████████████████████████████] 100%\n    Errors:        0\n    Elapsed:       18m 32s\n\n[+] Acquiring metadata...\n    File metadata:      2,345 entries\n    Revision history:   8,912 revisions across 1,234 files\n    Sharing permissions: 3,456 permission entries\n    Activity log:       12,345 events\n\n[+] Acquiring trashed items...\n    Recovered:     89 \u002F 89 items (234 MB)\n\n--- Acquisition Log ---\nTimestamp (UTC)          | Action           | File                                    | Size    | SHA-256\n2024-01-19 08:00:45      | Downloaded       | \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm        | 245 KB  | 7a3b8c9d...\n2024-01-19 08:00:46      | Downloaded       | \u002FMy Drive\u002FFinance\u002FBudget_2024.xlsx       | 1.2 MB  | 8b4c9d0e...\n...\n2024-01-19 08:02:12      | Trash-Recovered  | \u002FTrash\u002Femployee_list_full.csv            | 4.5 MB  | 9c5d0e1f...\n2024-01-19 08:02:13      | Trash-Recovered  | \u002FTrash\u002Fnetwork_diagram_v3.vsdx          | 2.1 MB  | 0d6e1f2a...\n2024-01-19 08:02:14      | Trash-Recovered  | \u002FTrash\u002Fcredentials_backup.kdbx          | 128 KB  | 1e7f2a3b...\n\n--- Sharing Analysis ---\nFiles Shared Externally:\n  \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm     → j.smith.personal8842@protonmail.com (2024-01-16 03:10 UTC)\n  \u002FMy Drive\u002FHR\u002Femployee_list_full.csv   → j.smith.personal8842@protonmail.com (2024-01-16 03:12 UTC)\n  \u002FMy Drive\u002FIT\u002Fnetwork_diagram_v3.vsdx  → anonymous (link sharing, 2024-01-16 03:15 UTC)\n\n--- Revision History (Suspicious) ---\nFile: \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm\n  Rev 1:  2024-01-10 09:00:00 UTC  (245 KB)  - Original\n  Rev 2:  2024-01-15 14:35:00 UTC  (248 KB)  - Modified (macro added)\n  Rev 3:  2024-01-16 03:05:00 UTC  (245 KB)  - Reverted (macro removed - anti-forensics)\n\nAcquisition Summary:\n  Files acquired:       2,345 (14.7 GB)\n  Trashed items:        89 (234 MB)\n  Revisions:            8,912\n  Chain of custody hash (full archive):\n    SHA-256: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\n  Output directory:     \u002Facquisition\u002Fgdrive\u002F\n  Acquisition log:      \u002Facquisition\u002Fgdrive\u002Facquisition_log.csv\n  Completion Time:      2024-01-19 08:18:47 UTC\n```\n","# Performing Cloud Storage Forensic Acquisition\n\n## Overview\n\nCloud storage forensic acquisition involves collecting digital evidence from services like Google Drive, OneDrive, Dropbox, and Box through both API-based remote acquisition and local endpoint artifact analysis. Modern investigations must address the challenge that cloud-synced files may exist in multiple states: locally synchronized, cloud-only (on-demand), cached, and deleted. Endpoint devices that have synchronized with cloud storage contain a wealth of metadata about locally synced files, files present only in the cloud, and even deleted items recoverable from cache folders. API-based acquisition using service-specific APIs provides direct access to remote data with valid credentials and proper legal authorization.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing cloud storage forensic acquisition\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- Legal authorization (warrant, consent, or corporate policy) for cloud data access\n- Valid user credentials or administrative access tokens\n- Magnet AXIOM Cloud, Cellebrite Cloud Analyzer, or equivalent tool\n- KAPE with cloud storage target files\n- Python 3.8+ with google-api-python-client, msal, dropbox SDK\n- Network connectivity for API-based acquisition\n\n## Acquisition Methods\n\n### Method 1: API-Based Remote Acquisition\n\n#### Google Drive API Acquisition\n\n```python\nfrom google.oauth2.credentials import Credentials\nfrom googleapiclient.discovery import build\nfrom googleapiclient.http import MediaIoBaseDownload\nimport io\nimport os\nimport json\nfrom datetime import datetime\n\n\nclass GoogleDriveForensicAcquisition:\n    \"\"\"Forensically acquire files and metadata from Google Drive via API.\"\"\"\n\n    def __init__(self, credentials_path: str, output_dir: str):\n        self.creds = Credentials.from_authorized_user_file(credentials_path)\n        self.service = build(\"drive\", \"v3\", credentials=self.creds)\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n        self.acquisition_log = []\n\n    def list_all_files(self, include_trashed: bool = True) -> list:\n        \"\"\"List all files including trashed items.\"\"\"\n        files = []\n        page_token = None\n        query = \"\" if include_trashed else \"trashed = false\"\n\n        while True:\n            results = self.service.files().list(\n                q=query,\n                pageSize=1000,\n                fields=\"nextPageToken, files(id, name, mimeType, size, \"\n                       \"createdTime, modifiedTime, trashed, trashedTime, \"\n                       \"owners, sharingUser, permissions, md5Checksum, \"\n                       \"parents, webViewLink, driveId)\",\n                pageToken=page_token\n            ).execute()\n\n            files.extend(results.get(\"files\", []))\n            page_token = results.get(\"nextPageToken\")\n            if not page_token:\n                break\n\n        return files\n\n    def download_file(self, file_id: str, file_name: str, mime_type: str) -> str:\n        \"\"\"Download a file from Google Drive preserving forensic integrity.\"\"\"\n        output_path = os.path.join(self.output_dir, file_name)\n\n        if mime_type.startswith(\"application\u002Fvnd.google-apps\"):\n            export_formats = {\n                \"application\u002Fvnd.google-apps.document\": \"application\u002Fpdf\",\n                \"application\u002Fvnd.google-apps.spreadsheet\": \"application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n                \"application\u002Fvnd.google-apps.presentation\": \"application\u002Fpdf\",\n            }\n            export_mime = export_formats.get(mime_type, \"application\u002Fpdf\")\n            request = self.service.files().export_media(fileId=file_id, mimeType=export_mime)\n        else:\n            request = self.service.files().get_media(fileId=file_id)\n\n        with io.FileIO(output_path, \"wb\") as fh:\n            downloader = MediaIoBaseDownload(fh, request)\n            done = False\n            while not done:\n                _, done = downloader.next_chunk()\n\n        self.acquisition_log.append({\n            \"timestamp\": datetime.utcnow().isoformat(),\n            \"file_id\": file_id,\n            \"file_name\": file_name,\n            \"output_path\": output_path,\n            \"action\": \"downloaded\"\n        })\n        return output_path\n\n    def get_activity_log(self, file_id: str) -> list:\n        \"\"\"Retrieve activity\u002Frevision history for a specific file.\"\"\"\n        revisions = self.service.revisions().list(\n            fileId=file_id,\n            fields=\"revisions(id, modifiedTime, lastModifyingUser, size, md5Checksum)\"\n        ).execute()\n        return revisions.get(\"revisions\", [])\n\n    def export_acquisition_report(self) -> str:\n        \"\"\"Export acquisition log for chain of custody documentation.\"\"\"\n        report_path = os.path.join(self.output_dir, \"acquisition_log.json\")\n        with open(report_path, \"w\") as f:\n            json.dump({\n                \"acquisition_start\": self.acquisition_log[0][\"timestamp\"] if self.acquisition_log else None,\n                \"acquisition_end\": datetime.utcnow().isoformat(),\n                \"total_files\": len(self.acquisition_log),\n                \"entries\": self.acquisition_log\n            }, f, indent=2)\n        return report_path\n```\n\n#### OneDrive \u002F Microsoft 365 API Acquisition\n\n```python\nimport msal\nimport requests\nimport os\nimport json\nfrom datetime import datetime\n\n\nclass OneDriveForensicAcquisition:\n    \"\"\"Forensically acquire files and metadata from OneDrive via Microsoft Graph API.\"\"\"\n\n    def __init__(self, client_id: str, tenant_id: str, client_secret: str, output_dir: str):\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n\n        authority = f\"https:\u002F\u002Flogin.microsoftonline.com\u002F{tenant_id}\"\n        self.app = msal.ConfidentialClientApplication(\n            client_id, authority=authority, client_credential=client_secret\n        )\n        token_result = self.app.acquire_token_for_client(\n            scopes=[\"https:\u002F\u002Fgraph.microsoft.com\u002F.default\"]\n        )\n        self.access_token = token_result.get(\"access_token\")\n        self.headers = {\"Authorization\": f\"Bearer {self.access_token}\"}\n        self.base_url = \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\"\n\n    def list_user_files(self, user_id: str) -> list:\n        \"\"\"List all files in user's OneDrive.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Froot\u002Fchildren\"\n        files = []\n        while url:\n            response = requests.get(url, headers=self.headers)\n            data = response.json()\n            files.extend(data.get(\"value\", []))\n            url = data.get(\"@odata.nextLink\")\n        return files\n\n    def download_file(self, user_id: str, item_id: str, filename: str) -> str:\n        \"\"\"Download a file from OneDrive.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Fitems\u002F{item_id}\u002Fcontent\"\n        response = requests.get(url, headers=self.headers, stream=True)\n        output_path = os.path.join(self.output_dir, filename)\n        with open(output_path, \"wb\") as f:\n            for chunk in response.iter_content(chunk_size=8192):\n                f.write(chunk)\n        return output_path\n\n    def get_deleted_items(self, user_id: str) -> list:\n        \"\"\"Retrieve items from OneDrive recycle bin.\"\"\"\n        url = f\"{self.base_url}\u002Fusers\u002F{user_id}\u002Fdrive\u002Fspecial\u002Frecyclebin\u002Fchildren\"\n        response = requests.get(url, headers=self.headers)\n        return response.json().get(\"value\", [])\n```\n\n### Method 2: Local Endpoint Artifact Collection\n\n#### KAPE Targets for Cloud Storage\n\n```powershell\n# Collect all cloud storage artifacts using KAPE\nkape.exe --tsource C: --tdest C:\\Output\\CloudArtifacts --target GoogleDrive,OneDrive,Dropbox,Box\n\n# OneDrive artifacts\n# %USERPROFILE%\\AppData\\Local\\Microsoft\\OneDrive\\logs\\\n# %USERPROFILE%\\AppData\\Local\\Microsoft\\OneDrive\\settings\\\n# %USERPROFILE%\\OneDrive\\\n\n# Google Drive artifacts\n# %USERPROFILE%\\AppData\\Local\\Google\\DriveFS\\\n# Contains metadata SQLite databases and cached files\n\n# Dropbox artifacts\n# %USERPROFILE%\\AppData\\Local\\Dropbox\\\n# %USERPROFILE%\\Dropbox\\.dropbox.cache\\\n# Contains filecache.dbx (encrypted SQLite), host.dbx, config.dbx\n```\n\n#### OneDrive Local Database Analysis\n\n```python\nimport sqlite3\nimport os\n\ndef analyze_onedrive_sync_engine(db_path: str) -> list:\n    \"\"\"Analyze OneDrive SyncEngineDatabase for file metadata.\"\"\"\n    conn = sqlite3.connect(db_path)\n    cursor = conn.cursor()\n\n    # Query for all tracked files including cloud-only items\n    cursor.execute(\"\"\"\n        SELECT fileName, fileSize, lastChange,\n               resourceID, parentResourceID, eTag\n        FROM od_ClientFile_Records\n        ORDER BY lastChange DESC\n    \"\"\")\n\n    files = []\n    for row in cursor.fetchall():\n        files.append({\n            \"filename\": row[0],\n            \"size\": row[1],\n            \"last_change\": row[2],\n            \"resource_id\": row[3],\n            \"parent_id\": row[4],\n            \"etag\": row[5]\n        })\n\n    conn.close()\n    return files\n```\n\n## Cloud Storage Artifacts Summary\n\n| Service | Local Database | Cache Location | Log Files |\n|---------|---------------|----------------|-----------|\n| OneDrive | SyncEngineDatabase.db | %LOCALAPPDATA%\\Microsoft\\OneDrive\\cache\\ | %LOCALAPPDATA%\\Microsoft\\OneDrive\\logs\\ |\n| Google Drive | metadata_sqlite_db | %LOCALAPPDATA%\\Google\\DriveFS\\{account}\\content_cache\\ | %LOCALAPPDATA%\\Google\\DriveFS\\Logs\\ |\n| Dropbox | filecache.dbx (encrypted) | %APPDATA%\\Dropbox\\.dropbox.cache\\ | %APPDATA%\\Dropbox\\logs\\ |\n| Box | sync_db | %LOCALAPPDATA%\\Box\\Box\\cache\\ | %LOCALAPPDATA%\\Box\\Box\\logs\\ |\n\n## References\n\n- SANS Cloud Storage Acquisition: https:\u002F\u002Fwww.sans.org\u002Fblog\u002Fcloud-storage-acquisition-from-endpoint-devices\n- Magnet AXIOM Cloud: https:\u002F\u002Fwww.magnetforensics.com\u002Fblog\u002Fhow-to-acquire-and-analyze-cloud-data-with-magnet-axiom\u002F\n- AWS Cloud Forensics Framework: https:\u002F\u002Fdocs.aws.amazon.com\u002Fprescriptive-guidance\u002Flatest\u002Fsecurity-reference-architecture\u002Fcyber-forensics.html\n- API-Based Forensic Acquisition of Cloud Drives: https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.06542\n\n## Example Output\n\n```text\n$ python3 cloud_forensic_acquire.py --provider google-drive --auth \u002Ftokens\u002Fgdrive_token.json \\\n    --user jsmith@corporate.com --output \u002Facquisition\u002Fgdrive\n\nCloud Storage Forensic Acquisition Tool v3.2\n==============================================\nProvider:    Google Drive\nAccount:     jsmith@corporate.com\nStart Time:  2024-01-19 08:00:15 UTC\nAuth Method: Admin SDK (domain-wide delegation)\n\n[+] Enumerating files...\n    Total files:        2,345\n    Total folders:      178\n    Shared with me:     456\n    Trashed items:      89 (included in acquisition)\n    Total size:         14.7 GB\n\n[+] Acquiring file contents...\n    Downloaded:    2,345 \u002F 2,345  [████████████████████████████████] 100%\n    Errors:        0\n    Elapsed:       18m 32s\n\n[+] Acquiring metadata...\n    File metadata:      2,345 entries\n    Revision history:   8,912 revisions across 1,234 files\n    Sharing permissions: 3,456 permission entries\n    Activity log:       12,345 events\n\n[+] Acquiring trashed items...\n    Recovered:     89 \u002F 89 items (234 MB)\n\n--- Acquisition Log ---\nTimestamp (UTC)          | Action           | File                                    | Size    | SHA-256\n2024-01-19 08:00:45      | Downloaded       | \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm        | 245 KB  | 7a3b8c9d...\n2024-01-19 08:00:46      | Downloaded       | \u002FMy Drive\u002FFinance\u002FBudget_2024.xlsx       | 1.2 MB  | 8b4c9d0e...\n...\n2024-01-19 08:02:12      | Trash-Recovered  | \u002FTrash\u002Femployee_list_full.csv            | 4.5 MB  | 9c5d0e1f...\n2024-01-19 08:02:13      | Trash-Recovered  | \u002FTrash\u002Fnetwork_diagram_v3.vsdx          | 2.1 MB  | 0d6e1f2a...\n2024-01-19 08:02:14      | Trash-Recovered  | \u002FTrash\u002Fcredentials_backup.kdbx          | 128 KB  | 1e7f2a3b...\n\n--- Sharing Analysis ---\nFiles Shared Externally:\n  \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm     → j.smith.personal8842@protonmail.com (2024-01-16 03:10 UTC)\n  \u002FMy Drive\u002FHR\u002Femployee_list_full.csv   → j.smith.personal8842@protonmail.com (2024-01-16 03:12 UTC)\n  \u002FMy Drive\u002FIT\u002Fnetwork_diagram_v3.vsdx  → anonymous (link sharing, 2024-01-16 03:15 UTC)\n\n--- Revision History (Suspicious) ---\nFile: \u002FMy Drive\u002FFinance\u002FQ4_Report.xlsm\n  Rev 1:  2024-01-10 09:00:00 UTC  (245 KB)  - Original\n  Rev 2:  2024-01-15 14:35:00 UTC  (248 KB)  - Modified (macro added)\n  Rev 3:  2024-01-16 03:05:00 UTC  (245 KB)  - Reverted (macro removed - anti-forensics)\n\nAcquisition Summary:\n  Files acquired:       2,345 (14.7 GB)\n  Trashed items:        89 (234 MB)\n  Revisions:            8,912\n  Chain of custody hash (full archive):\n    SHA-256: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\n  Output directory:     \u002Facquisition\u002Fgdrive\u002F\n  Acquisition log:      \u002Facquisition\u002Fgdrive\u002Facquisition_log.csv\n  Completion Time:      2024-01-19 08:18:47 UTC\n```\n",{"name":5,"tags":24,"author":35,"domain":36,"license":15,"version":37,"nist_csf":38,"subdomain":42,"description":7,"nist_ai_rmf":43,"mitre_attack":47,"atlas_techniques":53},[25,26,27,28,29,30,31,32,33,34],"cloud-forensics","google-drive","onedrive","dropbox","box","cloud-acquisition","api-forensics","sync-client","endpoint-artifacts","magnet-axiom","mahipal","cybersecurity","1.0",[39,40,41],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[44,45,46],"MEASURE-2.7","MAP-5.1","MANAGE-2.4",[48,49,50,51,52],"T1005","T1074","T1119","T1070","T1059",[54,55,56],"AML.T0070","AML.T0066","AML.T0082","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-cloud-storage-forensic-acquisition",{"tool":71,"command":72},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-cloud-storage-forensic-acquisition",{"tool":74,"command":75},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-cloud-storage-forensic-acquisition","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition\u002FSKILL.md",true,[79,85,89],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapi-reference.md","REFERENCE","参考文档",6146,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition\u002Freferences\u002Fapi-reference.md",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fstandards.md",784,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition\u002Freferences\u002Fstandards.md",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fworkflows.md",824,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-cloud-storage-forensic-acquisition\u002Freferences\u002Fworkflows.md",[94,103,108,115,122,129],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":102},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":104,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":102},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":102},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":102},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":102},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":102},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]