如何从 Remmina 中提取保存的密码?

lin*_*ewb 40 password remmina

我不记得我的一台服务器的密码。我保存了一个工作连接并想从中获取密码。

来自 Remmina 常见问题解答:

问:我的密码是如何存储的?他们安全吗?
答:它们是使用 3DES 和 256 位随机生成的密钥加密的。您应该确保您的密钥安全。

那么我从哪里获得密钥以及密码将存储在哪里?

编辑:好的,发现它们只是在 .remmina 下的用户主文件夹中。两个私钥都在base64中,解密时我似乎无法正确获取密码......

小智 57

我能够使用@michaelcochez 的 Go 解决方案用 Python 解密它:

import base64
from Crypto.Cipher import DES3

secret = base64.decodestring('<STRING FROM remmina.prefs>')
password = base64.decodestring('<STRING FROM XXXXXXX.remmina>')

print DES3.new(secret[:24], DES3.MODE_CBC, secret[24:]).decrypt(password)
Run Code Online (Sandbox Code Playgroud)

  • 出于让我讨厌自己的原因,我需要一个单行:/:`python -c "import base64,sys;from Crypto.Cipher import DES3;pc=open('/home/admalledd/.remmina/remmina.pref' ).read();pci=pc.index('secret=');secret=pc[pci:pc.index('\n',pci)].split('=',1)[1];cc =open(sys.argv[1]).read();cci=cc.index('password');password=cc[cci:cc.index('\n',cci)].split('=' ,1)[1];secret,password=base64.decodestring(secret),base64.decodestring(password); 打印 DES3.new(secret[:24], DES3.MODE_CBC,secret[24:]).decrypt(password) )”.remmina/1474332312568.remmina`。下次我可能需要它时离开这里。 (5认同)
  • 最新版本的 remmina 更改了这些文件的位置。pref 文件现在位于:$HOME/.config/remmina/,当您单击连接时,连接文件会列在 remmina 的底部(例如:~/.local/share/remmina/4823893432523.remmina) (5认同)
  • 谢谢你过去的自我,稍微更新的单行文件需要两个参数。`python -c "import base64,sys;from Crypto.Cipher import DES3;pc=open(sys.argv[1]).read();pci=pc.index('secret=');secret=pc[pci :pc.index('\n',pci)].split('=',1)[1];cc=open(sys.argv[2]).read();cci=cc.index('密码');password=cc[cci:cc.index('\n',cci)].split('=',1)[1];secret,password=base64.decodestring(secret),base64.decodestring(password ); 打印 DES3.new(secret[:24], DES3.MODE_CBC, secret[24:]).decrypt(password)" /tmp/remmina/remmina.pref /tmp/remmina/00000000000.remmina` (3认同)

Rin*_*ind 27

它们存储在 Gnome-Keyring 中。

破折号-> 键入“密钥”-> 密码和密钥。

在较新版本的海马(又名“密码和密钥”)中,必须选择“查看”->“显示任何”以查看密钥。搜索“remmina”。

  • 在某些情况下确实如此。如果`~/.remmina/nnnnnnnnnnn.remmina` 中列出的密码只是`.`,请尝试此操作。 (3认同)
  • 仅供参考,可以通过从终端运行“seahorse”来启动访问密钥环的 GUI。 (2认同)

小智 20

我在一个名为的文件中找到了密钥,~/.remmina/remmina.prefs加密的密码在~/.remmina/nnnnnnnnnnn.remmina.

我写了一个可用于解密的代码(在 Go 中):

//Decrypts obfuscated passwords by Remmina - The GTK+ Remote Desktop Client
//written by Michael Cochez
package main

import (
    "crypto/cipher"
    "crypto/des"
    "encoding/base64"
    "fmt"
    "log"
)

//set the variables here

var base64secret = "yoursecret"
var base64password = "theconnectionpassword"

