mIRC Firewall

By QuickStep on Jan 07, 2005

Just a basic easy firewall that asks for permission if a script wants to access the internet. You only need to put it in your remote.

alias sockopen {
  var %address = $+($gettok($1-,-2,32),$chr(58),$gettok($1-,-1,32)), %action = $readini(firewall.ini,firewall,%address)
  var %permitmessage = echo 3 -s %address making contact with the internet!, %blockmessage = echo 4 -s %address blocked!
  %action = $iif(%action,%action,0)
  goto %action

  ;Action 0: Ask to open
  :0 | var %a = $?!="Allow %address to be opened?", %b = $?!="Always use this action for %address ?"
  if (%b) writeini firewall.ini firewall %address $iif(%a,1,2)
  if (%a) { %permitmessage | !sockopen $1- } | else %blockmessage
  return

  ;Action 1: Permit
  :1 | %permitmessage | !sockopen $1- | return

  ;Action 2: Block
  :2 | %blockmessage | halt
}

/*
This script can be upgraded in many many ways (it can still be avoided). Well heres already a small upgrade. It isnt really necessarry but what it does is when you load a script file it does an easy search for sockopen commands and if it finds 1 asks if you want to load the file anyway:
*/

alias load {
  if ($1 = -rs) && ($isfile($2)) {
    if ($read($2, wn, *sockopen*)) {
      var %popupmsg = This script *possibly* contains a sockopen command on line $+($readn,: $read($2,n,$readn),$crlf,This $&
        means the script has the ability to open an internet connection. Load script $2 anyway?)
      if (!$?!=" $+ %popupmsg $+ ") { echo -s 4Script $2 was not loaded! | halt }
    }
  }
  !load $1-
}

Comments

Sign in to comment.
nemofbaltimore   -  Feb 17, 2008

u got one to block port scan\'s? i already block ctcp
but i was wondering if i could block port scan\'s / port knocks for the irc ports

 Respond  
Shadow_Slayerz   -  Jan 07, 2005

I Have Never seen a mirc function like this.! GOOD JOB

 Respond  
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.