We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a30711d + a9c3c5d commit 92dba8fCopy full SHA for 92dba8f
modules/post/windows/gather/credentials/winscp.rb
@@ -114,6 +114,14 @@ def run
114
end
115
env = get_envs('APPDATA', prog_files_env, 'USERNAME')
116
117
+ if env['APPDATA'].nil?
118
+ fail_with(Failure::Unknown, 'Target does not have environment variable APPDATA')
119
+ elsif env[prog_files_env].nil?
120
+ fail_with(Failure::Unknown, "Target does not have environment variable #{prog_files_env}")
121
+ elsif env['USERNAME'].nil?
122
+ fail_with(Failure::Unknown, 'Target does not have environment variable USERNAME')
123
+ end
124
+
125
user_dir = "#{env['APPDATA']}\\..\\.."
126
user_dir << "\\.." if user_dir.include?('Users')
127
0 commit comments