Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Javascript SSI- Blocking Internet Protocols, Blocking Internet Protocals from site
netc0n
post Feb 20 2006, 04:07 AM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 5
Joined: 6-February 06
Member No.: 11,120



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 wink.gif

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

CODE
<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 :sad.gif*note that these IP addresses are examples but actually were on the blacklist*)

CODE
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::

CODE
alert("!!!!!!!!!!!!!!!!!!!!!!!!Warning!!!!!!!!!!!!!!!!!!!!!!!!!\nYour ip address \("+ip+"\) Is on the CS BlackList");
history.go(-1);
window.location.replace("http://www.csblacklist.com/")
}
}
ban();
End--//>
</script>


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

CODE
<script LANGUAGE="JavaScript">
<--Part of AHM Guard-->
<--Begin

var 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. biggrin.gif

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.
Go to the top of the page
 
+Quote Post
warallthetm
post Jul 9 2006, 05:37 PM
Post #2


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 27
Joined: 9-July 06
Member No.: 14,399



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 smile.gif
Go to the top of the page
 
+Quote Post
vizskywalker
post Oct 1 2006, 01:02 AM
Post #3


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Is Their A Free Or Express Program To Help Make Javascript, Or How Do I Do It.(0)
  2. Javascript Tutorial For Beginner(0)
  3. Javascript Operators(0)
  4. Conditional Statements Of Javascript(1)


 



- Lo-Fi Version Time is now: 11th October 2008 - 03:40 AM