Commit Diff
Diff:
ee50ffddda4b1e709e9f7316511c32c1a0bc5ff5
6fccd4dc47c424f8b9952d41579268e0bf858b33
Commit:
6fccd4dc47c424f8b9952d41579268e0bf858b33
Tree:
72b3648c37be961a00c2dc03183607541f939171
Author:
jrmu <jrmu@lecturify.com>
Committer:
jrmu <jrmu@lecturify.com>
Date:
Thu Sep 10 14:55:29 2020 UTC
Message:
Remove hard coded values and refactored parsing of IRC replies
blob - 2594a651ade7d39b9410defe1d5b4322326f9b2e
blob + c64fdd4af7842525b05506612d76210d49cd2034
--- botnow.pl
+++ botnow.pl
@@ -12,31 +12,30 @@ my $port = "1337";
# Bouncer hostname
my $hostname = "example.ircnow.org";
-# Users will bind to this external IPv4 address
+# External IPv4 address, plaintext and ssl port
my $ip4 = "192.168.1.1";
+my $plainport = "1337";
+my $sslport = "31337";
-# Nick of bot
-my $botnick = "botnick";
-my $pass = "YourPassword";
+# Nick and password of bot -- Make sure to add to oper block
+my $nick = "botnick";
+my $pass = "BotPassword";
-# Nick of oper
-my $opernick = "botnick";
-my $operpass = "YourPassword";
-
# Comma-separated list of channels for requesting bouncers
my $chans = "#ircnow,#testing";
# Number of words in password
my $passlength = 3;
-# Comma-separated list of staff nicks; comment out for no highlights
+# Comma-separated list of staff nicks; comment out to avoid highlights
my $staff = "jrmu,test";
-# Comma-separated list of team channels on localnet
+# Comma-separated list of team channels on localnet; comment out to disable
my $teamchans = "#ircnow-team";
# Mail from address
my $mailfrom = 'support@ircnow.org';
+my $mailname = 'support';
# DNS zone directory
my $zonedir = "/var/nsd/zones/master/";
@@ -47,6 +46,9 @@ my ($key, $hash) = ("ABCDE-FGHIJ-KLMNO", "ABCDEFGHIJKL
# Network Interface Config File
my $hostnameif = "/etc/hostname.vio0";
+# Verbosity: 0 (no errors), 1 (errors), 2 (warnings), 3 (diagnostic)
+my $verbose = "0";
+
# Terms of Service; don't edit lines with the word EOF
my $terms = <<"EOF";
IRCNow is a Christian network. Rules: no profanity, no porn, no illegal drugs, no gambling, no slander, no warez, no promoting violence, no spam, illegal cracking, or DDoS.
@@ -60,6 +62,7 @@ die("You did not configure the bot!");
+
##### Do not edit code below #####
@@ -75,6 +78,7 @@ use OpenBSD::Unveil;
use File::Copy qw(copy);
use Digest::SHA qw(sha256_hex);
use Data::Dumper;
+use Time::HiRes qw ( setitimer ITIMER_VIRTUAL time );
my $sysname = "botnow"; # system username
my $wwwpath = "/var/www/htdocs/botnow"; # Web folder path
@@ -116,7 +120,8 @@ my $records;
my @months = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
my @days = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
my @chans = split /,/m, $chans;
-my @teamchans = split /,/m, $teamchans;
+my @teamchans;
+if (defined($teamchans)) { @teamchans = split /,/m, $teamchans; }
# Load list of networks
# To add multiple servers for a single network, simplify create a new
@@ -187,6 +192,13 @@ if (open($fh, '+<', "$ipv6path")) {
die "Cannot open '$ipv6path' $!";
}
+use strict;
+use warnings;
+
+#eval {
+# $SIG{ALRM} = \&saverecords;
+#};
+
# create sockets
my $sel = IO::Select->new( );
my $lastname = "";
@@ -199,12 +211,12 @@ foreach my $network (@networks) {
$sel->add($socket);
my $tmp = {"sock" => $socket};
push(@bots, {%$tmp, %$network});
- print $socket "NICK $botnick\r\n";
- print $socket "USER $botnick * * :$botnick\r\n";
+ print $socket "NICK $nick\r\n";
+ print $socket "USER $nick * * :$nick\r\n";
}
while(my @ready = $sel->can_read) {
- my $bot;
+ my ($bot, $response);
foreach my $socket (@ready) {
foreach my $b (@bots) {
if($socket == $b->{sock}) {
@@ -212,38 +224,127 @@ while(my @ready = $sel->can_read) {
last;
}
}
- my $response;
if (!defined($response = <$socket>)) {
next;
}
if ($response =~ /^PING :ZNC\r\n$/i) {
print $socket "PONG :ZNC\r\n";
- foreach my $chan (@chans) {
- print $socket "JOIN ".$chan."\r\n";
- }
- } elsif ($response =~ /^:irc.znc.in 464 $botnick.? :Password required\r\n$/i) {
- print $socket "PASS $botnick/$bot->{name}:$pass\r\n";
if ($bot->{name} =~ /$localnet/i) {
- print $socket "PRIVMSG *status :LoadMod --type=user controlpanel\r\n";
- print $socket "PRIVMSG *controlpanel :get Admin $botnick\r\n";
- print $socket "PRIVMSG *controlpanel :get Nick cloneuser\r\n";
- print $socket "OPER $opernick $operpass\r\n";
+ saverecords();
}
+ } elsif ($response =~ /^:irc.znc.in (.*) (.*) :(.*)\r\n$/) {
+ my ($type, $target, $reply) = ($1, $2, $3);
+ parseznc($bot, $type, $target, $reply);
} elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) PRIVMSG ([^ ]+) :(.*)\r\n$/i) {
my ($hostmask, $target, $reply) = ($1, $2, $3);
parsemsg($bot, $hostmask, $target, $reply);
} elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) NOTICE ([^ ]+) :(.*)\r\n$/i) {
my ($hostmask, $target, $reply) = ($1, $2, $3);
parsenotice($bot, $hostmask, $target, $reply);
- } elsif ($response =~ /^:irc\.[a-zA-Z0-9]+\.ircnow.org (\d\d\d) $botnick.? (.*)\r?\n?\r$/i) {
- my ($code, $reply) = ($1, $2);
- parsewhois($bot, $code, $reply);
+ } elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) MODE ([^ ]+) :(.*)\r\n$/i) {
+ my ($hostmask, $target, $reply) = ($1, $2, $3);
+ parsemode($bot, $hostmask, $target, $reply);
+ } elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) JOIN :?(.*)\r\n$/i) {
+ my ($hostmask, $chan) = ($1, $2);
+ parsejoin($bot, $hostmask, $chan);
+ } elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) PART ([^ ]+) :(.*)\r\n$/i) {
+ my ($hostmask, $chan, $msg) = ($1, $2, $3);
+ parsepart($bot, $hostmask, $chan, $msg);
+ } elsif($response =~ /^:([^!]+![^@]+@[^@ ]+) NICK :(.*)\r\n$/i) {
+ my ($hostmask, $nick) = ($1, $2);
+ parsenick($bot, $hostmask, $nick);
+ } elsif ($response =~ /^:([[:graph:]]+) (\d\d\d) $nick.? :?(.*)\r?\n?\r$/i) {
+ my ($server, $code, $reply) = ($1, $2, $3);
+ parseserver($bot, $server, $code, $reply);
+ } elsif ($response =~ /^:irc\.[a-zA-Z0-9]+\.ircnow.org (\d\d\d) $nick.? (.*)\r?\n?\r$/i) {
+print "parsewhois: $response\r\n";
+# my ($code, $reply) = ($1, $2);
+# parsewhois($bot, $code, $reply);
} else {
-# print "Unexpected: $response\r\n";
+ if ($verbose >= 2) { print "Unexpected: $response\r\n"; }
}
}
}
+sub parseznc {
+ my ($bot, $type, $target, $reply) = @_;
+ my $socket = $bot->{sock};
+ if ($type eq "001" && $target =~ /^$nick.?$/ && $reply eq "Welcome to ZNC") {
+ } elsif ($type eq "NOTICE" && $target =~ /^$nick.?$/ && $reply eq "*** To connect now, you can use /quote PASS <username>:<password>, or /quote PASS <username>/<network>:<password> to connect to a specific network.") {
+ } elsif ($type eq "NOTICE" && $target =~ /^$nick.?$/ && $reply eq "*** You need to send your password. Configure your client to send a server password.") {
+ } elsif ($type eq "464" && $target =~ /^$nick.?$/ && $reply eq "Password required") {
+ print $socket "PASS $nick/$bot->{name}:$pass\r\n";
+ foreach my $chan (@chans) {
+ print $socket "JOIN ".$chan."\r\n";
+ }
+ if ($bot->{name} =~ /$localnet/i) {
+ print $socket "OPER $nick $pass\r\n";
+ print $socket "PRIVMSG *status :LoadMod --type=user controlpanel\r\n";
+ print $socket "PRIVMSG *controlpanel :get Admin $nick\r\n";
+ print $socket "PRIVMSG *controlpanel :get Nick cloneuser\r\n";
+ foreach my $chan (@teamchans) {
+ print $socket "JOIN ".$chan."\r\n";
+ }
+ }
+ } else {
+ print "Unexpected: type: $type, target: $target, reply: $reply\r\n";
+ }
+}
+sub parseserver {
+ my ($bot, $server, $code, $reply) = @_;
+ my $socket = $bot->{sock};
+ if ($code =~ /^00\d$/) { # Server Info
+# print "$server $reply\r\n";
+ } elsif ($code =~ /^2\d\d$/) { # Server Stats
+ print "$server $reply\r\n";
+ } elsif ($code eq "372") {
+# print "MOTD: $server $reply\r\n";
+ } else {
+# print "$server $code $reply\r\n";
+ }
+#:irc.efnet.nl 001 guava :Welcome to the EFNet Internet Relay Chat Network guava
+#:irc.efnet.nl 002 guava :Your host is irc.efnet.nl[2001:67c:12d8::6667/6667] , running version ircd-ratbox-3.0.10
+#:irc.efnet.nl 003 guava :This server was created Sun Oct 2 2016 at 04:55:27 CEST
+#amsterdam.nl.eu.undernet.org 353 = #ircnow :APhiO AnG3|KiSs ApolDapol Baby_ Bajoy Bamse_
+# BeBeLuShuL BeEF BotchoK COBRA002^ CiprIonut Cristi_ Cyphr Dome Eve G0di Licey Maim N2Jg
+#Runge Neuro No1HaTeSmE PaKs Perisai PuiMik PuiMik_ @Quo-fan Raf^y Rocking SharkZ Swim Th
+#orOfAngels True` Tuidor UnFa|thFuLL1 Venin Zorii` [NPS] [Virtual] b2 @compTECH @depeche
+#depecheMODE @dm don`semaca dwizzt fight getfar gry @gry-sock-und guava hunter_ @ircnow @
+#jrmu jrmu` @jrmubot kg kisser mabzicle madguys
+#guava!guava@2605:6400:20:b4:5c51:1a2d:1fba:1a9a JOIN #ircnow
+#amsterdam.nl.eu.undernet.org 353 = #ircnow :malic nix_ nonickname @orangeBNC_ play_ raff
+#y reborn reborn_ @shman swimmer tankup trip usr vindiKHATE winmx zACk |\|0
+#amsterdam.nl.eu.undernet.org 353 = #ircnow :APhiO AnG3|KiSs ApolDapol Baby_ Bajoy Bamse_
+# BeBeLuShuL BeEF BotchoK COBRA002^ CiprIonut Cristi_ Cyphr Dome Eve G0di Licey Maim N2Jg
+#Runge Neuro No1HaTeSmE PaKs Perisai PuiMik PuiMik_ @Quo-fan Raf^y Rocking SharkZ Swim Th
+#orOfAngels True` Tuidor UnFa|thFuLL1 Venin Zorii` [NPS] [Virtual] b2 @compTECH @depeche
+#depecheMODE @dm don`semaca dwizzt fight getfar gry @gry-sock-und guava hunter_ @ircnow @
+#jrmu jrmu` @jrmubot kg kisser mabzicle madguys
+
+}
+sub parsemode {
+ my ($bot, $hostmask, $target, $reply) = @_;
+ if ($verbose >= 3) { print "$hostmask MODE $target $reply\r\n"; }
+#:guava!guava@guava.guava.ircnow.org MODE guava :+Ci
+#:ChanServ!services@services.irc.ircnow.org MODE #testing +q jrmu
+#:jrmu!jrmu@jrmu.staff.ircnow.org MODE #testing +o jrmu
+}
+sub parsejoin {
+ my ($bot, $hostmask, $chan) = @_;
+ if ($verbose >= 3) { print "$hostmask JOIN $chan\r\n"; }
+#:jrmu!jrmu@jrmu.staff.ircnow.org JOIN :#testing
+}
+sub parsepart {
+ my ($bot, $hostmask, $chan, $msg) = @_;
+ print "$hostmask PART $chan :$msg\r\n";
+#:jrmu!jrmu@jrmu.staff.ircnow.org PART #testing :
+}
+sub parsenick {
+ my ($bot, $hostmask, $nick) = @_;
+ print "$hostmask NICK $nick\r\n";
+#:Fly0nDaWaLL|dal!psybnc@do.not.h4ck.me NICK :nec|dal
+}
+
sub sendmsg {
my( $bot, $target, $msg )=@_;
my $socket = $bot->{sock};
@@ -251,7 +352,7 @@ sub sendmsg {
foreach my $l (@lines) {
print $socket "PRIVMSG $target :$l\r\n";
# if not sending to znc
- if ($bot->{name} =~ /$localnet/i and $target !~ /^\*/) {
+ if ($bot->{name} =~ /^$localnet$/i and $target !~ /^\*/) {
sleep(1);
}
}
@@ -262,15 +363,16 @@ sub mailverify {
my $hash = sha256_hex("$username");
my $msg = <<"EOF";
-From: support \<$mailfrom\>
+From: $mailname \<$mailfrom\>
To: $email
Subject: Verify IRCNow Account
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
-You created the account $username with temporary password $password. Your server is
-$hostname, port is 31337 for SSL (secure connection), 1337 for plaintext.
+You created the account $username with temporary password $password. Your
+server is $hostname, port is $sslport for SSL (secure connection), $plainport
+for plaintext.
Please verify your email address:
@@ -285,105 +387,27 @@ print $fh $msg;
close $fh;
}
-sub www {
- my( $username, $email, $password, $service )=@_;
- my $hash = sha256_hex("$username");
- my $filename = "$database/www";
- my $lines = "";
- if (open($fh, '+<', $filename)) {
- while (my $line = <$fh>) {
- $lines .= $line;
- }
- close $fh;
- }
- open($fh, '>', "$filename") or die "Could not write to '$database/www' $!";
- print $fh $lines;
- print $fh "Hash: $hash, Username: $username, Email: $email, Password: $password\n";
- close $fh;
-}
-
-sub pmstaff {
- my( $sender, $msg )=@_;
- my @nicks = split /,/m, $staff;
- my $bot;
-
- if (!defined($staff)) { return; }
-
- #prevent duplicates on other networks
- if ($sender =~ /\|/) {
- return;
- }
-
- foreach my $b (@bots) {
- if($b->{name} =~ /$localnet/i) {
- $bot = $b;
- last;
- }
- }
- foreach my $nick (@nicks) {
- sendmsg($bot, $nick, "$msg");
- }
-}
-
-sub whois {
- my( $socket, $target )=@_;
- print $socket "WHOIS $target $target\r\n";
-}
-
-sub ctcp {
- my( $socket, $target )=@_;
-# print $socket "PRIVMSG $target :".chr(01)."CLIENTINFO".chr(01)."\r\n";
-# print $socket "PRIVMSG $target :".chr(01)."FINGER".chr(01)."\r\n";
-# print $socket "PRIVMSG $target :".chr(01)."SOURCE".chr(01)."\r\n";
- print $socket "PRIVMSG $target :".chr(01)."TIME".chr(01)."\r\n";
-# print $socket "PRIVMSG $target :".chr(01)."USERINFO".chr(01)."\r\n";
- print $socket "PRIVMSG $target :".chr(01)."VERSION".chr(01)."\r\n";
-# print $socket "PRIVMSG $target :".chr(01)."PING".chr(01)."\r\n";
-}
-
-sub newpass {
- my $len = scalar @words;
- my $pass;
- for (my $i=0; $i < $passlength; $i++) {
- my $word = $words[int(rand($len))];
- $word =~ s/(\w+)/\u$1/g;
- $pass .= $word;
- }
- $pass .= int(rand(10));
- $pass .= int(rand(10));
- $pass .= int(rand(10));
- return $pass;
-}
-sub nickfromhost {
- my ($hostmask) = @_;
- if ($hostmask =~ /([^!]+)!/i) {
- return $1;
- }
- return;
-}
sub getrecords {
+ my ($filename, $hostmask);
my $date = date();
- my $filename;
opendir(DIR, "$database") || die "Can't open $database: $!\n";
+ # Files follow the format of YYYYMMDD
my @flist = grep(/^[0-9]+$/, readdir(DIR));
closedir(DIR);
-# sort numerically descending
- if (scalar(@flist) == 0) {
-# create new file
+ if (scalar(@flist) == 0) { # if no records found, create
$filename = "$database/$date";
open($fh, '>', "$filename") or die "Could not write file '$filename' $!";
close $fh;
- } else {
+ } else { # sort numerically descending
my @sorted = sort {$b <=> $a} @flist;
$filename = "$database/".$sorted[0];
}
open($fh, '+<', $filename) or die "Could not read '$filename' $!";
- my $hostmask;
while (my $line = <$fh>) {
- if ($line =~ /^hostmask: ([-_.@~*!:0-9a-zA-Z]+)$/) {
+ if ($line =~ /^hostmask: ([[:graph:]]+)$/) {
$hostmask = $1;
$records->{$hostmask} = ();
- } elsif ($line =~ /^([-_.@~*!:0-9a-zA-Z]+): (.*)$/) {
+ } elsif ($line =~ /^([^:]+): (.*)$/) {
$records->{$hostmask}->{$1} = $2;
}
}
@@ -391,41 +415,39 @@ sub getrecords {
}
sub getkeyval {
my ($hostmask, $key) = @_;
- if (!defined($records)) {
- getrecords();
- }
- return $records->{$hostmask}->{$key};
+ my $val;
+ if (!defined($records)) { getrecords(); }
+ $val = $records->{$hostmask}->{$key};
+ if ($verbose >= 3) { print "getkeyval $hostmask: $key => ".($val or "undefined")."\r\n"; }
+ return $val;
}
sub setkeyval {
my ($hostmask, $key, $val) = @_;
-#print "$hostmask: $key => $val\r\n";
- if (!defined($records)) {
- getrecords();
- }
+ if (!defined($records)) { getrecords(); }
$records->{$hostmask}->{$key} = $val; # autovivifies
- saverecords();
+ if ($verbose >= 3) { print "setkeyval $hostmask: $key => $val\r\n"; }
+ #eval {
+ # alarm 10;
+ #}
}
sub delkey {
my ($hostmask, $key) = @_;
- if (!defined($records)) {
- getrecords();
- }
+ if (!defined($records)) { getrecords(); }
delete($records->{$hostmask}->{$key});
- saverecords();
+ if ($verbose >= 3) { print "delkey $hostmask: $key\r\n"; }
+ #eval {
+ # alarm 10;
+ #}
}
sub delhost {
my ($hostmask) = @_;
- if (!defined($records)) {
- getrecords();
- }
+ if (!defined($records)) { getrecords(); }
delete($records->{$hostmask});
saverecords();
}
sub firstval {
my ($key, $val) = @_;
- if (!defined($records)) {
- getrecords();
- }
+ if (!defined($records)) { getrecords(); }
foreach my $hostmask (keys %$records) {
if (exists($records->{$hostmask}->{$key}) && $records->{$hostmask}->{$key} eq $val) {
return $hostmask;
@@ -435,9 +457,7 @@ sub firstval {
}
sub saverecords {
my $filename = "$database/".date();
- if (!defined($records)) {
- getrecords();
- }
+ if (!defined($records)) { getrecords(); }
open($fh, '>', "$filename.bak") or die "Could not write to '$database' $!";
while (my ($hostmask, $record) = each (%$records)) {
print $fh "hostmask: $hostmask\n";
@@ -448,6 +468,7 @@ sub saverecords {
}
close $fh;
copy "$filename.bak", $filename;
+ if ($verbose >= 3) { print "records saved\n"; }
return 1;
}
@@ -462,6 +483,84 @@ sub mytime {
return $localtime;
}
+sub www {
+ my( $username, $email, $password, $service )=@_;
+ my $hash = sha256_hex("$username");
+ my $filename = "$database/www";
+ my $lines = "";
+ if (open($fh, '+<', $filename)) {
+ while (my $line = <$fh>) {
+ $lines .= $line;
+ }
+ close $fh;
+ }
+ open($fh, '>', "$filename") or die "Could not write to '$database/www' $!";
+ print $fh $lines;
+ print $fh "Hash: $hash, Username: $username, Email: $email, Password: $password\n";
+ close $fh;
+}
+
+sub newpass {
+ my $len = scalar @words;
+ my $pass;
+ for (my $i=0; $i < $passlength; $i++) {
+ my $word = $words[int(rand($len))];
+ $word =~ s/(\w+)/\u$1/g;
+ $pass .= $word;
+ }
+ return $pass;
+}
+sub nickfromhost {
+ my ($hostmask) = @_;
+ if ($hostmask =~ /([^!]+)!/i) {
+ return $1;
+ }
+ return;
+}
+
+sub pmstaff {
+ my( $sender, $msg )=@_;
+ my @nicks = split /,/m, $staff;
+ my $bot;
+
+ if (!defined($teamchans)) { return; }
+
+ #prevent duplicates on other networks
+ if ($sender =~ /\|/) {
+ return;
+ }
+
+ foreach my $b (@bots) {
+ if($b->{name} =~ /$localnet/i) {
+ $bot = $b;
+ last;
+ }
+ }
+ foreach my $chan (@teamchans) {
+ if (defined($staff)) {
+ sendmsg($bot, $chan, join(" ", split /,/m, $staff).": $msg");
+ } else {
+ sendmsg($bot, $chan, $msg);
+ }
+ }
+}
+
+sub whois {
+ my( $socket, $target )=@_;
+ print $socket "WHOIS $target $target\r\n";
+}
+
+sub ctcp {
+ my( $socket, $target )=@_;
+# print $socket "PRIVMSG $target :".chr(01)."CLIENTINFO".chr(01)."\r\n";
+# print $socket "PRIVMSG $target :".chr(01)."FINGER".chr(01)."\r\n";
+# print $socket "PRIVMSG $target :".chr(01)."SOURCE".chr(01)."\r\n";
+ print $socket "PRIVMSG $target :".chr(01)."TIME".chr(01)."\r\n";
+# print $socket "PRIVMSG $target :".chr(01)."USERINFO".chr(01)."\r\n";
+ print $socket "PRIVMSG $target :".chr(01)."VERSION".chr(01)."\r\n";
+# print $socket "PRIVMSG $target :".chr(01)."PING".chr(01)."\r\n";
+}
+
sub parsemsg {
my ($bot, $hostmask, $target, $reply) = @_;
my $socket = $bot->{sock};
@@ -509,7 +608,7 @@ EOF
delkey($hostmask, "requestnick");
sendmsg($bot, nickfromhost($hostmask), "Email:");
} elsif ($reply =~ /^Admin = false/) {
- pmstaff("", "Error: $botnick is not admin");
+ pmstaff("", "Error: $nick is not admin");
die;
} elsif ($reply =~ /^Admin = true/) {
sendmsg($bot, "*status", "LoadMod --type=user chansaver");
@@ -539,7 +638,7 @@ EOF
sendmsg($bot, $sender, $terms);
pmstaff($bot->{name}, "Help *$sender* on ".$bot->{name});
}
- } elsif ($target !~ /^$botnick.?/) {
+ } elsif ($target !~ /^$nick.?/) {
# print "$hostmask: $target $reply\r\n";
} elsif (!defined(getkeyval($hostmask, "num"))) {
if ($reply =~ /^(y|yes)/i) {
@@ -600,6 +699,21 @@ EOF
}
# Hidden functionality
+ if ($reply =~ /^!deluser (.*)$/i) {
+ my $user = $1;
+ if ($staff !~ /$sender/) {
+ return;
+ }
+ print $socket "PRIVMSG *controlpanel :deluser $user\r\n";
+ }
+ if ($reply =~ /^!rehash$/i) {
+ if ($staff !~ /$sender/) {
+ return;
+ }
+ print $socket "PRIVMSG *controlpanel :deluser cloneuser\r\n";
+ sleep 5;
+ print $socket "PRIVMSG *controlpanel :get Nick cloneuser\r\n";
+ }
if ($reply =~ /^!dns\s+([-.0-9a-z]+)\s+([:0-9a-f]+)/i) {
my ($fqdn, $ip6) = ($1, $2);
if ($staff !~ /$sender/) {
@@ -827,131 +941,3 @@ sub nextdns {
}
return;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#sub resend {
-# my ($bot, $newnick, $email) = @_;
-# my $password = newpass();
-# sendmsg($bot, "*controlpanel", "set Password $newnick $password");
-# mailverify($newnick, $email, $password, "bouncer");
-# sendmsg($bot, "$newnick", "Email sent");
-#}
-
-#sub mailfinish {
-# my( $username, $password, $email, $service )=@_;
-#my $msg = <<"EOF";
-#From: support \<support\@ircnow.org\>
-#To: $email
-#Subject: Welcome to IRCNow!
-#MIME-Version: 1.0
-#Content-Type: text/plain; charset=us-ascii
-#Content-Disposition: inline
-#
-#Welcome to IRCNow!
-#
-#Your account $username with password $password is now activated.
-#
-#For instructions on how to connect, please visit: https://ircnow.org
-#
-#For help, please visit our support channel on irc.ircnow.org #ircnow.
-#
-#IRCNow
-#EOF
-#open(my $fh, '| /usr/sbin/sendmail -tv -F support -f support@ircnow.org') or die "Could not send mail $!";
-#print $fh $msg;
-#close $fh;
-#open($fh, '>>', "$database") or die "Could not open file '$database' $!";
-#print $fh $msg;
-#close $fh;
-#}
-#
-
-
-#sub createshell {
-#my $msg = <<"EOF";
-#Your shell account username is $newnick and password is $password . The server is $hostname , port 22. Our official support channel is on #shell. Instructions: https://ircnow.org/kb/doku.php?id=shell:shell .
-#EOF
-#
-# my ($password, $username) = @_;
-# `doas sh /home/bnc/newacct $username $password`;
-#}
-
-
-# if ($reply =~ /^!resend ([-_0-9a-zA-Z]+) ([-_0-9a-zA-Z]+@[-_0-9a-zA-Z]+\.[-_0-9a-zA-Z]+)$/i) {
-# my ($newnick, $email) = ($1, $2);
-# my $password = newpass();
-# resend($bot, $newnick, $email);
-# }
-# if ($reply =~ /^!vpn (.*) ([-_0-9a-zA-Z]+)$/i) {
-# my $ircnick = $1;
-# my $newnick = $2;
-# if ($staff !~ /$sender/) {
-# return;
-# }
-# my $password = newpass();
-# createvpn($password, $newnick);
-# sendmsg($bot, $sender, "vpn created for $newnick");
-#my $msg = <<"EOF";
-#Your vpn account has been created! Username: $newnick with password: $password
-#Our official support channel is #vpn. To connect, please follow these instructions: https://ircnow.org/kb/doku.php?id=vpn:vpn .
-#EOF
-# sendmsg($bot, $ircnick, $msg);
-# }
-# if ($reply =~ /^!email (.*) ([-_0-9a-zA-Z]+)$/i) {
-# my $ircnick = $1;
-# my $newnick = $2;
-# if ($staff !~ /$sender/) {
-# return;
-# }
-# my $password = newpass();
-# createmail($password, $newnick);
-# sendmsg($bot, $sender, "email created for $newnick");
-#my $msg = <<"EOF";
-#Your email account has been created! Username: $newnick with password: $password
-#Our official support channel is #email. To connect, please follow these instructions: https://ircnow.org/kb/doku.php?id=email:email .
-#EOF
-# sendmsg($bot, $ircnick, $msg);
-# }
-#sub createvpn {
-# my ($password, $username) = @_;
-# `doas sh -c 'echo "user '$username' '$password'" >> /etc/iked.conf'`;
-# `doas rcctl reload iked`;
-#}
-#sub createmail {
-# my ($password, $username) = @_;
-# my $encrypted = `encrypt $password`;
-# chomp($encrypted);
-# my $line = "${username}\@ircnow.org:${encrypted}::::::userdb_quota_rule=*:storage=1G";
-# $line =~ s{\$}{\\\$}g;
-# my $line2 = "${username}\@ircnow.org vmail";
-# my $line3 = "${username}: ${username}\@ircnow.org";
-# `doas sh -c 'echo $line >> /etc/mail/passwd'`;
-# `doas sh -c 'echo $line2 >> /etc/mail/virtuals'`;
-# `doas sh -c 'echo $line3 >> /etc/mail/aliases'`;
-# `doas rcctl restart smtpd`;
-# `doas rcctl reload dovecot`;
-#}
-#unveil("./newacct", "rx") or die "Unable to unveil $!";
-#use Data::Dumper;
blob - 42de9ad2aff9d920cf6affbbff0bbdf3972bba4d
blob + ac1126335fb29aa3db9cb17052585b867e6fe443
--- networks
+++ networks
@@ -109,7 +109,7 @@ evolu irc.evolu.net ~6697
exchat irc.exchat.net ~6697
explosionirc irc.explosionirc.net 6667
forumcerdas irc.forumcerdas.net ~6697
-freenode chat.ipv6.freenode.net +6697
+#freenode chat.ipv6.freenode.net +6697
freenode ipv6.chat.freenode.net +6697
freeunibg irc.freeunibg.eu 6667
freshchat irc.freshchat.org +6697
blob - 404c0bdbcb4fe00575cb7baf3e94069228e1b06b
blob + 8afb70116397f39af18eb826dc65faf59e92043e
--- register.php
+++ register.php
@@ -1,5 +1,30 @@
<?php
+$email = "support@ircnow.org";
+$webpanel = "https://example.ircnow.org";
+
+
+
+
+
+
+// Do not edit anything below this line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$words = file('words');
$wordslen = sizeof($words);
$passphrase;
@@ -35,13 +60,13 @@ body {
</style>
</head>
<body>
-<p>Please email <a href="mailto:support@ircnow.org">support@ircnow.org</a> with the following passphrase:</p>
+<p>Please email <a href="mailto:$email">$email</a> with the following passphrase:</p>
<p>IRCNow Verify <?php echo $passphrase ?></p>
-<p><a href="https://ircnow.org/kb/doku.php?id=irc:bouncer">Click here for connection instructions.</a></p>
+<p><a href="https://wiki.ircnow.org/index.php?n=Bouncer.Bouncer">Click here for connection instructions.</a></p>
-<p>To change your password, login to <a href="https://us10.ircnow.org">https://us10.ircnow.org</a>, fill in the password field, then click on the "Save and Return" button.</p>
+<p>To change your password, login to <a href="$webpanel">$webpanel</a>, fill in the password field, then click on the "Save and Return" button.</p>
</body>
</html>