Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

How can i show attacker given HTML or JavaScript Code in URL.
Is this possible to show message what attacker given . i Want avoid Cross Site Scripting on my web Application.

Ex: http://www.abc.com?Products.aspx?id=1 my appilcation URL

Then attacker remove the query string and put a HTML or JavaScript as below mentioned.

Ex: http://www.abc.com/product.aspx?<script>alert('done!')</script>

Now i want to show a message what attacker given HTML or JavaScript.

Please provide me useful information.
Posted
Updated 23-May-14 0:45am
v2
Comments
Ajith K Gatty 23-May-14 6:47am    
Hi, I know this is not the answer you are expecting. But what is the use of script in Url???
Kapuraveni BharathKumar 23-May-14 7:33am    
How could i know site is hacked or attacker posted a HTML or JavaScript code.
it was happend like attacker chaneged any query string to passing sequence values.
then how can i find, how can i secure my application from the hackers.
Provide any useful infromation.


1 solution

Hello Bharath,

Have a look at HtmlUtils class found in DotNetNuke[^]. It contains a method named isHtml(String). You can use this to check whether the passed data contains any html/script tags.

Regards,
 
Share this answer
 
Comments
Kapuraveni BharathKumar 23-May-14 7:44am    
Hello Prasad,

can i show client side error message what an attacker posted HTML or Scripts. IS this possible.please give me any suggestions to show error messages.
Kapuraveni BharathKumar 23-May-14 7:54am    
How can i use as you mentioned isHtml(string) and how can i import namespaces

using DotNetNuke.Entities.Portals;
using DotNetNuke.Services.Upgrade;
using System.Collections.Generic;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900