Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I found this encoding as a XSS example to bypass certain filters.

Been trying to look some information (plus encoder/decoder tool) about this type of encoding but was pretty difficult without knowing it's name:

xCpl \x3d 1 \x2f \x281 - xBeta \x2a xP\x29\x3b\x0avar xDens \x3d xStdDens \x2a xCtl \x2a xCpl \x2f
share|improve this question

closed as off-topic by Terry Chia, Xander, Gilles, Adnan, AJ Henderson Aug 8 '13 at 15:17

  • This question does not appear to be about Information security within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
It looks like a printer control language. \x appears to indicate a 2 digit hex encoded byte follows. It does not appear to be PCL or ESC/P, however. –  John Deters Aug 8 '13 at 4:43
2  
This question appears to be off-topic because it is not about security. Also, there is not enough information: where did you find that text? If you explain the context where you found that text, your may be able to get help on Reverse Engineering. –  Gilles Aug 8 '13 at 8:12
3  
Then again, after resolving the hexadecimal escapes, this is xCpl = 1 / (1 - xBeta * xP); var xDens = xStdDens * xCtl * xCpl /. So it's presumably a bit of very lightly obfuscated JavaScript. –  Gilles Aug 8 '13 at 8:15
    
I found this as a XSS example. It's supposed to be encoded JavaScript to pass certain filters. –  jviotti Aug 8 '13 at 12:15

1 Answer 1

up vote 0 down vote accepted

the \x is indicating that there is going to be an ascii character encoded in hexidecimal.

xCpl \x3d 1

\x3d => '='

You can use a site like this to decode it individually: http://www.dolcevie.com/js/converter.html

Or, for this example, just put this in a js console:

console.log('xCpl \x3d 1 \x2f \x281 - xBeta \x2a xP\x29\x3b\x0avar xDens \x3d xStdDens \x2a xCtl \x2a xCpl \x2f')

and you'll get:

xCpl = 1 / (1 - xBeta * xP);
var xDens = xStdDens * xCtl * xCpl /

It may be used for xss so that it can hide characters that a particularly weak filter wouldn't catch.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.