Friday, November 19, 2010

How can you make an html link that executes a javascript injection?

If it's possible?



You use the ';%26lt;a href=...'; tag in html to link to a website.

You can type into the url bar something like ';javascript:alert('Hello!');'; to do a javascript injection.



How would you make a link in a web page that when you click on it, it does the javascript command?

Effectively %26lt;a href=';javascript...';%26gt;, except that obviously doesn't work.





Thanks!How can you make an html link that executes a javascript injection?
%26lt;a href=';javascript:void(0)'; onClick=';Javascript:alert( 'Hello!' );';%26gt;Text%26lt;/a%26gt;How can you make an html link that executes a javascript injection?
Html is not a server language so you cannot make stuff appear in the URL bar.

Is this the code:

%26lt;a href=';javascript:void(0)'; onClick=';javascript:alert('hi')';%26gt;%26lt;/a%26gt;

Possiblly...

you need to use ' inside the alert instead of ';

No comments:

Post a Comment