Jump to content
xisto Community
netc0n

Javascript SSI- Blocking Internet Protocols Blocking Internet Protocals from site

Recommended Posts

Hello, i thought this would be interesting since i haven't discussed Javascript in years. SSI(Server Side Includes) can be used for many interesting things...many of which deal with connection information and such.

A few years ago i was working on something for the Counter-Strike Blacklist when it existed. It was a project i was making for a site called CS anti-hack Community. This was going to be an all web-based security project to basically not allow any IP currently on the blacklist to preceed to any site that wanted to be a part the anti-hack community. Well i was pretty much finished with the basis of it and i had it up and running..but soon after CS Blacklist went inactive and was no longer in use. But I will show an example of what i used to block certain specified IPs from a web page. Yes this is my code but its not like i invented the stuff...so i share with you :D

 

1First we must start with the basic Javascript script beginning ::

 

<script LANGUAGE="JavaScript"><--AHM Guard BY AHMC--><--Begin

2We begin the script with the variable which is the Remote Address of the the computer that visits the page, then using 'IF' to apply that if the following addresses visit the page that the trigger will be activated :B)*note that these IP addresses are examples but actually were on the blacklist*)

 

function ban(){var ip = '<!--#echo var="REMOTE_ADDR"-->';if (ip == "210.201.133.34" || ip == "80.32.11.34") {

3now comes the command that will happen if the address is on the ban list::

 

alert("!!!!!!!!!!!!!!!!!!!!!!!!Warning!!!!!!!!!!!!!!!!!!!!!!!!!\nYour ip address \("+ip+"\) Is on the CS BlackList");history.go(-1);window.location.replace("http://forums.xisto.com/no_longer_exists/;

Obviously these gives an alert window and redirects you to the Old CS blacklist site.

And now right after that script you can enter in another that will be the outcome if the remote address is not on the list::

 

<script LANGUAGE="JavaScript"><--Part of AHM Guard--><--Beginvar ip = '<!--#echo var="REMOTE_ADDR"-->';alert("IP Was Scanned Clean\n	   " +ip);End--//></script>

Well, maybe someone will find that useful....SSI with javascript can be fun to fool around with and get ideas from. ;)

 

Thanks,

netc0n

 

Notice from twitch:
In the future, can you place all script/code related examples into the [ code ] tags. It helps differentiate between content and example.

Share this post


Link to post
Share on other sites

Could this be done in php? Because all the blacklisted person has to do is to turn off javascript. I have seen it in php but have not found a practicle use for it. To bad the Cs blacklit don't exist because now adays we need it! There are so many hackers and script kiddies out there who need to be tought a leason about not hacking :unsure:

Share this post


Link to post
Share on other sites

Although, Javascript is not server side includes. This is an interesting idea, and could easily be implemented in various languages. However, it fails in many cases precisely because Javascript is handled on the Client Side, and is not a Server Side include. To simply leave this as javascript, you could instead make the javascript page point either ahead to the next page assuming the ip passed, or back. Then if javascrpt were disabled, the user would see a blank page, or a page asking them to enable javascript.~Viz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.