Telegra Csharp C2 : Command and Control for C# Writing

Telegra Csharp C2 is a tool for command and control for C# Writing. TelegramBotClient allows you to use a proxy for Bot API connections.

VirusTotal check result

Don’t pass it on to Virus Total anymore. I’ve tried it for you.

Install

Nuget download these package

using System.IO;
using Telegram.Bot;
using Telegram.Bot.Args;
using Telegram.Bot.Types.InputFiles;
using AForge.Video;
using AForge.Controls;
using AForge.Video.DirectShow;

Also Read – Nuages : A Modular C2 Framework 2019

Add related classes in ‘References’

System.Drawing;
System.Windows.Forms;

How to used

Modify your Token to the program

static void Main(){
botClient = new TelegramBotClient(“token”); //Your Token
botClient.OnMessage += Bot_OnMessage;
botClient.StartReceiving();
Thread.Sleep(int.MaxValue);
}

Proxy

TelegramBotClient allows you to use a proxy for Bot API connections.

HTTP

You can pass an IWebProxy to bot client for HTTP Proxies.

// using System.Net;
var httpProxy = new WebProxy(“https://example.org”, 8080)
{
Credentials = new NetworkCredential(“USERNMAE”, “PASSWORD”)
};
var botClient = new TelegramBotClient(“YOUR_API_TOKEN”, httpProxy);

SOCKS 5

You can use an external NuGet package: HttpToSocks5Proxy provided

// using MihaZupan;
var proxy = new HttpToSocks5Proxy(Socks5ServerAddress, Socks5ServerPort);
// Or if you need credentials for your proxy server:
var proxy = new HttpToSocks5Proxy(
Socks5ServerAddress, Socks5ServerPort, “USERNAME”, “PASSWORD”
);
// Allows you to use proxies that are only allowing connections to Telegram
// Needed for some proxies

proxy.ResolveHostnamesLocally = true;
var botClient = new TelegramBotClient(“YOUR_API_TOKEN”, proxy);

How to compile

How to compile all DLL files into an EXE file

First,You need download ILMerge tool,this is a tool for merging all references to .NET programs.

ilmerge.exe /target:exe /out:TGbot.exe ConsoleApp1.exe AForge.Controls.dll AForge.dll AForge.Imaging.dll AForge.Math.dll AForge.Video.DirectShow.dll AForge.Video.dll Newtonsoft.Json.dll Telegram.Bot.dll /targetplatform:v4

/target -> library=>DLL exe=>exe
/targetplatform:v4 -> Compiler platform is .net 4.0
/out -> Merged output file,Parameters are followed by files that need to be merged

Finally, generate output in the directory specified by the out parameter

Credit: Leiothrix

R K

Recent Posts

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

20 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

20 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

3 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

4 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago