Recommended: The ultimate faux-fake of ASP backdoor I remember the Trojan horse that claimed to have never been killed when the asp Trojan came out. Haha, to this day, any antivirus software can kill it without leaving any armor^_^ Haha, due to the idea of changing the Trojan shell to avoid antivirus software, we can also give the Trojan horse a try.
Users often encounter some annoying information when visiting a site, such as they often somehow arrive at the next page without actually submitting data to the form, or often reach a page, which is transferred in the form of a query string, such as?ID=236454.
If the page does not get information, a big error will occur. This often happens when the page is looking for ID or some other information, and the user connects to the page using a bookmark or search engine. Therefore, the information required by the page is lost and the page ends.
You can check to see if data is submitted, so as to control the occurrence of this situation, then display specific error messages based on the situation, or perform other actions, such as redirecting to the desired page.
In the following 3 examples, only one message is displayed on the screen.
Place this code directly under <% @ LANGUAGE=VBSCRIPT %>.
For a form, use the POST method
| The following is the quoted content: < % If Request.Form = Then Response.Write(< p align=center >< font face=Arial >There Was An Error.< br > & vbCrLf) Response.Write(No Data Was Posted.< /font > & vbCrLf) Response.End End If % > |
For a form, use the PUT and GET methods. The same applies to pages connected with query strings, such as ?ID=236454
| The following is the quoted content: < % If Request.Querystring = Then Response.Write(< p align=center >< font face=Arial >There Was An Error.< br > & vbCrLf) Response.Write(No Data Was Posted.< /font > & vbCrLf) Response.End End If % > |
In order to summarize the situation in the above example, the following work must be done. Although there are simple methods, this example will be a good way to learn basic principles for beginners.
| The following is the quoted content: < % IsData = 0 If Request.Form < > Then IsData = IsData 1 If Request.Querystring < > Then IsData = IsData 1 If IsData = 0 Then Response.Write(< p align=center >< font face=Arial >There Was An Error.< br > & vbCrLf) Response.Write(No Data Was Posted.< /font > & vbCrLf) Response.End End If % > |
or
| The following is the quoted content: < % IsData = No If Request.Form < > Then IsData = Yes If Request.Querystring < > Then IsData = Yes If IsData = No Then Response.Write(< p align=center >< font face=Arial >There Was An Error.< br > & vbCrLf) Response.Write(No Data Was Posted.< /font > & vbCrLf) Response.End End If %> |
Share: How to block IP with ASP to prevent fixed IP spam messages The following is the referenced content: <%Dim IP,IPString,VisitIP'The IP address to be prohibited IPString=|195.225.177.34|195.225.177.137|72.232.250.10|&qu