//The secret is used for encrypting the passwords. This can typically be found from ~/.remmina/remmina.pref on the line containing 'secret='.
//"The encrypted password used for the connection. This can typically be found from /.remmina/dddddddddddd.remmina " on the line containing 'password='.
//Copy everything after the '=' sign. Also include final '=' signs if they happen to be there.

//returns a function which can be used for decrypting passwords
func makeRemminaDecrypter(base64secret string) func(string) string {
    //decode the secret
    secret, err := base64.StdEncoding.DecodeString(base64secret)
    if err != nil {
        log.Fatal("Base 64 decoding failed:", err)
    }
    if len(secret) != 32 {
        log.Fatal("the secret is not 32 bytes long")
    }
    //the key is the 24 first bits of the secret
    key := secret[:24]
    //3DES cipher
    block, err := des.NewTripleDESCipher(key)
    if err != nil {
        log.Fatal("Failed creating the 3Des cipher block", err)
    }
    //the rest of the secret is the iv
    iv := secret[24:]
    decrypter := cipher.NewCBCDecrypter(block, iv)

    return func(encodedEncryptedPassword string) string {
        encryptedPassword, err := base64.StdEncoding.DecodeString(encodedEncryptedPassword)
        if err != nil {
            log.Fatal("Base 64 decoding failed:", err)
        }
        //in place decryption
        decrypter.CryptBlocks(encryptedPassword, encryptedPassword)
        return string(encryptedPassword)
    }
}

func main() {

    if base64secret == "yoursecret" || base64password == "theconnectionpassword" {

        log.Fatal("both base64secret and base64password variables must be set")
    }

    decrypter := makeRemminaDecrypter(base64secret)

    fmt.Printf("Passwd : %v\n", decrypter(base64password))

}
Run Code Online (Sandbox Code Playgroud)

该代码可以在线运行,但是您信任 golang.org。


小智 17

Remmina (1.3.3) 存储密码感谢libsecret,该libsecret-tools包可以帮助您检索存储的密码。

我正在寻找已保存用户密码的 Windows RDP 连接的密码;我终于用命令找到了密码

secret-tool search key password
Run Code Online (Sandbox Code Playgroud)

  • 这个答案应该被接受。非常非常感谢你! (7认同)
  • 是的,大多数答案已经完全过时了,并且花了一些时间才找到这个答案。 (2认同)

小智 12

我制作了一个脚本来自动解密你的密码文件。最新版本位于https://github.com/peppelinux/remmina_password_exposer

#!/usr/bin/python
from Crypto.Cipher import DES3
import base64
import os
import re

from os.path import expanduser
home = expanduser("~")

# costanti :)
REMMINA_FOLDER = os.getenv('REMMINA_FOLDER', home+'/'+'.remmina/')
REMMINA_PREF   = 'remmina.pref'

REGEXP_ACCOUNTS = r'[0-9]{13}\.remmina(.swp)?'
REGEXP_PREF     = r'remmina.pref'

diz = {}

fs = open(REMMINA_FOLDER+REMMINA_PREF)
fso = fs.readlines()
fs.close()

for i in fso:
    if re.findall(r'secret=', i):
        r_secret = i[len(r'secret='):][:-1]
        print 'found secret', r_secret

for f in os.listdir(REMMINA_FOLDER):
    if re.findall(REGEXP_ACCOUNTS, f): 

        o = open( REMMINA_FOLDER+f, 'r')
        fo = o.readlines()
        o.close()

        for i in fo:
            if re.findall(r'password=', i):
                r_password = i[len(r'password='):][:-1]
            if re.findall(r'^name=', i):
                r_name = i.split('=')[1][:-1]
            if re.findall(r'username=', i):
                r_username = i.split('=')[1][:-1]
        #~ print fo
        #~ print 'found', f

        password = base64.decodestring(r_password)
        secret = base64.decodestring(r_secret)

        diz[r_name] = DES3.new(secret[:24], DES3.MODE_CBC, secret[24:]).decrypt(password)
        # print the username and password of the last decryption
        print r_name, r_username, diz[r_name]
Run Code Online (Sandbox Code Playgroud)