Sunday 10 November 2013

Don't forget to return! Scripting challenge.

I found this quite an amusing scripting challenge. If you get stuck feel free to ask for a hint. If you post your answer I will post mine! (Don't go OTT! If you are above 100 lines ye gone too farr)




And i'm not talking about guessing EVERY combination here..

[adam@localhost code]$ time ./strcmp_bruter.py
made it.
Tell me and I forget, teach me and I may remember, involve me and I learn.

real    0m0.111s
user    0m0.043s
sys    0m0.050s
[adam@localhost code]$

3 comments:

  1. Adam,

    I'm interested in this as I like a good challenge but I'm not sure which way to go with this. I compiled this in c but it would not compile in c++ due to the return on line #16. Obviously that is part of the problem. I played with nm, objdump, and a few other stabs at this. My wrapper was written in python but I was unsure if I should load up ctypes and attack the problem from that angle. I do know that `strings` was effective at peeking into the compiled program but it was obviously not the intended way to solve this.

    Any hints or pointers would be appreciated.

    ReplyDelete
    Replies
    1. Hint:

      http://pastebin.com/raw.php?i=khXhYHhX

      You don't need any reversing tools for this, just a program wrapper!

      p.s. If you just get 0 back, then It could be your (os|kernel|gcc).

      p.p.s better hint http://pastebin.com/raw.php?i=wJSR1ZPL

      Delete
    2. Adam,

      Success! Right around 20 lines of code.

      ./challenge.py
      made it.
      Tell me and I forget, teach me and I may remember, involve me and I learn.

      Please continue the blog as I have enjoyed them.

      Delete