0

I will let my code. Its about a client that connect to a Sb0t-Server:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Runtime.InteropServices;
namespace Antiban
{
    public partial class Form1 : Form
    {
        public Socket Socket;
        public System.Net.Sockets.NetworkStream Stream;
        public byte[] AvatarStream;

        public Form1()
        {
            InitializeComponent();
        }

        public void ConectarBot(IPAddress ip, int puerto)
        {
            Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            label1.Text = "Conectando... por favor espera...";

            try
            {
                Socket.Connect(new IPEndPoint(ip, Convert.ToInt32(puerto)));
            }

            catch(Exception ex)
            {

            }
            if (Socket.Connected == true)
            {
                label1.Text = "Conectado. Iniciando protocolo";

                Socket.Send(MSG_CHAT_CLIENT_LOGIN());

                label1.Text = "Conectado!";
            }
        }

        public byte[] MSG_CHAT_CLIENT_LOGIN()
        {
            List<byte> buffer = new List<byte>();
            buffer.AddRange(new byte[] { 2 });
            buffer.AddRange(Guid.NewGuid().ToByteArray());
            buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(666)));
            buffer.AddRange(new byte[] { 0 });
            buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(5555)));
            buffer.AddRange(new byte[]
            {
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            });
            buffer.AddRange(Encoding.UTF8.GetBytes(textBox1.Text));
            buffer.AddRange(new byte[] { 0 });
            buffer.AddRange(Encoding.UTF8.GetBytes("Antiban by Narciso"));
            buffer.AddRange(new byte[]
            {
                0,
                127,
                0,
                0,
                1,
                6,
                6,
                6,
                6,
                0,
                0,
                0,
                0,
                20,
                1,
                69
            });
            buffer.AddRange(Encoding.UTF8.GetBytes("Ares"));
            buffer.AddRange(new byte[] { 0 });
            buffer.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(buffer.Count - 1)));
            return buffer.ToArray();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string i = textBox2.Text;
            string p = textBox3.Text;

            ConectarBot(System.Net.IPAddress.Parse(i), int.Parse(p));
        }

        private void button2_Click(object sender, EventArgs e)
        {
            List<byte> buffer = new List<byte>();
            buffer.AddRange(new byte[] { 10 });
            buffer.AddRange(Encoding.UTF8.GetBytes(textBox4.Text));
            buffer.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(buffer.Count - 1)));
            Socket.Send(buffer.ToArray());

            textBox4.Clear();
        }
    }
}

What must I add to connect to a Sb0t-Server through proxy? Some Idea?

I think it must first connect to a proxy and then to a server. But I don't know how can I do it.

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

0

Try also looking at the following post if your unsure of steps.

Here

  1. Connect to proxy.
  2. Issue CONNECT Host:Port HTTP/1.1<CR><LF>
  3. Issue <CR><LF>
  4. Wait for a line of response. If it contains HTTP/1.X 200, the connection is successful.
  5. Read further lines of response until you receive an empty line.
  6. Now, you are connected to the outside world through a proxy. Do any data exchange you want.
Community
  • 1
  • 1
Joshua Duxbury
  • 4,892
  • 4
  • 32
  • 51