mIRC Home    About    Download    Register    News    Help

Print Thread
#111555 16/02/05 09:08 PM
Joined: Jan 2005
Posts: 44
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 44
I came across a script on another forum - written by Quickstep. Essentially it notifies users if other loaded scripts are trying to attempt to connect to internet via socks, as well as if a script being loaded has the ability to connect to internet through socks.

It would be nice if MIRC already had this built-into it. (with the ability to disable, of course)

Code:
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-
}

#111556 16/02/05 10:29 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Nice but really needs to be built in if anyone is got a script onto you thats doing covert socks and there any good at scripting then its not going to be that easy to stop them.
ie: !sock $+ open just for a start

#111557 16/02/05 11:39 PM
Joined: Oct 2003
Posts: 88
B
Babel fish
Offline
Babel fish
B
Joined: Oct 2003
Posts: 88
Socklisen is also a very dangerous command that should be pretected. Its might be a good idea to implemenet a way to turn socket commands off for mIRC. Its very hard to control the actions of scripts however, as they more or less have all the capablity of any other program. As with any program, dont run it if you dont trust the source.


Basicer - Windows 7 Business x86

Link Copied to Clipboard