////////////// // // Proxy Blocker v1.0.7b by Pri (14th of November 2010) // This script requires Metis v2.80 & RoboMX v2.08 // Website: www.mxpulse.com/board // ////////////// // // Commands Included that you can use: // !Download - Begins a Download of the Proxy Blocklist // !Stop - Stops/Pauses a Download, you can continue a stopped download at any time // !SetDownload - Set an alternative download link for a Blocklist // !ResetDownload - Set the bot to use the default download location for a Blocklist // !Tor On - Sets the script to download TOR IP's manually (Default is on) // !Tor Off - Stops the script from automatically updating its TOR node list // !PG On - Sets the script to download its PG2 Lists (Default is on) // !PG Off - Stops the script from automatically updating its PG2 List // !Silent On - Hide certain messages from Opmsg. Only when downloads complete and users are banned do you get a message (Default is On) // !Silent Off - Unhide all messages, receive everything as normal in Opmsg // !Livecheck On - Check the IP's of your visitors against a definition file for Proxies (Default is On) // !Livecheck Off - Turn off the Live Check feature completely. (Saves bandwidth but significantly lowers Proxy Detection capability) // // Dev commands: // !SetLine - Tell the bot at which line it should begin downloading from // ////////////// _BOT_SELF_TRIGGER_ * ®ÊN Pri * !setdownload %PARAM% !resetdownload // Check if the command was typed at the start of a sentence, if not break %TRIGGER% /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#You have set an alternative blocklist to be downloaded from: #c1#%PARAM% %PARAM% !stop // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Push 0 to Prox_DL_Status, if a Download is happening it will notice the variable change and stop/pause the download 0 !setline %PARAM% // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Check that a download is already in progress, if it isnt tell the user they must first begin a download %PARAM% %PARAM% !download !download // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Check if this is the correct Metis, if it isn't alert the user /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#You are not running version 2.80 of Metis, Please download that version here#c63#: #c1#http://www.mxpulse.com/metis/Metis.r2x // Clear Output Message Variables // Check if this script is the latest version and display an update message if it isn't /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#%USERVAR[Version_Release_Message]% // Check that a download is not already in progress, if it is, block and alert Admins /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#You cannot start a download as one is already in progress // Check if a previous install in C:\Proxy exsists, if it does move the users settings then tell the user they can erase the old folder cmd.exe /c MD C:\Pri.Script.Dependencies\Proxy.Blocker // Load in Settings // Let the admins know the previous folder can be erased /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Your previous install of Proxy Blocker was copied to #c62#C:\Pri.Script.Dependencies\Proxy.Blocker /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#You can safely erase #c62#C:\proxy // Save Settings %USERVAR[Setting_01]% %USERVAR[Setting_02]% %USERVAR[Setting_03]% %USERVAR[Setting_04]% %USERVAR[Setting_05]% // Check that the scripts folder and settings file has been setup. If it hasn't do it. cmd.exe /c MD C:\Pri.Script.Dependencies\Proxy.Blocker 1 // Check if the user has blocked this from happening 1 1 /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Downloading of the PG2 Blocklist has been turned off, the script will now skip to the direct TOR update // Read in a file from the folder that holds a previous download count, incase the bot crashed mid-download (This will save having to start from 0) // Set the Prox status for other parts of the code to reference 1 /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Updating Database by Downloading the latest Blocklist /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Continuing update from last known position #c63#(#c62#%USERVAR[Prox_Previous_Download]%#c63#) // If this is a continuation of a previous TOR update then skip past the Peer Guardian Blocklist update and go straight to the TOR one // Tell the user how they can stop/pause the download /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9##c9#To pause the download type #c1#!Stop #c9#You may continue it later by typing #c1#!Download // Push the default download location http://private.proxy.mxpulse.com/Auto_Update_Blocklist.p2p // Read in the specified cache size from mxpulse for this list. If no number is present default to 200K // Check that the list on the site is different to the list last downloaded, if its the same then cancel the current download 1 200000 // Check for a possible alternative download link and alert the user if one is found that it will be used %USERVAR[Prox_Alternative_List]% 1 // Set the script up for a new download 0 0 // Remove the PGB- from the variable so just the count remains // Start downloading PG2 compatible blocklist %USERVAR[Prox_Previous_Download]% /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Blocklist Download stopped @ #c1#%USERVAR[Prox_DL_Count]% #c9#You may continue it by typing #c1#!Download PGB-%USERVAR[Prox_DL_Count]% // Read in a line from the PG2 list and filter it for saving in the Scripts folder for later retrieval Empty Empty %USERVAR[Prox_DL_Count]%. // Announce to the user the status of the download if it is at 10, 500 or increments of 1000 (Just so they know its actually doing something) /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting... #c63#(#c62#Next Notice at 500#c63#) /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting...#c63#(#c62#Next Notice at 1000#c63#) /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting... #c63#(#c62#Next Notice in 1000#c63#) // Save 1 line from the PG2 list to the scripts folder %USERVAR[Prox_loc_0002]% // Push the current line to a file incase the bot crashes %USERVAR[Prox_DL_Count]% // If the piece of data it read in from the PG2 list wasnt blank then go back 23 lines of code to read in another piece of information, rinse and repeat until every line with data in it is downloaded and processed // If the script has reached this line then it has read through all the contents of the PG2 blocklist, announce that the download completed and tell the user how many IP's belonging to Proxy Servers are now being blocked 1 Proxy Blocklist Last Updated: %DATE%\nIP's Blocked: %USERVAR[Prox_DL_Count]%\nLast Update Instigated by: %NAME% 0 0 0 // Push the old Cache Size so a repeat download of the same sized list cannot occur %USERVAR[Prox_cache_size]% // Download the latest definition file for the Live Proxy Checker 0 // Set the definition update URL http://private.proxy.mxpulse.com/Live.Proxy.Check.Definition.File.ini // Setup a cache to hold lines 1 to 300 (Definition file should be below 100) // Start reading through the file for the definition entries %USERVAR[Definition_input]%\n %USERVAR[Definition_input]%\n 1 // Check if the user wishes to use TOR to download IP's manually (Default = Yes) /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#TOR Direct Updating is off. To turn it on type #c1#!Tor On 0 /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Updating Database from The Onion Network Directly. Please wait... // Set the Counter to line 3 and set the Download Status to 1 1 3 // Remove the TOR- from the variable so just the count remains %USERVAR[Prox_Previous_Download]% // Set the TOR Abuse Exit Node URL http://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=109.198.121.101 // Setup a cache to hold lines 1 to 2000 (The Exit list is normally under 800. 2000 is just a precaution) // Start reading through the file for the IP's The Onion Router Proxy // Check if the user has typed !Stop, if they have then save this count for resuming later /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#TOR Download stopped @ #c1#%USERVAR[Tor_DL_Count]% #c9#You may continue it by typing #c1#!Download TOR-%USERVAR[Tor_DL_Count]% // Push the current line to a file incase the bot crashes %USERVAR[Tor_DL_Count]% // Cycle Back 6 lines to download the next IP to block 1 0 0 Proxy Blocklist Last Updated: %DATE%\nIP's Blocked: %USERVAR[Tor_DL_Count]%\nLast Update Instigated by: %NAME% // Formulate the completion messages for the admins to view %USERVAR[Output_MSG_06]% #c1#Blocklist #c63#(#c62#%USERVAR[Prox_DL_Count]%#c63#) %USERVAR[Output_MSG_06]% #c1#Definitions #c63#(#c62#%USERVAR[Definition_DL_Count]%#c63#) %USERVAR[Output_MSG_06]% #c1#TOR #c63#(#c62#%USERVAR[Tor_DL_Count]%#c63#) // Output what completed to the room on 1 line /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#Download[s] Complete#c63#:#c1#%USERVAR[Output_MSG_06]% // Remove DL Counts // Download the Whitelist (Basically, any IP on this list will be removed from the Blocking Database) 0 // Set the Whitelist update URL http://private.proxy.mxpulse.com/Whitelist.ini // Setup a cache to hold lines 1 to 30000 // Start reading through the file for the Whitelist entries !tor off !tor on // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 0 1 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#TOR Automatic Updater#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is Off the Bot will Not automatically download a list of TOR Exit Nodes #c63#(#c1#Proxy Servers#c63#) /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#TOR Automatic Updater#c63#"#c9# has been turned #c4#ON /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is On the Bot will automatically download a list of TOR Exit Nodes #c63#(#c1#Proxy Servers#c63#) !silent off !silent on // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 1 0 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Proxy Blocker Silent Mode#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is Off the Bot will show all alerts in Opmsg as normal /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Proxy Blocker Silent Mode#c63#"#c9# has been turned #c4#ON /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is On the Bot will not show any alerts in opmsg, except when a proxy user is banned and when downloads complete !PG off !PG on // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 0 1 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Peer Guardian 2 Updater#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is Off the Bot will Not download the Peer Guardian 2 Blocklist file /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Peer Guardian 2 Updater#c63#"#c9# has been turned #c4#ON /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is On the Bot will download the Peer Guardian 2 Blocklist file !livecheck off !livecheck on // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 0 1 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Live Proxy Checking#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is Off the Bot will not perform any live checks /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#The #c63#"#c1#Live Proxy Checking#c63#"#c9# has been turned #c4#ON /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c62#When this Setting is On the Bot will make a query to search engines to determine if users are using a Proxy as they enter your room. // Clear variable "Private_IP_Detected" for a clean run // Break if the IP is private (127.0.0.1, 192.168.x.x, 10.0.x.x and so on) :%IP% 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 // Create a Whitelist File if one doesn't exsist and tell the admins how to use it /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#A Whitelist file has been created here#c63#: #c62#C:\Pri.Script.Dependencies\Proxy.Blocker\.Whitelist.ini /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#You may fill this file with Proxy IP's or Usernames of the people you trust to use Proxy Servers You can place Proxy Server IP's OR Usernames in this file, one entry per line, unlimited size, Please do not delete this line explaining how to use the file!\n // Reference the Whitelist file incase this user has been given permission to use a Proxy Server in this room // The whitelist checks for both a designated Proxy Server IP Address and the users Username from this file 0 0 1 1 // Check if this users IP is present in the current Blocklist, if found Kickban for 60 minutes and alert admins /kickban %IP% 60 /kickban %IP% /kickban %RAWNAME% /opmsg #c10#%NAME% #c9#is using a Proxy and has had their IP banned for 60 Minutes. #c63#(#c62#%USERVAR[Prox_Check]%#c63#) // If this user was detected as using a proxy, send the IP, Username and Room Name to MXPulse (Analytical data for Pri) /opmsg #c10#%NAME% #c9#is using a Proxy but has premission and won't be kicked. #c63#(#c62#%USERVAR[Prox_Check]%#c63#) // Check that the Live Proxy Checking is Activated (Default is on) // Check the Cache Proxy Detected in the Cache // Process the Query if the Cache wasn't populated within the last month // Reference the previously downloaded definition file 0 // Create a cache for this IP so that we don't query it again atleast within a month %MONTH%\n1\nThis is a Proxy, Detected by Live Proxy Checker %MONTH%\n0\nNot detected as a Proxy // If a match was found, Kick/Ban and alert admins to this users Proxy use /kickban %IP% 60 /kickban %IP% /kickban %RAWNAME% /opmsg #c10#%NAME% #c9#is using a Proxy and has had their IP banned for 60 Minutes. #c63#(#c62#Live Proxy Checker#c63#) // If this user was detected as using a proxy, send the IP, Username and Room Name to MXPulse (Analytical data for Pri) /opmsg #c10#%NAME% #c9#is using a Proxy but has premission and won't be kicked. #c63#(#c62#Live Proxy Checker#c63#) // If a download is happening right now then skip all this stuff below // Check if a download of the Blocklist has been performed today /opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.7b#c63#): #c9#An update has not yet been performed today so one will now be attempted automatically. !download ////////////// // // Output_MSG_xx Key for Developers, If any of these Varibles are True (1): // Output_MSG_01 = Already have latest Blocklist, Skipping to TOR Update // Output_MSG_02 = Alternative Blocklist has been set. It will now be downloaded instead of the default one // Output_MSG_03 = Downloading of the Proxy List Completed Successfully and downloaded: %USERVAR[Prox_DL_Count]% This Many IP's // Output_MSG_04 = Definition File Downloaded Successfully and downloaded: %USERVAR[Definition_DL_Count]% This many Definitions // Output_MSG_05 = TOR Updated Successfully and downloaded: %USERVAR[Tor_DL_Count]% This many IP's // Output_MSG_06 = This variable includes any/all of the above for the final output in to the Room // //////////////