用檔案傳參數

這次的安全程式作業是要破解一個含有buffer overflow的程式
但其實一開始的困難點是程式的輸入方式
之前做過的buffer overflow都是std input
也就是從鍵盤輸入 因此可以用 "<" 去做到檔案的導入
ex: ./hackme < exp.in
但程式如果從argc輸入又要該怎麼辦呢
ex: ./hackme arg1 arg2 arg3
要怎麼餵他吃檔案呢???
這時後拿出Linux的書啃了一下bash篇
看到了神一般的符號"$"
“執行程式當成變數”
於是我腦海中就浮現了他




















我們把它放入我們的程式看看
ex: ./haceme $(cat exp.in)
It's work!

留言

  1. Just use our link above, and goes to be|will most likely be} automatically triggered, ready, and ready for you in your account. Now your account is validated, ready to|you'll find a way to} make a deposit using any of 바카라사이트 the fee strategies out there in your jurisdiction. Be aware, some fee strategies will be excluded from sure bonuses. Spin Casino opened in 2001 and has been rising in recognition ever since. It is licensed by the Kahnawake Gaming Commission and the Malta Gaming Authority internationally, each of which oversee a fair and safe on-line setting for players. It’s truthful to say that we’re experts within the subject of on-line casinos.

    回覆刪除

張貼留言