├── phantom_decryptor ├── go.mod ├── utils.go ├── stats.go ├── print_welcome.go ├── check_hex.go ├── process.go ├── main.go ├── vault.go └── go.sum ├── phantom_extractor ├── go.mod ├── go.sum └── phantom_extractor.go ├── README.md └── LICENSE /phantom_decryptor/go.mod: -------------------------------------------------------------------------------- 1 | module phantom_decryptor 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/btcsuite/btcutil v1.0.2 7 | golang.org/x/crypto v0.32.0 8 | ) 9 | 10 | require golang.org/x/sys v0.29.0 // indirect 11 | -------------------------------------------------------------------------------- /phantom_extractor/go.mod: -------------------------------------------------------------------------------- 1 | module phantom_extractor 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/btcsuite/btcutil v1.0.2 7 | github.com/syndtr/goleveldb v1.0.0 8 | ) 9 | 10 | require github.com/golang/snappy v0.0.4 // indirect 11 | -------------------------------------------------------------------------------- /phantom_decryptor/utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | "os/signal" 8 | "runtime" 9 | "sync/atomic" 10 | "syscall" 11 | ) 12 | 13 | // clear screen function 14 | func clearScreen() { 15 | var cmd *exec.Cmd 16 | switch runtime.GOOS { 17 | case "linux", "darwin": 18 | cmd = exec.Command("clear") 19 | case "windows": 20 | cmd = exec.Command("cmd", "/c", "cls") 21 | default: 22 | return // no action on unsupported platforms 23 | } 24 | cmd.Stdout = os.Stdout 25 | if err := cmd.Run(); err != nil { 26 | fmt.Fprintln(os.Stderr, "Failed to clear screen:", err) 27 | } 28 | } 29 | 30 | func closeStopChannel(stopChan chan struct{}) { 31 | select { 32 | case <-stopChan: 33 | // channel already closed, do nothing 34 | default: 35 | close(stopChan) 36 | } 37 | } 38 | 39 | // goroutine to watch for ctrl+c 40 | func handleGracefulShutdown(stopChan chan struct{}) { 41 | interruptChan := make(chan os.Signal, 1) 42 | signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM) 43 | go func() { 44 | <-interruptChan 45 | fmt.Fprintln(os.Stderr, "\nCtrl+C pressed. Shutting down...") 46 | closeStopChannel(stopChan) 47 | }() 48 | } 49 | 50 | // set CPU threads 51 | func setNumThreads(userThreads int) int { 52 | if userThreads <= 0 || userThreads > runtime.NumCPU() { 53 | return runtime.NumCPU() 54 | } 55 | return userThreads 56 | } 57 | 58 | // check if all vaults are cracked 59 | func isAllVaultsCracked(vaults []Vault) bool { 60 | for i := range vaults { 61 | if atomic.LoadInt32(&vaults[i].Decrypted) == 0 { 62 | return false 63 | } 64 | } 65 | return true 66 | } 67 | -------------------------------------------------------------------------------- /phantom_decryptor/stats.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | "sync" 8 | "sync/atomic" 9 | "time" 10 | ) 11 | 12 | // monitor status 13 | func monitorPrintStats(crackedCount *int32, linesProcessed *int32, stopChan <-chan struct{}, startTime time.Time, validVaultCount int, wg *sync.WaitGroup, interval int) { 14 | 15 | var ticker *time.Ticker 16 | if interval > 0 { 17 | ticker = time.NewTicker(time.Duration(interval) * time.Second) 18 | defer ticker.Stop() 19 | } 20 | 21 | for { 22 | select { 23 | case <-stopChan: 24 | // print final stats and exit 25 | printStats(time.Since(startTime), int(atomic.LoadInt32(crackedCount)), validVaultCount, int(atomic.LoadInt32(linesProcessed)), true) 26 | wg.Done() 27 | return 28 | case <-func() <-chan time.Time { 29 | if ticker != nil { 30 | return ticker.C 31 | } 32 | return nil 33 | }(): 34 | if interval > 0 { 35 | printStats(time.Since(startTime), int(atomic.LoadInt32(crackedCount)), validVaultCount, int(atomic.LoadInt32(linesProcessed)), false) 36 | } 37 | } 38 | } 39 | } 40 | 41 | // printStats 42 | func printStats(elapsedTime time.Duration, crackedCount int, validVaultCount, linesProcessed int, exitProgram bool) { 43 | hours := int(elapsedTime.Hours()) 44 | minutes := int(elapsedTime.Minutes()) % 60 45 | seconds := int(elapsedTime.Seconds()) % 60 46 | linesPerSecond := float64(linesProcessed) / elapsedTime.Seconds() 47 | log.Printf("Decrypted: %d/%d %.2f h/s %02dh:%02dm:%02ds", crackedCount, validVaultCount, linesPerSecond, hours, minutes, seconds) 48 | if exitProgram { 49 | fmt.Println("") 50 | time.Sleep(100 * time.Millisecond) 51 | os.Exit(0) // exit only if indicated by 'exitProgram' flag 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /phantom_decryptor/print_welcome.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | // version func 10 | func versionFunc() { 11 | fmt.Fprintln(os.Stderr, "Picta Lab's Phantom Vault Decryptor v0.1.5-2025-03-16-1415\nhttps://github.com/picta-lab/phantom-decrypt\n") 12 | } 13 | 14 | // help func 15 | func helpFunc() { 16 | versionFunc() 17 | str := `Example Usage: 18 | 19 | -w {wordlist} (omit -w to read from stdin) 20 | -h {phantom_wallet_hash} 21 | -o {output} (omit -o to write to stdout) 22 | -t {cpu threads} 23 | -s {print status every nth sec} 24 | 25 | -version (version info) 26 | -help (usage instructions) 27 | 28 | ./phantom_decryptor.bin -h {phantom_wallet_hash} -w {wordlist} -o {output} -t {cpu threads} -s {print status every nth sec} 29 | 30 | ./phantom_decryptor.bin -h phantom.txt -w wordlist.txt -o cracked.txt -t 16 -s 10 31 | 32 | cat wordlist | ./phantom_decryptor.bin -h phantom.txt 33 | 34 | ./phantom_decryptor.bin -h phantom.txt -w wordlist.txt -o output.txt` 35 | fmt.Fprintln(os.Stderr, str) 36 | } 37 | 38 | // print welcome screen 39 | func printWelcomeScreen(vaultFileFlag, wordlistFileFlag *string, validVaultCount, numThreads int) { 40 | fmt.Fprintln(os.Stderr, " ----------------------------------------------- ") 41 | fmt.Fprintln(os.Stderr, "| Picta Lab's Phantom Vault Decryptor |") 42 | fmt.Fprintln(os.Stderr, "| https://github.com/picta-lab/phantom-decrypt |") 43 | fmt.Fprintln(os.Stderr, " ----------------------------------------------- ") 44 | fmt.Fprintln(os.Stderr) 45 | fmt.Fprintf(os.Stderr, "Vault file:\t%s\n", *vaultFileFlag) 46 | fmt.Fprintf(os.Stderr, "Valid Vaults:\t%d\n", validVaultCount) 47 | fmt.Fprintf(os.Stderr, "CPU Threads:\t%d\n", numThreads) 48 | 49 | // assume "stdin" if wordlistFileFlag is "" 50 | if *wordlistFileFlag == "" { 51 | fmt.Fprintf(os.Stderr, "Wordlist:\tReading stdin\n") 52 | } else { 53 | fmt.Fprintf(os.Stderr, "Wordlist:\t%s\n", *wordlistFileFlag) 54 | } 55 | 56 | //fmt.Fprintln(os.Stderr, "Working...") 57 | log.Println("Working...") 58 | } 59 | -------------------------------------------------------------------------------- /phantom_decryptor/check_hex.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/hex" 6 | ) 7 | 8 | // dehex wordlist line 9 | /* note: 10 | the checkForHexBytes() function below gives a best effort in decoding all HEX strings and applies error correction when needed 11 | if your wordlist contains HEX strings that resemble alphabet soup, don't be surprised if you find "garbage in" still means "garbage out" 12 | the best way to fix HEX decoding issues is to correctly parse your wordlists so you don't end up with foobar HEX strings 13 | if you have suggestions on how to better handle HEX decoding errors, contact me on github 14 | */ 15 | func checkForHexBytes(line []byte) ([]byte, []byte, int) { 16 | hexPrefix := []byte("$HEX[") 17 | suffix := byte(']') 18 | 19 | // Step 1: Check for prefix and adjust for missing ']' 20 | if bytes.HasPrefix(line, hexPrefix) { 21 | var hexErrorDetected int 22 | if line[len(line)-1] != suffix { 23 | line = append(line, suffix) // Correcting the malformed $HEX[] 24 | hexErrorDetected = 1 25 | } 26 | 27 | // Step 2: Find the indices for the content inside the brackets 28 | startIdx := bytes.IndexByte(line, '[') 29 | endIdx := bytes.LastIndexByte(line, ']') 30 | if startIdx == -1 || endIdx == -1 || endIdx <= startIdx { 31 | return line, line, 1 // Early return on malformed bracket positioning 32 | } 33 | hexContent := line[startIdx+1 : endIdx] 34 | 35 | // Step 3 & 4: Decode the hex content and handle errors by cleaning if necessary 36 | decodedBytes := make([]byte, hex.DecodedLen(len(hexContent))) 37 | n, err := hex.Decode(decodedBytes, hexContent) 38 | if err != nil { 39 | // Clean the hex content: remove invalid characters and ensure even length 40 | cleaned := make([]byte, 0, len(hexContent)) 41 | for _, b := range hexContent { 42 | if ('0' <= b && b <= '9') || ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') { 43 | cleaned = append(cleaned, b) 44 | } 45 | } 46 | if len(cleaned)%2 != 0 { 47 | cleaned = append([]byte{'0'}, cleaned...) // Ensuring even number of characters 48 | } 49 | 50 | decodedBytes = make([]byte, hex.DecodedLen(len(cleaned))) 51 | _, err = hex.Decode(decodedBytes, cleaned) 52 | if err != nil { 53 | return line, line, 1 // Return original if still failing 54 | } 55 | hexErrorDetected = 1 56 | } 57 | decodedBytes = decodedBytes[:n] // Trim the slice to the actual decoded length 58 | return decodedBytes, hexContent, hexErrorDetected 59 | } 60 | // Step 5: Return original if not a hex string 61 | return line, line, 0 62 | } 63 | -------------------------------------------------------------------------------- /phantom_decryptor/process.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "os" 8 | "sync" 9 | "sync/atomic" 10 | ) 11 | 12 | // process logic 13 | func startProc(wordlistFileFlag string, outputPath string, numGoroutines int, vaults []Vault, crackedCount *int32, linesProcessed *int32, stopChan chan struct{}) { 14 | var file *os.File 15 | var err error 16 | 17 | if wordlistFileFlag == "" { 18 | file = os.Stdin 19 | } else { 20 | file, err = os.Open(wordlistFileFlag) 21 | if err != nil { 22 | log.Fatalf("Error opening file: %v\n", err) 23 | } 24 | defer file.Close() 25 | } 26 | 27 | var outputFile *os.File 28 | if outputPath != "" { 29 | outputFile, err = os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) 30 | if err != nil { 31 | log.Fatalf("Error opening output file: %v", err) 32 | } 33 | defer outputFile.Close() 34 | } 35 | 36 | var writer *bufio.Writer 37 | if outputPath != "" { 38 | writer = bufio.NewWriter(outputFile) 39 | } else { 40 | writer = bufio.NewWriter(os.Stdout) 41 | } 42 | defer writer.Flush() 43 | 44 | var ( 45 | writerMu sync.Mutex 46 | wg sync.WaitGroup 47 | ) 48 | 49 | // start worker goroutines 50 | linesCh := make(chan []byte, 1000) 51 | for i := 0; i < numGoroutines; i++ { 52 | wg.Add(1) 53 | go func() { 54 | defer wg.Done() 55 | for password := range linesCh { 56 | processPassword(password, vaults, &writerMu, writer, crackedCount, linesProcessed, stopChan) 57 | } 58 | }() 59 | } 60 | 61 | // read lines from file and send them to workers 62 | scanner := bufio.NewScanner(file) 63 | for scanner.Scan() { 64 | line := scanner.Bytes() 65 | password := make([]byte, len(line)) 66 | copy(password, line) 67 | linesCh <- password 68 | } 69 | close(linesCh) 70 | 71 | if err := scanner.Err(); err != nil { 72 | log.Fatalf("Error reading file: %v\n", err) 73 | } 74 | 75 | wg.Wait() 76 | 77 | log.Println("Finished") 78 | } 79 | 80 | func processPassword(password []byte, vaults []Vault, writerMu *sync.Mutex, writer *bufio.Writer, crackedCount *int32, linesProcessed *int32, stopChan chan struct{}) { 81 | atomic.AddInt32(linesProcessed, 1) 82 | // check for hex, ignore hexErrCount 83 | decodedPassword, _, _ := checkForHexBytes(password) 84 | 85 | for i := range vaults { 86 | if atomic.LoadInt32(&vaults[i].Decrypted) == 0 { 87 | decryptedData, err := decryptVault(vaults[i].EncryptedData, decodedPassword, vaults[i].Salt, vaults[i].Nonce, vaults[i].Iterations, vaults[i].Kdf) 88 | if err != nil || !isValid(decryptedData) { 89 | continue 90 | } 91 | 92 | if atomic.CompareAndSwapInt32(&vaults[i].Decrypted, 0, 1) { 93 | output := fmt.Sprintf("%s:%s\n", vaults[i].VaultText, string(decodedPassword)) 94 | if writer != nil { 95 | writerMu.Lock() 96 | atomic.AddInt32(crackedCount, 1) 97 | writer.WriteString(output) 98 | writer.Flush() 99 | writerMu.Unlock() 100 | } 101 | 102 | // exit if all vaults are cracked 103 | if isAllVaultsCracked(vaults) { 104 | closeStopChannel(stopChan) 105 | } 106 | return 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /phantom_decryptor/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | 5 | "flag" 6 | "fmt" 7 | "os" 8 | "runtime" 9 | "sync" 10 | "time" 11 | ) 12 | 13 | /* 14 | Picta Lab Phantom Vault Decryptor 15 | 16 | 17 | https://github.com/picta-lab/phantom-decrypt 18 | 19 | POC tool to decrypt Phantom Vault wallets 20 | This tool is proudly the first Phantom Vault Decryptor / Cracker 21 | coded by picta-lab in Go 22 | 23 | 24 | GNU General Public License v2.0 25 | https://github.com/picta-lab/phantom-decrypt/blob/master/LICENSE 26 | 27 | version history 28 | v0.1.0-2025-01-20-2000; initial release 29 | v0.1.1-2025-01-22-1600; 30 | refactor code 31 | fixed https://github.com/picta-lab/phantom-decrypt/issues/1 32 | v0.1.2-2025-01-31-1700; 33 | acknowledged https://github.com/picta-lab/phantom-decrypt/issues/3 34 | added placeholder for scrypt KDF 35 | v0.1.3-2025-07-02-1100; 36 | added support for scrypt KDF 37 | fixed https://github.com/picta-lab/phantom-decrypt/issues/3 38 | v0.1.4-2025-02-15-1630; 39 | finished implementing flag -o {output file} 40 | v0.1.5-2025-03-01-1415; 41 | fix https://github.com/picta-lab/phantom-decrypt/issues/6 42 | swapped crackedCount and lineProcessed channels for atomic int32 for better performance 43 | multiple performance optimizations in process.go 44 | print vault:password when vault is cracked 45 | */ 46 | 47 | // main func 48 | func main() { 49 | wordlistFileFlag := flag.String("w", "", "Input file to process (omit -w to read from stdin)") 50 | vaultFileFlag := flag.String("h", "", "Vault File") 51 | outputFile := flag.String("o", "", "Output file to write hashes to (omit -o to print to console)") 52 | versionFlag := flag.Bool("version", false, "Program version:") 53 | helpFlag := flag.Bool("help", false, "Prints help:") 54 | threadFlag := flag.Int("t", runtime.NumCPU(), "CPU threads to use (optional)") 55 | statsIntervalFlag := flag.Int("s", 60, "Interval in seconds for printing stats. Defaults to 60.") 56 | flag.Parse() 57 | 58 | clearScreen() 59 | 60 | // run sanity checks for special flags 61 | if *versionFlag { 62 | versionFunc() 63 | os.Exit(0) 64 | } 65 | 66 | if *helpFlag { 67 | helpFunc() 68 | os.Exit(0) 69 | } 70 | 71 | if *vaultFileFlag == "" { 72 | fmt.Fprintln(os.Stderr, "-h (vault file) flags is required") 73 | fmt.Fprintln(os.Stderr, "Try running with -help for usage instructions") 74 | os.Exit(1) 75 | } 76 | 77 | startTime := time.Now() 78 | 79 | // set CPU threads 80 | numThreads := setNumThreads(*threadFlag) 81 | 82 | // variables 83 | var ( 84 | crackedCount int32 85 | linesProcessed int32 86 | wg sync.WaitGroup 87 | ) 88 | 89 | // channels 90 | stopChan := make(chan struct{}) 91 | 92 | // goroutine to watch for ctrl+c 93 | handleGracefulShutdown(stopChan) 94 | 95 | // read vaults 96 | vaults, err := readVaultData(*vaultFileFlag) 97 | if err != nil { 98 | fmt.Fprintln(os.Stderr, "Error reading vault file:", err) 99 | os.Exit(1) 100 | } 101 | validVaultCount := len(vaults) 102 | 103 | // print welcome screen 104 | printWelcomeScreen(vaultFileFlag, wordlistFileFlag, validVaultCount, numThreads) 105 | 106 | // monitor status of workers 107 | wg.Add(1) 108 | go monitorPrintStats(&crackedCount, &linesProcessed, stopChan, startTime, validVaultCount, &wg, *statsIntervalFlag) 109 | 110 | // start the processing logic 111 | startProc(*wordlistFileFlag, *outputFile, numThreads, vaults, &crackedCount, &linesProcessed, stopChan) 112 | 113 | // close stop channel to signal all workers to stop 114 | closeStopChannel(stopChan) 115 | 116 | // wait for monitorPrintStats to finish 117 | wg.Wait() 118 | } 119 | 120 | // end code 121 | -------------------------------------------------------------------------------- /phantom_decryptor/vault.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "crypto/sha256" 6 | "encoding/json" 7 | "fmt" 8 | "log" 9 | "os" 10 | 11 | "github.com/btcsuite/btcutil/base58" 12 | "golang.org/x/crypto/nacl/secretbox" 13 | "golang.org/x/crypto/pbkdf2" 14 | "golang.org/x/crypto/scrypt" 15 | ) 16 | 17 | // settings for Phantom Wallet Vaults 18 | type Vault struct { 19 | EncryptedData []byte 20 | Salt []byte 21 | Nonce []byte 22 | Iterations int 23 | Decrypted int32 24 | Kdf string 25 | VaultText string 26 | } 27 | 28 | // isValid function as placeholder, always returning true 29 | func isValid(s []byte) bool { 30 | return true 31 | } 32 | 33 | // decryptVault using secretbox and supporting both pbkdf2 and scrypt 34 | func decryptVault(encryptedData, password, salt, nonce []byte, iterations int, kdf string) ([]byte, error) { 35 | if len(nonce) != 24 { 36 | return nil, fmt.Errorf("nonce must be exactly 24 bytes long") 37 | } 38 | 39 | var key []byte 40 | var err error 41 | 42 | switch kdf { 43 | case "pbkdf2": 44 | key = pbkdf2.Key(password, salt, iterations, 32, sha256.New) 45 | case "scrypt": 46 | N := 4096 47 | r := 8 48 | p := 1 49 | dkLen := 32 50 | key, err = scrypt.Key(password, salt, N, r, p, dkLen) 51 | if err != nil { 52 | return nil, fmt.Errorf("scrypt key derivation failed: %v", err) 53 | } 54 | default: 55 | return nil, fmt.Errorf("unsupported KDF: %s", kdf) 56 | } 57 | 58 | var nonceArray [24]byte 59 | copy(nonceArray[:], nonce) 60 | var keyArray [32]byte 61 | copy(keyArray[:], key) 62 | 63 | decrypted, ok := secretbox.Open(nil, encryptedData, &nonceArray, &keyArray) 64 | if !ok { 65 | return nil, fmt.Errorf("decryption failed") 66 | } 67 | 68 | return decrypted, nil 69 | } 70 | 71 | // parse Phantom vault 72 | func readVaultData(filePath string) ([]Vault, error) { 73 | file, err := os.Open(filePath) 74 | if err != nil { 75 | return nil, err 76 | } 77 | defer file.Close() 78 | 79 | var vaults []Vault 80 | scanner := bufio.NewScanner(file) 81 | 82 | for scanner.Scan() { 83 | var hash struct { 84 | EncryptedKey struct { 85 | Digest string `json:"digest"` 86 | Encrypted string `json:"encrypted"` 87 | Salt string `json:"salt"` 88 | Nonce string `json:"nonce"` 89 | Iterations int `json:"iterations"` 90 | Kdf string `json:"kdf"` 91 | } `json:"encryptedKey"` 92 | } 93 | 94 | line := scanner.Text() 95 | if err := json.Unmarshal([]byte(line), &hash); err != nil { 96 | log.Printf("Error parsing JSON: %v\n", err) 97 | continue 98 | } 99 | 100 | // sanity checks for Phantom vault 101 | if hash.EncryptedKey.Digest != "sha256" || 102 | (hash.EncryptedKey.Kdf != "pbkdf2" && hash.EncryptedKey.Kdf != "scrypt") || 103 | hash.EncryptedKey.Iterations <= 0 || 104 | len(hash.EncryptedKey.Encrypted) == 0 || 105 | len(hash.EncryptedKey.Salt) == 0 || 106 | len(hash.EncryptedKey.Nonce) == 0 { 107 | log.Printf("Invalid or incomplete data encountered in JSON: %v\n", line) 108 | continue 109 | } 110 | 111 | encryptedData := base58.Decode(hash.EncryptedKey.Encrypted) 112 | salt := base58.Decode(hash.EncryptedKey.Salt) 113 | nonce := base58.Decode(hash.EncryptedKey.Nonce) 114 | 115 | if len(encryptedData) == 0 || len(salt) == 0 || len(nonce) == 0 { 116 | log.Printf("Error decoding base58 data: possibly incorrect format or content: %v\n", line) 117 | continue 118 | } 119 | 120 | vault := Vault{ 121 | EncryptedData: encryptedData, 122 | Salt: salt, 123 | Nonce: nonce, 124 | Iterations: hash.EncryptedKey.Iterations, 125 | Kdf: hash.EncryptedKey.Kdf, 126 | VaultText: line, 127 | } 128 | vaults = append(vaults, vault) 129 | } 130 | 131 | return vaults, nil 132 | } 133 | -------------------------------------------------------------------------------- /phantom_decryptor/go.sum: -------------------------------------------------------------------------------- 1 | github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= 2 | github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= 3 | github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= 4 | github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= 5 | github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= 6 | github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= 7 | github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= 8 | github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= 9 | github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= 10 | github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= 11 | github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= 12 | github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 13 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 14 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 15 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 16 | github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 17 | github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= 18 | github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= 19 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 20 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 21 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 22 | golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 23 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 24 | golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 25 | golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= 26 | golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= 27 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 28 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 29 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 30 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 31 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 32 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 33 | golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= 34 | golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 35 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 36 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 37 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 38 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 39 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 40 | -------------------------------------------------------------------------------- /phantom_extractor/go.sum: -------------------------------------------------------------------------------- 1 | github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= 2 | github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= 3 | github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= 4 | github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= 5 | github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= 6 | github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= 7 | github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= 8 | github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= 9 | github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= 10 | github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= 11 | github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= 12 | github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 13 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 14 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 15 | github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 16 | github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= 17 | github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 18 | github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= 19 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 20 | github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 21 | github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= 22 | github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= 23 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 24 | github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= 25 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 26 | github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= 27 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 28 | github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= 29 | github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= 30 | golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 31 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 32 | golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 33 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 34 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= 35 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 36 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 37 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 38 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 39 | golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= 40 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 41 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 42 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 43 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 44 | gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= 45 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 46 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 47 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 48 | gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= 49 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 🚀 Phantom Vault Extractor & Decryptor 3 | The Phantom Vault Extactor and decryptor is the first tool to recover, extract and decrypt Phantom wallet Vaults 4 | ## ✨ Features 5 | - extract encrypted key 6 | - decrypt encrypted main key 7 | - use main key to decrypt other crypted json 8 | - Contact me at https://t.me/pictalab if you need help recovering your Phantom wallet password or seed phrase. 9 | 10 | 11 | ### Phantom vault location for Chrome extensions: 12 | - Linux: `/home/$USER/.config/google-chrome/Default/Local\ Extension\ Settings/bfnaelmomeimhlpmgjnjophhpkkoljpa/` 13 | - Mac: `Library>Application Support>Google>Chrome>Default>Local Extension Settings>bfnaelmomeimhlpmgjnjophhpkkoljpa` 14 | - Windows: `C:\Users\$USER\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\bfnaelmomeimhlpmgjnjophhpkkoljpa\` 15 | 16 | ## 📋 Usage 17 | ### Extractor usage example on test vault: (plaintext is `password`) 18 | * Old pbkdf2 KDF 19 | ``` 20 | phantom_extractor.exe bfnaelmomeimhlpmgjnjophhpkkoljpa/ 21 | ----------------------------------------------------- 22 | | Picta Lab's Phantom Vault Hash Extractor | 23 | | Use Phantom Vault Decryptor to decrypt | 24 | | https://github.com/picta-lab/phantom-decrypt | 25 | ----------------------------------------------------- 26 | {"encryptedKey":{"digest":"sha256","encrypted":"5pLvA3bCjNGYBbSjjFY3mdPknwFfp3cz9dCBv6izyyrqEhYCBkKwo3zZUzBP44KtY3","iterations":10000,"kdf":"pbkdf2","nonce":"NZT6kw5Cd5VeZu5yJGJcFcP24tnmg4xsR","salt":"A43vTZnm9c5CiQ6FLTdV9v"},"version":1} 27 | ----------------------------------------------------- 28 | | hashcat -m 30010 hash (pbkdf2 kdf) | 29 | ----------------------------------------------------- 30 | $phantom$SU9HoVMjb1ieOEv18nz3FQ==$7H29InVRWVbHS4WcBJdTay0ONb4mLX9Q$g0vJAbflhH4jJJDvuv7Ar5THgzBmJ8tt6oajsQZd/dSXNNjcY5/0eGeF5c1NW1WU 31 | ----------------------------------------------------- 32 | | hashcat -m 26651 hash (pbkdf2 kdf) | 33 | ----------------------------------------------------- 34 | PHANTOM:10000:SU9HoVMjb1ieOEv18nz3FQ==:7H29InVRWVbHS4WcBJdTay0ONb4mLX9Q:g0vJAbflhH4jJJDvuv7Ar5THgzBmJ8tt6oajsQZd/dSXNNjcY5/0eGeF5c1NW1WU 35 | ``` 36 | * New scrypt KDF 37 | ``` 38 | phantom_extractor.exe bfnaelmomeimhlpmgjnjophhpkkoljpa/ 39 | ----------------------------------------------------- 40 | | Picta-lab's Phantom Vault Hash Extractor | 41 | | Use Phantom Vault Decryptor to decrypt | 42 | | https://github.com/picta-lab/phantom-decrypt | 43 | ----------------------------------------------------- 44 | {"encryptedKey":{"digest":"sha256","encrypted":"37fJoKsB9vwnKEzPgc2AHtYVsPTTzrXdTGacbgWxLxbiS7Ri3P3iNnf8csaKwJ4wpk","iterations":10000,"kdf":"scrypt","nonce":"49aomus4HiKLyg7F66pSinR4tpuUuJDHX","salt":"M1PMFn4p4gdCxZDzf8qX71"},"version":1} 45 | ----------------------------------------------------- 46 | | hashcat -m 26650 hash (scrypt kdf) | 47 | ----------------------------------------------------- 48 | PHANTOM:4096:8:1:ogSL4J4xP/wNbAjiA8Q4hA==:Iofs3VYyyaYFzHVkcMsnpkrjGQ2+Kni2:OacHaTJAM8dD7XJIj5bGMU3cM8QW3u92n+ngYjXsgRSR20FDnkMLQHTgPxJDefOx 49 | 50 | ``` 51 | It outputs file HASH.txt in current directory, with the extracted hash 52 | ### Decryptor usage example: 53 | ``` 54 | ----------------------------------------------- 55 | | Picta-lab Phantom Vault Decryptor | 56 | | https://github.com/picta-lab/phantom-decrypt | 57 | ----------------------------------------------- 58 | 59 | Vault file: hash.txt 60 | Valid Vaults: 1 61 | CPU Threads: 16 62 | Wordlist: wordlist.txt 63 | 2024/11/30 14:11:35 Working... 64 | {"encryptedKey":{"digest":"sha256","encrypted":"5pLvA3bCjNGYBbSjjFY3mdPknwFfp3cz9dCBv6izyyrqEhYCBkKwo3zZUzBP44KtY3","iterations":10000,"kdf":"pbkdf2","nonce":"NZT6kw5Cd5VeZu5yJGJcFcP24tnmg4xsR","salt":"A43vTZnm9c5CiQ6FLTdV9v"},"version":1}:password 65 | 2024/11/30 14:11:39 Decrypted: 1/1 6181.36 h/s 00h:00m:03s 66 | 67 | 2024/11/30 14:11:39 Finished 68 | 69 | ``` 70 | ### Decryptor supported options: 71 | ``` 72 | -w {wordlist} (omit -w to read from stdin) 73 | -h {phantom_wallet_hash} 74 | -o {output} (omit -o to write to stdout) 75 | -t {cpu threads} 76 | -s {print status every nth sec} 77 | 78 | -version (version info) 79 | -help (usage instructions) 80 | 81 | phantom_decryptor.exe -h {phantom_wallet_hash} -w {wordlist} -o {output} -t {cpu threads} -s {print status every nth sec} 82 | 83 | phantom_decryptor.exe -h phantom.txt -w wordlist.txt -o cracked.txt -t 16 -s 10 84 | 85 | phantom_decryptor.exe -h phantom.txt -w wordlist.txt -o output.txt 86 | ``` 87 | 88 | ## 🛠 Installation 89 | 90 | ### Compile from source: 91 | - This assumes you have Go and Git installed 92 | - `git clone https://github.com/picta-lab/phantom-decrypt.git` 93 | - phantom_extractor 94 | - `cd phantom-decrypt/phantom_extractor` 95 | - `go mod tidy` 96 | - `go build -ldflags="-s -w" .` 97 | - phantom_decryptor 98 | - `cd phantom-decrypt/phantom_decryptor` 99 | - `go mod tidy` 100 | - `go build -ldflags="-s -w" .` 101 | 102 | ## 🤝 Contributing 103 | We welcome contributions! 💡 Submit a pull request or open an issue to share your ideas. 104 | 105 | ## 🌟 Get Started Today! 106 | 🌐 Start your Phantom journey now! 107 | 🔗 If you need help, contact me on telegram @pictalab to explore more. 108 | -------------------------------------------------------------------------------- /phantom_extractor/phantom_extractor.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/json" 6 | "flag" 7 | "fmt" 8 | "log" 9 | "os" 10 | "os/exec" 11 | "path/filepath" 12 | "runtime" 13 | "strings" 14 | "unicode" 15 | 16 | "github.com/btcsuite/btcutil/base58" 17 | "github.com/syndtr/goleveldb/leveldb" 18 | "github.com/syndtr/goleveldb/leveldb/opt" 19 | "github.com/syndtr/goleveldb/leveldb/storage" 20 | "github.com/syndtr/goleveldb/leveldb/table" 21 | ) 22 | 23 | /* 24 | 25 | GNU General Public License v2.0 26 | https://github.com/picta-lab/phantom_decrypt/blob/main/LICENSE 27 | 28 | version history 29 | v0.1.0-2025-01-16; 30 | initial release 31 | v0.2.0-2025-02-22-1500; 32 | add support for older vaults 33 | v0.3.1-2025-02-23-1145; 34 | added raw db support for reading corrupt or non-standard leveldb files 35 | v0.3.2-2025-03-01-1415; 36 | updated help info for Chrome extensions on Linux, Mac and Windows 37 | v0.3.3-2025-03-07; 38 | added support for hashcat modes 30010, 26650, 26651 39 | */ 40 | 41 | // clear screen function 42 | func clearScreen() { 43 | switch runtime.GOOS { 44 | case "linux", "darwin": 45 | cmd := exec.Command("clear") 46 | cmd.Stdout = os.Stdout 47 | cmd.Run() 48 | case "windows": 49 | cmd := exec.Command("cmd", "/c", "cls") 50 | cmd.Stdout = os.Stdout 51 | cmd.Run() 52 | } 53 | } 54 | 55 | // version func 56 | func versionFunc() { 57 | fmt.Fprintln(os.Stderr, "Picta Lab's Phantom Vault Extractor v0.3.3-2025-03-04\nhttps://github.com/picta-lab/phantom-decrypt\n") 58 | } 59 | 60 | // help func 61 | func helpFunc() { 62 | versionFunc() 63 | str := `Example Usage: 64 | ./phantom_extractor.bin [-version] [-help] [phantom_vault_dir] 65 | ./phantom_extractor.bin bfnaelmomeimhlpmgjnjophhpkkoljpa/ 66 | 67 | Default Phantom vault locations for Chrome extensions: 68 | 69 | Linux: 70 | /home/$USER/.config/google-chrome/Default/Local\ Extension\ Settings/bfnaelmomeimhlpmgjnjophhpkkoljpa/ 71 | 72 | Mac: 73 | Library>Application Support>Google>Chrome>Default>Local Extension Settings>bfnaelmomeimhlpmgjnjophhpkkoljpa 74 | 75 | Windows: 76 | C:\Users\$USER\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\bfnaelmomeimhlpmgjnjophhpkkoljpa\` 77 | fmt.Fprintln(os.Stderr, str) 78 | } 79 | 80 | // print welcome screen 81 | func printWelcomeScreen() { 82 | fmt.Println(" ----------------------------------------------------- ") 83 | fmt.Println("| Picta Lab's Phantom Vault Extractor |") 84 | fmt.Println("| Use Phantom Vault Decryptor to decrypt |") 85 | fmt.Println("| https://github.com/picta-lab/phantom-decrypt |") 86 | fmt.Println(" ----------------------------------------------------- ") 87 | } 88 | 89 | // struct for Phantom vaults 90 | type EncryptedKey struct { 91 | Digest string `json:"digest"` 92 | Encrypted string `json:"encrypted"` 93 | Iterations int `json:"iterations"` 94 | Kdf string `json:"kdf"` 95 | Nonce string `json:"nonce"` 96 | Salt string `json:"salt"` 97 | } 98 | 99 | // vault format "version_0" 100 | type Vault_0 struct { 101 | Expiry float64 `json:"expiry"` 102 | Value string `json:"value"` 103 | } 104 | 105 | // vault format "version_1" 106 | type Vault_1 struct { 107 | EncryptedKey EncryptedKey `json:"encryptedKey"` 108 | Version int `json:"version"` 109 | } 110 | 111 | // processLevelDB with version handling 112 | func processLevelDB(i int,data []byte) { 113 | // detect vault version 114 | //s2 := strconv.Itoa(i) 115 | //str := string(data) 116 | //fmt.Println(str) 117 | 118 | 119 | //fmt.Fprintf("%s",data) 120 | version := detectVersion(data) 121 | //fmt.Println("in processleveldb") 122 | switch version { 123 | case 1: // vault version_1 124 | fmt.Println("version 1") 125 | var vault_1 Vault_1 126 | if err := json.Unmarshal(data, &vault_1); err == nil { 127 | printJSONVaultandSave(vault_1) 128 | printHashcatHash(vault_1) 129 | } 130 | case 0: // vault version_0 131 | fmt.Println("version 0") 132 | var vault_0 Vault_0 133 | if err := json.Unmarshal(data, &vault_0); err == nil { 134 | cleanStr := strings.ReplaceAll(vault_0.Value, `\`, "") // remove "\" so json can be unmarshaled 135 | var encryptedKey EncryptedKey 136 | if err := json.Unmarshal([]byte(cleanStr), &encryptedKey); err == nil { 137 | vault_0 := Vault_1{ 138 | EncryptedKey: encryptedKey, 139 | Version: 0, // mark as version_0 to keep backwards compatibility with phantom_decryptor 140 | } 141 | printJSONVaultandSave(vault_0) 142 | printHashcatHash(vault_0) 143 | } 144 | } 145 | default: 146 | // do nothing 147 | //fmt.Println("default") 148 | } 149 | } 150 | 151 | 152 | // print valid JSON vaults 153 | func printJSONVaultandSave(entry Vault_1) { 154 | // sanity check if vault is valid (not empty) 155 | if entry.EncryptedKey.Digest != "" && entry.EncryptedKey.Encrypted != "" && entry.EncryptedKey.Iterations != 0 && 156 | entry.EncryptedKey.Kdf != "" && entry.EncryptedKey.Nonce != "" && entry.EncryptedKey.Salt != "" { 157 | entryJSON, err := json.Marshal(entry) 158 | if err != nil { 159 | fmt.Println("Error marshalling entry to JSON:", err) 160 | return 161 | } 162 | fmt.Println(string(entryJSON)) 163 | f, err := os.Create("HASH.txt") 164 | if err != nil { 165 | log.Fatal(err) 166 | } 167 | 168 | n, err := f.WriteString(string(entryJSON) + "\n") 169 | if err != nil { 170 | log.Fatal(err) 171 | } 172 | fmt.Printf("enrpyted json written to HASH.txt\n", n) 173 | f.Sync() 174 | } 175 | } 176 | 177 | // vault version detection 178 | func detectVersion(data []byte) int { 179 | if strings.Contains(string(data), "\"encryptedKey\":") { 180 | return 1 181 | } else if strings.Contains(string(data), "\"expiry\":") { 182 | return 0 183 | } 184 | return -1 // unknown version 185 | } 186 | 187 | 188 | 189 | func dumpRawLDBFiles(dirPath string) error { 190 | return filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error { 191 | if err != nil { 192 | log.Printf("Failed to access path %s: %v", path, err) 193 | return nil 194 | } 195 | fmt.Fprintf(os.Stderr, "in walk %s", info.Name()) 196 | if !info.IsDir() && strings.HasSuffix(info.Name(), ".ldb") { 197 | fmt.Fprintln(os.Stderr, "found walk") 198 | err = dumpRawLDBFile(path) 199 | if err != nil { 200 | log.Printf("Failed to dump file %s: %v", path, err) 201 | } 202 | } 203 | return nil 204 | }) 205 | } 206 | 207 | func dumpRawLDBFile(filePath string) error { 208 | //fmt.Fprintln(os.Stderr, "indumpraw") 209 | file, err := os.Open(filePath) 210 | if err != nil { 211 | return fmt.Errorf("failed to open file: %w", err) 212 | } 213 | defer file.Close() 214 | 215 | fileInfo, err := file.Stat() 216 | if err != nil { 217 | return fmt.Errorf("failed to get file info: %w", err) 218 | } 219 | 220 | reader, err := table.NewReader(file, fileInfo.Size(), storage.FileDesc{Type: storage.TypeTable, Num: 0}, nil, nil, &opt.Options{}) 221 | if err != nil { 222 | return fmt.Errorf("failed to create table reader: %w", err) 223 | } 224 | defer reader.Release() 225 | 226 | iter := reader.NewIterator(nil, nil) 227 | defer iter.Release() 228 | i :=1 229 | for iter.Next() { 230 | value := iter.Value() 231 | processLevelDB(i,filterPrintableBytes(value)) 232 | i +=1 233 | } 234 | if err := iter.Error(); err != nil { 235 | return fmt.Errorf("iterator error: %w", err) 236 | } 237 | 238 | return nil 239 | } 240 | 241 | func filterPrintableBytes(data []byte) []byte { 242 | printable := make([]rune, 0, len(data)) 243 | for _, b := range data { 244 | if unicode.IsPrint(rune(b)) { 245 | printable = append(printable, rune(b)) 246 | } else { 247 | printable = append(printable, '.') 248 | } 249 | } 250 | return []byte(string(printable)) 251 | } 252 | 253 | // print hashcat modes 30010, 26650, 26651 254 | func printHashcatHash(vault Vault_1) { 255 | 256 | saltDecoded := base58.Decode(vault.EncryptedKey.Salt) 257 | nonceDecoded := base58.Decode(vault.EncryptedKey.Nonce) 258 | encryptedDecoded := base58.Decode(vault.EncryptedKey.Encrypted) 259 | 260 | saltB64 := base64.StdEncoding.EncodeToString(saltDecoded) 261 | nonceB64 := base64.StdEncoding.EncodeToString(nonceDecoded) 262 | encryptedB64 := base64.StdEncoding.EncodeToString(encryptedDecoded) 263 | 264 | // scrypt KDF 265 | if strings.ToLower(vault.EncryptedKey.Kdf) == "scrypt" { 266 | fmt.Println(" ----------------------------------------------------- ") 267 | fmt.Println("| hashcat -m 26650 hash (scrypt kdf) |") 268 | fmt.Println(" ----------------------------------------------------- ") 269 | // PHANTOM:4096:8:1::: 270 | fmt.Printf("PHANTOM:4096:8:1:%s:%s:%s\n", saltB64, nonceB64, encryptedB64) 271 | return 272 | } 273 | 274 | // pbkdf2 KDF 275 | if strings.ToLower(vault.EncryptedKey.Kdf) == "pbkdf2" { 276 | fmt.Println(" ----------------------------------------------------- ") 277 | fmt.Println("| hashcat -m 30010 hash (pbkdf2 kdf) |") 278 | fmt.Println(" ----------------------------------------------------- ") 279 | // $phantom$$$ 280 | fmt.Printf("$phantom$%s$%s$%s\n", saltB64, nonceB64, encryptedB64) 281 | 282 | fmt.Println(" ----------------------------------------------------- ") 283 | fmt.Println("| hashcat -m 26651 hash (pbkdf2 kdf) |") 284 | fmt.Println(" ----------------------------------------------------- ") 285 | // PHANTOM:10000::: 286 | fmt.Printf("PHANTOM:10000:%s:%s:%s\n", saltB64, nonceB64, encryptedB64) 287 | } 288 | } 289 | 290 | // main 291 | func main() { 292 | versionFlag := flag.Bool("version", false, "Program version") 293 | helpFlag := flag.Bool("help", false, "Program usage instructions") 294 | flag.Parse() 295 | 296 | clearScreen() 297 | 298 | // run sanity checks for special flags 299 | if *versionFlag { 300 | versionFunc() 301 | os.Exit(0) 302 | } 303 | 304 | if *helpFlag { 305 | helpFunc() 306 | os.Exit(0) 307 | } 308 | 309 | ldbDir := flag.Arg(0) 310 | if ldbDir == "" { 311 | fmt.Fprintln(os.Stderr, "Error: Phantom vault directory is required") 312 | helpFunc() 313 | os.Exit(1) 314 | } 315 | 316 | printWelcomeScreen() 317 | 318 | db, err := leveldb.OpenFile(ldbDir, nil) 319 | 320 | //if err != nil { 321 | // fmt.Fprintln(os.Stderr, "Error opening Vault:", err) 322 | fmt.Println("Attempting to dump raw .ldb files...") 323 | err = dumpRawLDBFiles(ldbDir) 324 | if err != nil { 325 | fmt.Fprintf(os.Stderr, "Failed to dump raw .ldb files: %v\n", err) 326 | os.Exit(1) 327 | } 328 | os.Exit(0) 329 | //} 330 | defer db.Close() 331 | 332 | 333 | iter := db.NewIterator(nil, nil) 334 | defer iter.Release() 335 | 336 | for iter.Next() { 337 | value := iter.Value() 338 | processLevelDB(0,value) 339 | } 340 | } 341 | 342 | // end code 343 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------