Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net;
- using System.Net.Sockets;
- using System.Text;
- class Program
- {
- static void Main(string[] args)
- {
- string host = "game.roblox.com";
- int port = 53640;
- IPEndPoint endPoint = new IPEndPoint(Dns.GetHostAddresses(host)[0], port);
- Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- socket.Connect(endPoint);
- // Send the server request
- string payload = "GET / HTTP/1.1\r\nHost: game.roblox.com\r\n\r\n";
- byte[] request = Encoding.ASCII.GetBytes(payload);
- socket.Send(request);
- // Receive the server response
- byte[] buffer = new byte[4096];
- int count = socket.Receive(buffer);
- // Extract the necessary data from the server response
- string response = Encoding.ASCII.GetString(buffer, 0, count);
- int startIndex = response.IndexOf("token=") + 6;
- int endIndex = response.IndexOf("&", startIndex);
- string token = response.Substring(startIndex, endIndex - startIndex);
- string script = "print('Hello from serverside!')";
- payload = "POST /game/join.ashx?token=" + token + " HTTP/1.1\r\nHost: game.roblox.com\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: " + script.Length + "\r\n\r\n" + script;
- request = Encoding.ASCII.GetBytes(payload);
- socket.Send(request);
- socket.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement