cloudIPD SecureCommand

By Aurora801 on Jan 23, 2014


*** New Update coming soon!


This is the cloudIPD SecureCommand System. It includes it's own help system, and uses the built-in user system for mIRC.

To use, open your BOTs mIRC and open the REMOTE (alt+r), and paste this snippet, then connect to a server, and type /sc_setowner [nickname] to add yourself as the owner.
To begin, type $commands in any channel the bot is in.
Need help? Talk to me: irc.toxicairc.net (#lobby or ##nocht##)

The bot will check my website to see if it is the current version, both on starting and on request with command $webx

********************************************************
*Current version: 1.2.1                                *
*Live version: 1.0.4                                   *
*DOX Version: 1.0                                      *
********************************************************
*Refer to http://n0cht.us/cloud/ for version info      *
********************************************************
;*******************************************
;* SecureCommand by wh0r3                  *
;* - use $commands in channel for usage    *
;* --------------------------------------- *
;* visit http://wh0r3.insomnia247.nl/cloud *
;* for information on usage and commands.  *
;* --------------------------------------- *
;* Version 1.0.4                           *
;*******************************************
on *:LOAD: {
  echo -sgt [SecureCommand] Welcome to cloudIPD SecuCom.
  echo -sgt [SecureCommand] join a channel with your owner and type /sc_setowner [nickname] to add my owner.
  echo -sgt [SecureCommand] If you need help, go to irc.toxicairc.net and join ##nocht##, and talk to wh0r3.
}
on *:START: {
  echo -sgt [WebX] Checking for updates...
  sockopen webx n0cht.us 80
  set %sc_webx.check load
}
alias -l sc_ver { return 1.0.4 }
alias -l sc_chan { return ##nocht## }
on *:TEXT:$*:#: {
  set %cmd $remove($1,$left($1,1))
  secucom -c $chan $nick -o %cmd $2-
  if ($sc_level($nick) !== Owner) { sc_ignore $nick $chan }
}
alias -l sc_ignore {
  if (%sc_line. [ $+ [ $1 ] ] == $null) { set %sc_line. [ $+ [ $1 ] ] 1 }
  else {
    if (%sc_line. [ $+ [ $1 ] ] > 5) { msg $2 $1 has sent 5+ lines in 5 seconds. ignoring for 5 minutes. | ignore -u300 $address($1,2) }
    else {  inc %sc_line. [ $+ [ $1 ] ] }
  }
  timer 1 5 unset %sc_line. [ $+ [ $1 ] ]
}
alias secucom {
  if ($1 == -c) {
    set %sc_chan $2
    set %sc_nick $3
    if ($4 == -o) {
      set %sc_cmd $5
      echo -agt [SecuCommand] %sc_chan / %sc_nick $+([,%sc_cmd,]) - $6-
      secucom2 %sc_cmd $6-
    }
    else { msg $sc_chan [SecuCommand] %sc_chan / %sc_nick - Inavlid args given: $4- }
  }
  elseif ($isid) {
    if ($1 == uptime) { return $duration($uptime) }
  }
}
alias sc_setowner {
  if ($comchan($1,0) > 0) { auser 200 $address($1,2) | echo -agt [SecureCommand] Owner added: $1 ( $+ $address($1,2) $+ ) | notice $1 You have been added as my owner. }
  else { echo -agt [SecureCommand] Error. user needs to be in a common channel with you. }
}
alias -l sc_level {
  if ($level($address($1,2)) > 199) { return Owner }
  elseif ($level($address($1,2)) > 149) { return Service Admin }
  elseif ($level($address($1,2)) > 99) { return Admin }
  elseif ($level($address($1,2)) > 49) { return Adv. User }
  else { return User }
}
alias -l sc_ac {
  if ($sc_level($1) == Owner) { return 5 }
  elseif ($sc_level($1) == Service Admin) { return 4 }
  elseif ($sc_level($1) == Admin) { return 3 }
  elseif ($sc_level($1) == Adv. User) { return 2 }
  else { return 1 }
}
;sc_perldoc flags: H L F O S P U I
alias -l sc_perldoc {
  if ($1 == -l) {
    if ($2 == help) {
      notice %sc_nick [PerlDoc\Lang] The following are options in the PDLR
      notice %sc_nick [PerlDoc\lang] syntax / data / sub / op / func / POD / podspec / podstyle
      notice %sc_nick [PerlDoc\Lang] diag / lexwarn / debug / var / regex / regexref / regexbslash
      notice %sc_nick [PerlDoc\Lang] charclass / refpoint / form / obj / tie / dbmfilter / ipc / fork
      notice %sc_nick [PerlDoc\Lang] number / perf / port / locale / uniintro / uniprops / EBCDIC
      notice %sc_nick [PerlDoc\Lang] security / modules / modlib / modstyle / modinstall / newmod
      notice %sc_nick [PerlDoc\Lang] filter / glossary / experiment / trace / CORE
    }
    elseif ($sc_perldocs($2).lang) { msg %sc_chan [PerlDoc\Lang] $2 - $sc_perldocs($2).lang }
    else { msg %sc_chan [PerlDoc] Sorry, but that item either does not exist. Please note that the PerlDoc Reference system is incomplete currently. }
  }
  elseif ($1 == -a) {
    if ($sc_ac(%sc_nick) > 3) {
      if (!$2) { notice %sc_nick [PerlDoc] Syntax: $!perldoc -a [function/name] [url] }
      elseif (http://perldoc.perl.org/* !iswm $3) { notice %sc_nick [PerlDoc] Syntax: $!perldoc -a [function/name] [url (http://perldoc.perl.org/<page>)] }
      else { writeini perldoc.ini $2 $3 | msg %sc_chan [PerlDoc] Entry added: $2 - $3 }
    }
    else { msg %sc_chan [PerlDoc] Error. Adding functions to PerlDoc requires Service Admin or higher status. }
  }
  else { msg %sc_chan [PerlDoc] Sorry, but that item either does not exist. Please note that the PerlDoc Reference system is incomplete currently. }
}
alias -l sc_perldocs {
  if ($isid) {
    if ($readini(perldoc.ini,$prop,$1)) { return $readini(perldoc.ini,$prop,$1) }
    else { return $null }
  }
  elseif (!$isid) {
    if ($1 == build) {
      echo -sgt [PerlDoc] Building PerlDoc database.
      writeini perldoc.ini lang syntax http://perldoc.perl.org/perlsyn.html
      writeini perldoc.ini lang data http://perldoc.perl.org/perldata.html
      writeini perldoc.ini lang sub http://perldoc.perl.org/perlsub.html
      writeini perldoc.ini lang op http://perldoc.perl.org/perlop.html
      writeini perldoc.ini lang func http://perldoc.perl.org/perlfunc.html
      writeini perldoc.ini lang pod http://perldoc.perl.org/perlpod.html
      writeini perldoc.ini lang podspec http://perldoc.perl.org/perlpodspec.html
      writeini perldoc.ini lang podstyle http://perldoc.perl.org/perlpodstyle.html
      writeini perldoc.ini lang diag http://perldoc.perl.org/perldiag.html
      writeini perldoc.ini lang lexwarn http://perldoc.perl.org/perllexwarn.html
      writeini perldoc.ini lang debug http://perldoc.perl.org/perldegub.html
      writeini perldoc.ini lang var http://perldoc.perl.org/perlvar.html
      writeini perldoc.ini lang regex http://perldoc.perl.org/perlre.html
      writeini perldoc.ini lang regexref http://perldoc.perl.org/perlreref.html
      writeini perldoc.ini lang regexbslash http://perldoc.perl.org/perlrebackslash.html
      writeini perldoc.ini lang charclass http://perldoc.perl.org/perlcharclass.html
      writeini perldoc.ini lang refpoint http://perldoc.perl.org/perlref.html
      writeini perldoc.ini lang form http://perldoc.perl.org/perlform.html
      writeini perldoc.ini lang obj http://perldoc.perl.org/perlobj.html
      writeini perldoc.ini lang tie http://perldoc.perl.org/perltie.html
      writeini perldoc.ini lang dbmfilter http://perldoc.perl.org/perldbmfilter.html
      writeini perldoc.ini lang ipc http://perldoc.perl.org/perlipc.html
      writeini perldoc.ini lang fork http://perldoc.perl.org/perlfork.html
      writeini perldoc.ini lang number http://perldoc.perl.org/perlnumber.html
      writeini perldoc.ini lang perf http://perldoc.perl.org/perlperf.html
      writeini perldoc.ini lang port http://perldoc.perl.org/perlport.html
      writeini perldoc.ini lang locale http://perldoc.perl.org/perllocale.html
      writeini perldoc.ini lang uniintro http://perldoc.perl.org/perluniintro.html
      writeini perldoc.ini lang unicode http://perldoc.perl.org/perlunicode.html
      writeini perldoc.ini lang uniprops http://perldoc.perl.org/perluniprops.html
      writeini perldoc.ini lang ebcdic http://perldoc.perl.org/perlebcdic.html
      writeini perldoc.ini lang security http://perldoc.perl.org/perlsec.html
      writeini perldoc.ini lang modules http://perldoc.perl.org/perlmod.html
      writeini perldoc.ini lang modlib http://perldoc.perl.org/perlmodlib.html
      writeini perldoc.ini lang modstyle http://perldoc.perl.org/perlmodstyle.html
      writeini perldoc.ini lang modinstall http://perldoc.perl.org/perlmodinstall.html
      writeini perldoc.ini lang newmod http://perldoc.perl.org/perlnewmod.html
      writeini perldoc.ini lang filter http://perldoc.perl.org/perlfilter.html
      writeini perldoc.ini lang glossary http://perldoc.perl.org/perlglossary.html
      writeini perldoc.ini lang experiment http://perldoc.perl.org/perlexperiment.html
      writeini perldoc.ini lang trace http://perldoc.perl.org/perltrace.html
      writeini perldoc.ini lang core http://perldoc.perl.org/core.html
      echo -sgt [PerlDoc] Finished building database.    
    }
  }
}
alias secucom2 {
  if ($level($address(%sc_nick,2)) <= 200) {
    if ($1 == uptime) { msg %sc_chan Uptime: $secucom(uptime) }
    elseif ($1 == time) { msg %sc_chan Current Time: $time(hh:nn:ss tt) (Alaska Time) }
    elseif ($1 == level) { msg %sc_chan Your SecureCommand level: $level($address(%sc_nick,2)) }
    elseif ($1 == perldoc) {
      if (!$2) { msg %sc_chan [PerlDoc] Home - http://perldoc.perl.org/ }
      elseif ($2 == help) || ($2 == -h) {
        notice %sc_nick [PerlDoc] flags: -hlfospui
        notice %sc_nick [PerlDoc] -h: help / -l: list /
        if ($sc_ac(%sc_nick) > 1) { notice %sc_nick Adv. User: -p: proccess }
        if ($sc_ac(%sc_nick) > 3) { notice %sc_nick Service admin: -a: add }
        notice %sc_nick [Perldoc] For help on each flag, type $!perldoc [-flag] help
      }
      elseif ($2 == build) {
        if ($sc_ac(%sc_nick) > 3) { msg %sc_chan (Re)Building PerlDoc database | sc_perldocs build }
        else { msg %sc_chan [PerlDoc] Error. Restricted to service admins and above. you are only a $sc_level(%sc_nick) }
      }
      else { sc_perldoc $2- }
    }
    elseif ($1 == quote) {
      if (!$2) { var %sc_quote $read(netexquote.txt) |  msg %sc_chan [Random Quote ( $+ $readn $+ )] %sc_quote }
      elseif ($2 == add) { write netexquote.txt $3- | msg %sc_chan Quote added at line $lines(netexquote.txt) }
      elseif ($2 == total) { msg %sc_chan there are $lines(netexquote.txt) quotes in the netex system. } 
      elseif ($2 isnum) { msg %sc_chan [Quote $2 $+ ] $read(netexquote.txt,$2) }
    }
    elseif ($1 == help) {
      if (!$2) { msg %sc_chan visit http://wh0r3.insomnia247.nl/cloud/ for help using SecureCommand. }
      else {
        if ($2 == uptime) { notice %sc_nick uptime - gives you the current uptime of cloudIPD }
        elseif ($2 == time) { notice %sc_nick time - gives the current time in cloudIPD timezone }
        elseif ($2 == level) { notice %sc_nick level - tells you what your level is. | notice %sc_nick level 1: user / level 50: adv. user / level 100: admin / level 150: service admin / level 200: owner/manager }
        elseif ($2 == quote) {
          if (!$3) { notice %sc_nick quote - retrieve a random quote. [type $!help quote [subcommand] for more info }
          else {
            if ($3 == add) { notice %sc_nick quote [add] - adds a quote to the database }
            elseif ($3 == del) { notice %sc_nick [Adv. Users] quote [del] - deletes a quote from the database. }
            elseif ($3 == total) { notice %sc_nick quote [total] - tells you how many quotes are in the database. }
            elseif ($3 == num) { notice %sc_nick quote [#] - retrieves x number quote from the database, where x is the number given. ex. $!quote 4 }
          }
        }
        elseif ($2 == scinfo) { notice %sc_nick scinfo - script diagnostic command. }
        elseif ($2 == access) { notice %sc_nick access - tells you your clearence level. }
        elseif ($2 == op) { notice %sc_nick [Admin] op - ops you or a specified user in the channel }
        elseif ($2 == deop) { notice %sc_nick [Admin] deop - deops you or a specified user in the channel }
        elseif ($2 == server) { notice %sc_nick [Admin] server - gives connection info on cloudIPD }
        elseif ($2 == status) { notice %sc_nick [Admin] status - gives current status information on cloudIPD }
        elseif ($2 == supdate) { notice %sc_nick [Owner] supdate - sends a global announcement that the cloud website has been updated. }
      }
    } 
    elseif ($1 == scinfo) { msg %sc_chan Nickname: %sc_nick / Channel: %sc_chan / Command: $1 / args: $iif($2.$2-,None.) }
    elseif ($1 == access) {
      if (!$2) { msg %sc_chan You have $sc_level(%sc_nick) Access }
    }
    elseif ($1 == commands) {
      notice %sc_nick Commands: uptime, time, level, quote [add|total|#], help, scinfo, access
      if ($sc_ac(%sc_nick) > 1) { notice %sc_nick Adv. User commands: quote [add|del|total|#] }
      if ($sc_ac(%sc_nick) > 2) { notice %sc_nick Admin commands: op, deop, ban, kick, server, status, ignore }
      if ($sc_ac(%sc_nick) > 3) { notice %sc_nick Service Admin commands: supdate, kill }
      if ($sc_ac(%sc_nick) > 4) { notice %sc_nick Owner commands: access [add|del|list], raw }
      notice %sc_nick all commands are used as $!command / type $!help [command] for help on that command.
    }
    ;  else { msg %sc_chan Error.  $1 is not a valid command. }
  }
  if ($sc_level(%sc_nick) == Owner) || ($sc_level(%sc_nick) == Service Admin) || ($sc_level(%sc_nick) == Admin) || ($sc_level(%sc_nick) == Adv. User) {
    if ($1 == quote) {
      elseif ($2 == del) {
        if ($3 > $lines(netexquote.txt)) { msg %sc_chan Error. There are only $lines(netexquote.txt) quotes. thats $calc($3 - $lines(netexquote.txt)) less than what you requested. }
        else { write $+(-dl,$3) netexquote.txt | msg %sc_chan [Quote] Quote Deleted. }
      }
    }
    elseif ($1 == ipd) { set %nslook.chan %sc_chan | nslookup $2- }
  }
  if ($sc_level(%sc_nick) == Owner) || ($sc_level(%sc_nick) == Service Admin) || ($sc_level(%sc_nick) == Admin) { 
    if ($1 == ssyn) {
      if ($2) { msg %sc_chan Setting up Spoofed SYN attack on $2 }
      else { msg %sc_chan Error! use $!ssyn [ip] }
    }
    elseif ($1 == op) {
      if ($me isop %sc_chan) { mode %sc_chan +o $iif($2,$2,%sc_nick) }
      else { msg %sc_chan I'm sorry, but I cannot do that. }
    }
    elseif ($1 == deop) {
      if ($me isop %sc_chan) { mode %sc_chan -o $iif($2,$2,%sc_nick) }
      else { msg %sc_chan I'm sorry, but I cannot do that. }
    }
    elseif ($1 == server) { msg %sc_chan I am connected to $server $iif($network,[on the $network network]), and in $chan(0) channels. }
    elseif ($1 == status) { cpu | msg %sc_chan [Status] %_cpu / $server $iif($network,$+([,$network,])) / $time(hh:nn:ss tt) / NETEX Online }
    elseif ($1 == ignore) {
      if (!$2) { msg %sc_chan Invalid args. please use $!ignore [address|nick] }
      elseif (*!*@* iswm $2) { ignore $2 | msg %sc_chan [SecureCommand] Ignoring address $2 }
      else {
        if ($2 ison %sc_chan) { ignore $address($2,2) | msg %sc_chan ignoring all matches to $2 ( $+ $address($2,2) $+ ) }
        else { msg %sc_chan [SecureCommand] Error. $2 must be in the channel to ignore. }
      }
    }
    elseif ($1 == ban) {
      if ($me !isop %sc_chan) { msg %sc_chan [SecureCommand] Error. I must be opped to use this command }
      else {
        if (*!*@* iswm $2) { mode %sc_chan +b $2 | kick $2 %sc_chan }
        elseif ($2 ison %sc_chan) { mode %sc_chan +b $address($2,2) | kick $2 %sc_chan }
        elseif (!$2) { msg %sc_chan Invalid args. please use $!ban [address|nick] }
      }
    }
    elseif ($1 == kick) {
      if ($me !isop %sc_chan) { msg %sc_chan [SecureCommand] Error. I must be opped to use this command }
      else {
        if (!$2) { msg %sc_chan Invalid args. please use $!kick [nick] [reason (optional)] }
        else { kick $2 %sc_chan [SecureCommand] Kick by %sc_nick $iif($3,$+([,$3-,])) }
      }
    }
  }
  if ($sc_level(%sc_nick) == Owner) || ($sc_level(%sc_nick) == Service Admin) {
    if ($1 == supdate) { amsg cloudIPD Services Website updated: http://wh0r3.insomnia247.nl/cloud/ }
    elseif ($1 == kill) {
      if (a isin $usermode) {
        if ($2 == -s) { raw kill $3 [SecureCommand] Local kill by owner $iif($4,$+([,$4-,])) }
        else { raw kill $2 [SecureCommand] Local kill by %sc_nick $iif($3,$+([,$3-,])) }
      }
      else { msg %sc_chan [SecureCommand] Error. I do not have administrative privilages. }
    }
  }
  if ($sc_level(%sc_nick) == Owner) {
    echo -agt [SecureCommand] Owner Access - $1-
    if ($1 == access) {
      if (!$2) { halt }
      elseif ($2 == add) {
        if ($3 == -o) {
          if ($4) { auser 200 $address($$4,2) | notify $4 | msg %sc_chan [SecureCommand] Owner Added. }
          else { msg %sc_chan Invalid args. please user $!access add [-o|a|u) [nick] }
        }
        elseif ($3 == -s) {
          if ($4) { auser 150 $address($$4,2) | notify $4 | msg %sc_chan [SecureCommand] Service Admin Added. }
          else { msg %sc_chan Invalid args. please user $!access add [-o|a|u) [nick] }
        }
        elseif ($3 == -a) {
          if ($4) { auser 100 $address($$4,2) | notify $4 | msg %sc_chan [SecureCommand] Admin Added. }
          else { msg %sc_chan Invalid args. please user $!access add [-o|a|u) [nick] }
        }
        elseif ($3 == -u) {
          if ($4) { auser 50 $address($$4,2) | notify $4 | msg %sc_chan [SecureCommand] User Added. }
          else { msg %sc_chan Invalid args. please user $!access add [-o|a|u) [nick] }
        }
      }
      elseif ($2 == del) { 
        if (!$3) { msg %sc_chan Invalid args. please uf $!access del [nick] }
        else {
          if ($sc_level($3)) { ruser $address($3,2) | msg %sc_chan [SecureCommand] User Removed. }
          else { msg %sc_chan [SecureCommand] Error: User does not exist. }
        }      
      }
      elseif ($2 == list) {
        if (!$3) { msg %sc_chan Invalid args. please uf $!access list [nick] }
        else { msg %sc_chan [SecureCommand] Access Clearance of $3 $+ : $sc_level($3) }
      }
    }
    elseif ($1 == raw) { $2- }
    elseif ($1 == webx) { msg %sc_chan Checking WebX status. | sockopen webx n0cht.us 80 | set %sc_webx.check request }
    elseif ($1 == flags) {
      if ($me ison %sc_chan) { mode $chan $2- }
      else { msg %sc_chan Error. I am not opped in the channel. }
    }
  }
}

on *:SOCKOPEN:webx: {
  if ($sockerr > 0) { echo -a Error With Server. | sockclose webx }
  sockwrite -n $sockname GET /cloud/webx/check.php HTTP/1.1
  sockwrite -n $sockname HOST: n0cht.us
  sockwrite $sockname $crlf
  echo -sgt [WebX] Socket Opened
}
on *:SOCKREAD:webx: {
  if ($sockerr > 0) { echo -a Error With Server. | sockclose webx }
  sockread %sc_webx
  if (<div id="version"> isin %sc_webx) { set %sc_webx.ver $remove(%sc_webx,<div id="version">,</div>) }
  elseif (<div id="owner"> isin %sc_webx) { set %sc_webx.own $remove(%sc_webx,<div id="owner">,</div>) }
}
on *:SOCKCLOSE:webx: { $iif(%sc_webx.check == load,echo -sgt,msg %sc_chan) [WebX] Owner: %sc_webx.own / Live Version: %sc_webx.ver / Loaded Version: $sc_ver }

Comments

Sign in to comment.
Cuddletauren   -  Jan 25, 2014

I can't try it yet, but are you sure this works?? I just know its not colorful after a certain line.

Aurora801  -  Jan 26, 2014

Yes, it works. you can join irc.toxicairc.net in #lobby and see for yourself if you'd like.

Cuddletauren  -  Jan 26, 2014

i did that, I'm not really getting anything. But it did work...at least to some degree i think.

Cuddletauren  -  Jan 26, 2014

does not work. author does not know regex. auther is extremely rude and insulting. bad script bad person.

Aurora801  -  Jan 26, 2014

@Cuddletauren it does work. you just didn't read the information about it, and did not listen. if you had given me valid questions I could have helped you. the script is fairly self-explanatory.

Aurora801  -  Jan 26, 2014

Also, I didn't know it was mandatory to know regex. >.>

Cuddletauren  -  Jan 26, 2014

valid questions or not, your behavior is too disgusting to use one of your scripts.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.