picoCTF fomart string 2 writeupposted on : 08/12/2025i first started by noticing the very obvious :
... clearly it's a format string attack - i'd never done this before so it led me down the wonderful path of trying to do it by hand with:
i read more and more about it and got deeper with this wonderful resource here! read it! and quickly realized i was very in over my head with this. it talks about having to use some weird - ass math to get it to properly caluclate everything with the offsets ( 256 + c = v, but if it's over, it;ll roll over the c to v allowing you to write your value) which amde me then go searching. the hint provided is 'use pwntools' so i started to look for format string stuff on pwntools, lo and behold, they have a library. one quick sccript later:
i got my flag! that was agood intro to how format string attacks work, and it's really nice and useful to have this under my belt. |