Redirect on certain URLs - windows

Hi I have a problem where I'm setting up an internet Kiosk in a public place and when a user goes to a certain URL I want it to redirect to another particular URL.
For example I want it setup so that if a user goes to www.example.com/step1 I want the browser to automatically go to www.example.com/step2
The only restriction here is that it has to work on Windows due to hardware limitations.
Does anybody know how I could do this?
Thanks

A couple of ways to do it:
Implement a Browser Helper Object, catch the BeforeNavigate event, cancel the navigation and direct it somewhere else.
Use a specialized proxy server that responds to a request for the first URL by returning a redirect to the second, and passes all other requests through.

You could try to modify the Hosts file. In Windows, I think it is found in WINDOWS/system32/drivers/.
It can be used to redirect a request for one IP address to another.
Hope that's useful.

Related

How to Trace Ajax Call Back or Debug Ajax Requests in Chrome or any other Good and Famous Browser

I'm doing a project which ,obviously, uses Ajax to handle lots of requests from User Interface. Once of which is to "Filter" the given list of users. I'm using it with Laravel at back end.
So the scenario is that when I filter users by their company it works perfectly, but when I filter users by locations, it shows all the users from all locations instead of chosen location which means all the location ids are being passed. Code is written by some one else. I don't know where to fix it. So I want to know that Chrome supports some good tools to handle and debug Ajax request but don't know how to do that. Can some one plz suggest me the right way to handle, debug and explore the call backs of Aajx request so I could also save my time????????????
You can use the google chrome devTools console and go to the Network menu. It works great.
If you want more you can use Charles

ASP.NET MVC 3 Redirect/route URL back to subdomain

I have a site on a subdomain (www.website.com/foobar) which pulls the default page view. Due to the nature of MVC apps, this default page view can also be reached through the "controller/action" URL of the default content (www.website.com/foobar/{controller}) and (www.website.com/foobar/{controller}/{action}).
For the sake of analytics and tracking, I would like any of these other URLs, besides the original short (www.website.com/foobar), to redirect back to this shorter URL.
So...
www.website.com/foobar/{controller}, when typed in, or clicked on in a bookmarked link, should redirect to www.website.com/foobar
I've tried playing around with the routing, but couldn't get anything to actually change the URL itself. I'm not sure if it's possible to change through mapping.
Edit: Has anyone used the HTTP Redirect within IIS7? I can redirect from the top tier, but cannot seem to get the redirect to work on any of the Views.
I don't think you can use routing alone to redirect up a domain. I had a similar issue and after a few days of searching and asking around, I ended up using Redirect itself to get over the issue. Hope this helps.
I was able to solve the problem in IIS 7 by using the HTTP Redirect module. Because it's an MVC application it was a little trickier to setup a redirect on a view, but it's possible. I used this tutorial: Creating a redirect in IIS7
Edit: While the above solution works, it tended to be unpredictable. I ended up solving it by reading the URL the user was inputting in the Index action of the Quote controller, and then redirecting if keywords I was looking for were in the URL. Just a simple if statement at the beginning of the Index action.

Is there any reason to Filter POST actions?

I have a custom [AuthenticationFilter] which simply redirects users that are not authorized to access administrative content.
I apply the filter to
[AuthenticationFilter]
public ActionResult Index() {}
But, I also have
[HttpPost]
public ActionResult Index(HttpPostedFileBase file) {}
for handling file uploads. Do I need the attribute here?
My gut instinct tells me no. There's no way to POST a file to the page because uploadButton is blocked from loading by the first method.
The only other security concern I can imagine is a cross site AJAX post, but this shouldn't be possible or at least is highly unlikely because its an intranet site.
So, is there any reason to apply [AuthenticationFilter] to the file handler?
You can never count on your client-side control (disabling the upload button) from stopping something from hitting your server. End users have complete control over what happens on the client. They can enable controls, remove or modify hidden fields, intercept browser requests, or bypass the browser completely and make their own requests (with any file they want).
Any place that you have the option to add security on the server you should do it. There is no type of request you can stop by simply using browser controls.
I believe it would still be possible for someone to send a POST using something like Fiddler. The effort to secure the method is minimal, so I would say better to be safe than sorry.
I'd turn the question around and ask if there are reasons not to apply the AuthenticationFilter to the method? As long as you know that there may be a risk for this method, why not apply the filter; unless you have performance issues with your AuthenticationFilter, go for it. In fact, if you know your whole controller is destined to be used by authorized users, apply the filter at the controller level!

To bypass referral check

Is there any way to bypass the referral check applied by some site in order to avoid there data from being extracted. Like if you follow this link!
You will get Access Denied Error. However , if you just go this link!, it takes you to home page and on filling on any quote say ABAN , it follows exactly the same GET request as the link used above.
Can anyone please suggest me some solution ??
Set your referrer to the correct value. You can spoof the value to anything you want programatically or by visiting the correct url before visiting the target url.
You can use a tool like wget which allows you to set your own referer value. This won't work on sites which expect more than that as their protection value (and anyone interested in protecting the delivery of their content might also look for a cookie or ip address as well).

a script to log into webpage

I want to write a script to log in and interact with a web page, and a bit at a loss as to where to start. I can probably figure out the html parsing, but how do I handle the login part? I was planning on using bash, since that is what I know best, but am open to any other suggestions. I'm just looking for some reference materials or links to help me get started. I'm not really sure if the password is then stored in a cookie or whatnot, so how do I assess the situation as well?
Thanks,
Dan
Take a look a cURL, which is generally available in a Linux/Unix environment, and which lets you script a call to a web page, including POST parameters (say a username and password), and lets you manage the cookie store, so that a subsequent call (to get a different page within the site) can use the same cookie (so your login will persist across calls).
I did something like that at work some time ago, I had to login in a page and post the same data over and over...
Take a look at here. I used wget because I did not get it working with curl.
Search this site for screen scraping. It can get hairy since you will need to deal with cookies, javascript and hidden fields (viewstate!). Usually you will need to scrape the login page to get the hidden fields and then post to the login page. Have fun :D

Resources