Categories > Coding > C# >
Autoupdating to last version
Posted
Hello there
I use WeAreDevs_Api in my exploit How can I do auto-update api for my exploit? (C#)
Replied
If You Are using Wearedevs api then it auto updates.
Cancel
Post
Replied
To update your executable (Your UI program folder, etc.), then you can use my bootstrapper to update (Straight from my exploit):
byte[] GetFileHash(string fileName)
{
HashAlgorithm sha1 = HashAlgorithm.Create();
using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
return sha1.ComputeHash(stream);
}
Console.WriteLine(@"
_____ _ _ _
/ ___| | | | \ | |
\ `--. _ _ _ __ | |__ ___ | \| |
`--. \ | | | '_ \| '_ \ / _ \| . ` |
/\__/ / |_| | |_) | | | | (_) | |\ |
\____/ \__, | .__/|_| |_|\___/\_| \_/
__/ | |
|___/|_|
");
if(File.Exists(@".\Exploit\ExploitZIP.zip"))
{
if(File.Exists(@".\ExploitZIP.zip"))
{
File.Delete(@".\ExploitZIP.zip");
}
File.Copy(@".\Exploit\ExploitZIP.zip", @".\ExploitZIP.zip");
DirectoryInfo di = new DirectoryInfo(@".\Exploit");
foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
foreach (DirectoryInfo dir in di.GetDirectories())
{
dir.Delete(true);
}
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Checking for updates...");
WebClient wc = new WebClient();
String download = "DLINK"; // DOWNLOADLINK
String path = @"Exploit\ExploitZIP.zip";
Directory.CreateDirectory(@"Exploit");
wc.DownloadFile(download, path);
Cancel
Post
Added
var hash1 = GetFileHash(@".\Exploit\ExploitZIP.zip");
var hash2 = GetFileHash(@".\ExploitZIP.zip");
if (hash1 == hash2)
{
Console.WriteLine("SyphoN is Up-To-Date!");
Environment.Exit(0);
}
else
{
Console.WriteLine("Extracting SyphoN...");
ZipFile.ExtractToDirectory(@".\Exploit\ExploitZIP.zip", @".\Exploit");
Console.WriteLine("SyphoN is Up-To-Date!");
Environment.Exit(0);
}
}
else
{
DirectoryInfo di = new DirectoryInfo(@".\Exploit");
foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
foreach (DirectoryInfo dir in di.GetDirectories())
{
dir.Delete(true);
}
WebClient wc = new WebClient();
String download = "DLINK"; // DOWNLOADLINK
String path = @"Exploit\ExploitZIP.zip";
Directory.CreateDirectory(@"Exploit");
wc.DownloadFile(download, path);
Console.WriteLine("Extracting SyphoN...");
ZipFile.ExtractToDirectory(@".\Exploit\ExploitZIP.zip", @".\Exploit");
Console.WriteLine("SyphoN is Up-To-Date!");
Environment.Exit(0);
}
My bootstrapper needs optimization lol. You will have to modify my bootstrapper so it wont reach errors. What you do is that you would make a zip file (Deflate Algorithm. NOT DEFLATE64!) of the contents (Executable, DLLs, etc. NOT THE FOLDER.) and you will make a DIRECT download link. (I use Dropbox, Google Drive will stop you saying OMG THERES A VIRUS U SURE U WANT DOWNLOAD?)
If you want to update your exploit dynamic link library, WeAreDevs auto-updates, so do most other APIs.
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post