5

I want to redirect the user to another page to fill out a captcha but i would like to keep the post data, and if the captcha pass to send it 'back' and complete the previous page action.

When/if the user succeeds i like to add an captchaPass=true and would like access the post data and continue processing. Right now i am using redirects but ATM i am not required to use it.

Is it possible to carry the post data? keep in mind i may the user access multiple pages so separating data and not having a mixup is necessary.

One idea is to get and save all posted data [1] on the captcha page, and then recreate a middle white page with this form data and automatically make a new post to the previous page.

Can this work with out any issues with hash checks and security ?

Is there a better idea with out this white redirect page ?

[1] One other issue here, how to send this posted data with the redirect ? and not change the url - or make it too big to accept it. Keep in mine that a server transfer may not good idea because is complicate the thinks on captach post back.

Update 1

The basic idea here is how some one capture the full post back of a page, show a different one page and then send the post back data to the original first one.

The reason is to stop a bad user, or an attacker bot program that try to bring down the pages/server by making many post back from different pages in short time. All that happens with out javascript, and most attackers use custom made programs that just make post of data to all page together try to bring down the system.

For example, if a page have a search box, is very easy for most of the the site to bring them down by start making hundred of random search with wildcard (called and Dos Attacks using SQL wildcards) and make the sql server and the computer spend his time and cpu to search and search thinks. So to prevent an attack like this you need to recognize multiple post backs from the same computer, and then the next step is to redirect him to a captcha page to block him out in case that is a computer program.

Other example, many page have email submit, very easy you can submit hundred times the email of his and full his mail box in no time with hundred of emails, or on a store to place all items on the cart again and again and full the database with stuff like that.

So ajax and javascript is not working in this case, and we need a way to redirect him after the post back to a page that can check if is a real user or an attacker and stop him - but if is a real user must return back to his normal action.

Update 2

This all must be done in a general way, eg on BasePage, or on Global.asax or somewhere that is independed from the content of any page. Because we try to prevent a DoS attack, or multiple submit anywhere on any random place of any random page.

Yes I know how you can place a captcha on the contact page, but this is not what this question was first asked for - this questions asked how can carry post data to one different page, keep them there and then resend them back to the original one.

The obvious solution is to read all post back, and save them on the form, and then read them back and make on fly a form only with that data and make the post back. Here I am asking if there are any other better than this solution.

Other Applications

There is also the case that a user is inside a page that request authentication, but the authentication ticket has expired, and the user make post back. In this case we need to keep somewhere all the posted back data, to proceed with the login page, and resend them back to the first page that request the authentication.

4

4 回答 4

2

当然,只需将表单数据写入隐藏元素中的验证码页面,并在表单中添加额外的验证码字段。让您的提交操作将整个内容发布回原件。使用 ASP.NET,将验证码写入同一页面并隐藏表单字段可能会更容易,但您可以按照我上面的描述进行跨页面回发。

于 2009-07-06T12:48:47.487 回答
1

跨页发布可能会对您有所帮助。

于 2009-07-06T12:49:32.900 回答
1

为什么不使用 AJAX 实现 CAPTCHA?在 div 中加载验证码对象和表单,可能显示灯箱样式,接受用户输入并将其发布到您的服务器以进行验证,因此继续用户发布请求或将其保留在那里直到他们正确(或取消)。

更具体的情况示例:

给表单提交按钮一个 Javascript 函数的 onClientClick 值。此函数决定此特定表单是否需要验证码。如果是这样,它会加载一个用于获取 CAPTCHA 的接口(您需要使用一些服务器端代码)并将 CAPTCHA 的输入元素插入到用户单击提交的表单中。

一旦用户输入 CAPTCHA 输入并单击某个按钮,其单击事件将返回到您的第一个 JS 函数,Javascript 会拦截此操作并发布完整的表单、原始表单中的所有数据和验证码以进行验证。您的服务器脚本现在可以一次处理所有这些!

这是我能想到的最好的解决方案,它的工作方式类似于您的要求,但我无法想象您为什么要在不同的页面上执行 CAPTCHA。

于 2012-03-19T10:57:13.990 回答
0

Server.Transfer和你在一起MultiViews, Panels like control好吗?这样一来,就不用担心Data Maintenanceand了Postbacks。您可以在 javascript 中进行验证。

您可以将这两个功能保留在同一页面中,以避免将数据从一个页面移动到另一个页面/将数据带回原始页面。您可以利用Session此中间操作。将其设置回 Postback 中的关联控件。您可以在此类对象中创建一个classInstantiate它和。Initialize the control values将类对象保存在Session. 在回发时,您可以将值重新分配给associated controls. 这肯定会让事情变得简单而没有太多复杂性。

怀疑?

于 2012-03-23T18:50:39.397 回答