Introduction to Command line

User4 has a lot of files and folders in their Documents folder. The flag can be found within one of them.

I fould I kid you not, 30 flag.txt files each in an individually labeled file. The ones that I’ve looked within were empty but I’ll admit to checking only a handful thus far. Am I supposed to create a loop concatenating them all together?

As it turns out the solution for this was very plainly in the “Finding and Filtering Content” Section and I just needed fresh eyes.

can you suggest me which filter command should i use

did you get this one? cna you show me how did you filter it?

I guess by cmd and not by powershell? All the files are empty
I can’t see the flag

Hey bro, so i got the answer on this way:
1: I change from CMD to PS
2 Filter all objects with the .txt extension and concatenate to Sort-Object to filter all files:

PS C:\Users\user4\Documents> Get-ChildItem -Path C:\Users\user4\Documents\ -Filter "*.txt" -Recurse -File | Sort-Object -Property LastWriteTime

3: Once you got the path you can move to the directory and use “type” or “more” to read the file

type flag.txt

I wish i can help because i was like 30min finding the way.

2 Likes

yeh bro you doing well , i have other flow to finding the answer :
i’ve noticed that the most of flag file have a length equal to 0 so the Idea is to filter recursively for all file with .txt extension and then sort them with length , in the end of the output it give me flag.txt file with 44 length , and this is what i looked for :


image
so the path of this file is : c:\Users\user4\Documents\3\4

1 Like