gpt4 book ai didi

linux - 如何在linux命令行中读取文件?

转载 作者:太空宇宙 更新时间:2023-11-04 05:59:55 25 4
gpt4 key购买 nike

我正在做这个挑战,这是其中一个级别:

An agent on Level 05 has told us about another big hack he's working on. Apparently someone broke into a popular shopping site, stole all the usernames and passwords and was going to post them online. Luckily, we got to them first and recovered the details. Why is this important? Well, it seems one of the Yakoottees was a member of that site.

He typically uses one of these three usernames: kazuya, kaz_whizz, kazuya99. We've put the recovered data on one of our servers. We've given you access, so see if you can find him on there. If we knew the password he uses maybe we can use that later.

Tip: The flag is his password.

我想我需要阅读这个名为“182k_accounts_rip.txt”的文件。我认为该目录是“/root/site_pwned”。

也许我需要读取该文件才能获取密码? “cat”、“less”、“more”和“tail”命令不起作用。也许我需要查看当前密码以及提到的用户名?请帮忙

最佳答案

要读取文件,您可以使用system函数或execve系列函数从program调用vivim命令

int main(int argc, char *argv[]) {

system("vim 182k_accounts_rip.txt");
perror("system");
/* do the stuff here like use grep to find the pattern*/
return 0;
}

关于linux - 如何在linux命令行中读取文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48973843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com