New User? Need help? Click here to register for free! Registering removes the advertisements.

Computer Cops
image image image image image image image image
Donations
If you found this site helpful, please donate to help keep it online
Don't want to use PayPal? Try our physical address
image
Prime Choice
· Head Lines
· Advisories (All)
· Dnld of the Week!
· CCSP News Ltrs
· Find a Cure!

· Ian T's (AR 23)
· Marcia's (CO8)
· Bill G's (CO11)
· Paul's (AR 5)
· Robin's (AR 2)

· Ian T's Archive
· Marcia's Archive
· Bill G's Archive
· Paul's Archive
· Robin's Archive
image
Security Central
· Home
· Wireless
· Bookmarks
· CLSID
· Columbia
· Community
· Downloads
· Encyclopedia
· Feedback (send)
· Forums
· Gallery
· Giveaways
· HijackThis
· Journal
· Members List
· My Downloads
· PremChat
· Premium
· Private Messages
· Proxomitron
· Quizz
· RegChat
· Reviews
· Google Search
· Sections
· Software
· Statistics
· Stories Archive
· Submit News
· Surveys
· Top
· Topics
· Web Links
· Your Account
image
CCSP Toolkit
· Email Virus Scan
· UDP Port Scanner
· TCP Port Scanner
· Trojan TCP Scan
· Reveal Your IP
· Algorithms
· Whois
· nmap port scanner
· IPs Banned [?]
image
Survey
How much can you give to keep Computer Cops online?

$10 up to $25 per year?
$25 up to $50 per year?
$10 up to $25 per month?
$25 up to $50 per month?
More than $50 per year?
More than $50 per month?
One time only?
Other (please comment)



Results
Polls

Votes: 1019
Comments: 21
image
Translate
English German French
Italian Portuguese Spanish
Chinese Greek Russian
image
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 

Show HTML Re-directs

 
Post new topic   Reply to topic       Computer Cops Forum Index -> Proxo Filters
View previous topic :: View next topic  
Author Message
z12

Sergeant
Sergeant



Joined: Jul 17, 2002
Posts: 130
Location: USA

PostPosted: Thu Jun 10, 2004 9:33 pm    Post subject: Show HTML Re-directs
Reply with quote

Hi all,

Here's a filter that lets you know when your being redirected to another site. I wrote this because I got tired of being redirected, especially while doing searches, to sites that I would otherwise not visit. This filter allows me to view a link to the location that I'm being redirected to so I can choose if I want to go there or not.

The filter works by checking the "Location" & "Content-Type" headers when a 302 response (actually 30*) is received. If the Location is not related to the Host & the Content-Type is html, the "Location" header is changed to point to a html file that I added to proxo's html directory. This html file uses javascript to write a link to the web site that you were being redirected to. Click the link & your on your way, otherwise, use the browsers back button.

Here's the header filter:
Code:

In = TRUE
Out = FALSE
Key = "Location: Show HTML Redirects (in)"
Match = "\1$IHDR(Content-Type: text/html)$RESP(30*)&\w://(^\h)"
Replace = "http://local.ptron/redir.html?dest=\1"


Here's the HTML (save as redir.html & put in proxo's html folder:
Code:

<html>
<head>
<title>Page Re-Direction!</title>
</head>
<body>

<h1>You are being re-directed to the following site:</h1>

<script type="text/javascript" >
var d, i;
d = String(window.location);
i = d.search(/[=]/)+1;
d = d.substr(i);
document.write('<a href="'+d+'" >'+d+'</a>');
</script>

</body>
</html>


This was tested using firefox & google.

I have noticed that many redirects are missing the Content-Type header, or have the wrong mime-type. In my config, I added header filters to "fix" this, you may find that you'll have to do the same.

Comments welcome,
Mike

Edit: removed space from redir.html script tag, doh


Last edited by z12 on Mon Jun 14, 2004 10:42 pm, edited 1 time in total
Back to top
View users profile Send private message
Paul

Admin
Admin



Joined: Feb 22, 2002
Posts: 5599
Location: USA

PostPosted: Thu Jun 10, 2004 9:43 pm    Post subject:
Reply with quote

Nice!
_________________
I love my wife.
Back to top
View users profile Send private message Send email Visit posters website
z12

Sergeant
Sergeant



Joined: Jul 17, 2002
Posts: 130
Location: USA

PostPosted: Fri Jun 11, 2004 7:48 am    Post subject:
Reply with quote

Thanks!

Mike
Back to top
View users profile Send private message
k027

1st Responder
1st Responder



Joined: Aug 25, 2003
Posts: 1204
Location: USA

PostPosted: Mon Jun 14, 2004 12:59 pm    Post subject:
Reply with quote

Handy little filter. Thanx for sharing! Very Happy
Back to top
View users profile Send private message
ProxFox

Sergeant
Sergeant



Joined: Nov 11, 2003
Posts: 105
Location: USA

PostPosted: Mon Jun 14, 2004 2:22 pm    Post subject: is it me...
Reply with quote

It's blocking redirects - but it's not showing anything at all after the "following site:"... It's blank...
Back to top
View users profile Send private message
z12

Sergeant
Sergeant



Joined: Jul 17, 2002
Posts: 130
Location: USA

PostPosted: Mon Jun 14, 2004 10:27 pm    Post subject:
Reply with quote

Hi ProxFox,

Ok, I just tried this with IE, redir.html opened in a new window, but the link was missing. Must be some code IE doesn't like. I'll see if I can modify the script to work with both of them.

Mike

Fixed, I edited the original post. Thanks for reporting it!
Back to top
View users profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       Computer Cops Forum Index -> Proxo Filters All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.8a © 2001 phpBB Group

Version 2.0.6 of PHP-Nuke Port by Tom Nitzschner © 2002 www.toms-home.com
Version 2.2 by Paul Laudanski © 2003-2004 Computer Cops