2023 BYUCTF - 2038
Overview
- Tag: Easy
Description
I know you really want the flag, so I’ll print it out for you, but only after January 1st, 2024 :)
nc byuctf.xyz 40007
Attached
Solution
Run the file and we got this:
Task: 'print_flag'
Description: 'prints out the flag'
Date: 'undefined'
ERROR - date for 'print_flag' task is not defined
This task is not available until January 1st, 2024
You may optionally extend this task to be available later
To specify when you would like to make the task available, specify the number of seconds since January 1st, 1970 UTC
>
Input any value, e.g: 1. Then we got:
Task: 'print_flag'
Description: 'prints out the flag'
Date: 'undefined'
ERROR - date for 'print_flag' task is not defined
This task is not available until January 1st, 2024
You may optionally extend this task to be available later
To specify when you would like to make the task available, specify the number of seconds since January 1st, 1970 UTC
> 1
ERROR - date must be after January 1st, 2024
Then we choose the value satisfy, for example: 1704098651
Task: 'print_flag'
Description: 'prints out the flag'
Date: 'undefined'
ERROR - date for 'print_flag' task is not defined
This task is not available until January 1st, 2024
You may optionally extend this task to be available later
To specify when you would like to make the task available, specify the number of seconds since January 1st, 1970 UTC
> 1704098651
Specified datetime - Mon Jan 1 15:44:11 2024
Current datetime - Sat May 20 19:47:30 2023
'print_flag' was not run because specified date has not occurred yet. Exiting...
Hmm, sounds like we have to find the specified date:
for i in {1..10000}; do
thisdate=$(( 1704098651+86400*$i ))
echo $thisdate | ./2038 | grep Running
echo $i
echo "-----------------------------------------------------------------------------------"
done
At i = 5132
, something happend:
Task: 'print_flag'
Description: 'prints out the flag'
Date: 'undefined'
ERROR - date for 'print_flag' task is not defined
This task is not available until January 1st, 2024
You may optionally extend this task to be available later
To specify when you would like to make the task available, specify the number of seconds since January 1st, 1970 UTC
> 2147503451
Specified datetime - Sat Dec 14 08:57:59 1901
Current datetime - Sat May 20 19:51:27 2023
Time requirement has been met. Running 'print_flag'...
Okay, we got the suitable value: 2147503451
. Connect to a server, and give them this value.
The flag is:
byuctf{year_2038_problem_ftw}