
Right So,
I suppose I’ll just crack on with this,then.


Screenshot. 1
Mommy told me to make a passcode based login system.
My initial C code was compiled without any error!
Well, there was some compiler warning, but who cares about that?
Then,Let’s Just Connect Straight Away As Above.
1 | ssh passcode@pwnable.kr -p2222 (pw:guest) |

Screenshot. 2
Once Connected,You’d Then Use ls -l
to
Check For Files.
And Upon Checking,You’ll Find:
flag
passecode
passecode.c
There Are Three Files In Total, You See.

Screenshot. 3
First off, if you run passcode
You Can See It Behaves As Shown Above.
Right,And Then With The cat
Command
Let’s Have A Look At The passcode.c
File.

Screenshot. 4
I know, rummaging through some decades-old
C language books at home,
and having a look at the code
it appears
there’s a function that takes input
I suppose it’s likely the login()
function.
1 | scanf("%d", passcode1); |
So, these two, I’d imagine
The input value isn’t being stored in passcode1
it’s not.
Rather, it’s being stored at an address that’s meant for passcode1
.
it’s being stored.
So, for example, if passcode1=0x123死5678
,
it seems the value we input would then be stored at the 0x123死5678
address.
it seems the value we input would then be stored.
Both variables likely contain dummy values as they haven’t been initialised
and given that the input value is then being stored at an address derived from that dummy value
well, that’s where the error crops up, isn’t it?
Right, then let’s have a look with gdb.



Screenshot. 4
First off, if you have a look at the ‘welcome’ function, it stores the input value at ebp-0x70
it stores the input value at ebp-0x70
.
And then, with the login
function, you’ll see:

Screenshot. 5
You can tell that ebp-0x10
is where passcode1
is located.
is located.
Now, welcome()
receives 100 bytes of input, but
1 |
|

Screenshot. 8
And that’s how we snagged the key, you see.
And then, heading back to the initial page

Screenshot. 9

Screenshot. 10
You can confirm that 10 points were in fact, received upon mission completion
You can confirm that 10 points were received

Screenshot. 11
And then, a green dotted line indicates completion
it indicates completion.
Oh, and even upon completion, it seems one can repeatedly practice the same problem
it seems one can repeatedly practice it
Looks like it’s solvable, then, eh? ōxō
Looks like it’s solvable, then, eh? ōxō

Have a good day,
and I hope everything works out well for you
It’s quite warm out,
so do try and avoid getting heatstroke
And do take care with the erm,
Wuhan pneumonia situation
