EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First New
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom

Knowledge Bank

Discussion Forums
Enigma Chat New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Enigma Zine
Downloads
Tools New

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Hakipedia: An open collaborative for all your information security needs.

The Urinal

Click Here To Vote For EG!

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site.

enigma group

enigma group

enigma group

enigma group

Enigma Group's Articles


Javascript Injection - Submitted By: champloo 2008-08-19 11:48:48
Javascript Injections
 
These three things i will try to explain to you: Injection Basics, Cookie and Form Editing.
In these articles i will teach you only the super basics of javascript and for all those who want to learn more, google advanced
 
javascript injections Smiley
 
 
Basics
 
All you need for injecting this very useful stuff, is URL.
When you use them, delete the whole url bar, even http:// - leave your bar totally empty, and then...onto the injecting.
 
First thing your have to type is '' javascript: '' (without '' '')
That means we are using, guess what, javascript???
There are 2 main commands that you will use (sometimes even one) - they are: alert(); and void();
 
Now that we know something about this, we are going to make a simple task.
Go to any site and try to make a window appear saying: I got it
 
Try to do it on your own, and if you cant write it, look here:
javascript:alert('I got it');
 
 
Cookies (yummy)
 
If you are not familiar with the term ''cookie'' please google it because i dont want to explain it now.
So, after you found out what cookies are, we will learn how to view them.
We will check them with a simple script like this:
javascript:alert(document.cookie);
Now, you will see a pop-up window displaying information on your cookies.
 
For editing, we have to use that void(); command
javascript:void(document.cookie="Field=Value");
This script can change the existing info or create a new value.
Replace ''Field'' with an existing field or create a new values. Then replace ''Value'' with whatever you want.
This is a very popular script:
javascript:void(document.cookie="Authorized=yes");alert(document.cookie);
This alert(document.cookie); at the end will show you the effect of this script.
 
 
Forms
 
To edit the values, you can sometimes edit the downloaded html and submit whatever you want.
Then, the form comes up.
Every form is stored like this: forms
X is the number which starts with 0 and goes on by order (1,2,3,...)
The most common situation will be that x is 0 so,.... forms[0]
 
I saw a challenge on HTS requiring to combine e-mail and javascript.
You cant download the script but you can check to see what value a certain form element has by using this script:
javascript:alert(document.forms[0].to.value)
 
So, heres the example:
javascript:void(document.forms[0].to.value=''your email");alert(document.forms[0].to.value);
Again, just like the alert(document.cookie); at the end will show you the effect.
 
Another example goes like this:
javascript:void(document.forms[0].dir.value="logFiles");alert(document.forms[0].dir.value)
Try to figure it out Wink
 
~This article was originally written by Sauron.

Return to Web Hacking category list

 

Who's Online

483 Guests, 101 Users
ckryptix, Ios, viper0i0, Diznablo, rabbidmind, asapong, Nasrudin, CollapsingWalls, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo