问题标签 [ctf]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
9051 浏览

linux - linux命令上的''find .''和''find /''有什么区别

我正在解决有线强盗。我查看了解决方案,但没有任何解释。例如,当我使用find .find it on bandit 5->6

find .在 bandit6->7 上使用过,我在他们解决的解决方案中没有得到任何输出find /

两者都是ASCII文本所以有什么区别

0 投票
1 回答
176 浏览

facebook - 安装 Facebook CTF 的问题

我正在尝试从https://github.com/facebook/fbctf安装 Facebook CTF

按照说明,我执行 ./extra/provision.sh -m prod -s $PWD

一切顺利,直到它到达运行 grunt 的部分。它在 javascript 文件中命中了这段代码

它在样式前面的省略号上犹豫不决。

它给出了这个错误。

有没有人在安装 fbctf 时遇到此错误或可以发现 Javascript 错误?谢谢你的帮助

0 投票
1 回答
324 浏览

c - 为什么要使用 cat 打开交互式 shell?

没有下载链接再问

问题描述

Nana 告诉我缓冲区溢出是最常见的软件漏洞之一。真的吗?

美国银行

鲍勃

解决方案

https://0xrick.github.io/pwn/bof/

我知道我们必须提供 52 个垃圾字符和 cafebabe 才能溢出缓冲区。但是当我只将它作为输入传递时,我没有得到交互式外壳。只有当我也传入 cat 命令时。为什么需要猫??

- -编辑 - -

我忘了提到这是在服务器上运行的,我使用nc pwnable.kr 9000. 我将输入作为python -c 'print("A"*52 + "\xbe\xba\xfe\xca")' | nc pwnable.kr 9000. 据说正确答案是(python -c 'print("A"*52 + "\xbe\xba\xfe\xca")'; cat) | nc pwnable.kr 9000

0 投票
2 回答
259 浏览

linux - 卡在 overthewire 的 bandit16 级别

我正在尝试解决 overthewire 的 CTF 挑战,并已完成多达 16 个级别

要从级别 16 到 17,您必须在提交密码后将当前级别的密码发送到本地主机上支持 SSL 的端口,并提供 ssh 私钥以登录到下一个级别

我已经完成了到这里,并成功地将 ssh 密钥保存在一个文本文件中,将权限更改为 600,但是每当我尝试使用此密钥登录到下一个级别时,系统都会提示我提供密钥的密码已经被困在这里很长时间了,我如何提供密码,因为在创建密钥时没有任何东西可以设置密码

0 投票
1 回答
75 浏览

vim - 有没有办法执行 txt 文件中的 vim 命令以及文本?

我在我的 CTF 最后阶段,我有这个:

我对 Vim 不是很熟悉,所以我不知道如何运行这个脚本。我猜它必须做一些比用“15”替换“ry”更大的事情,因为我手动尝试过并且标志不正确。提前致谢!

0 投票
1 回答
232 浏览

image - jpeg同心像素块的解扰旋转

作为“夺旗”挑战的一部分,附加的 jpg 被打乱以掩盖内容。图像(“flagpoles.jpg”)为 1600 x 1600 像素。同心线似乎具有 10 像素宽的块大小。(它类似于弗兰克斯特拉的画作)。看起来原始图像已被分成四个部分,围绕中心对称排列。我一直在尝试编写一个 python 脚本来处理像素并解读同心方块。我的努力导致了两种无用的反复出现的情况,要么没有变化,要么更加混乱。我认为这可能是因为我正在处理整个图像,并且尝试解读其中的一部分可能会更好。这是我的代码。目前它只处理一半的像素,因为我试图将图片的各个部分相互匹配。我尝试将块发送到图像的另一侧以尝试匹配它们,但没有任何改进。我们将不胜感激地收到任何有助于获得清晰图片的帮助。

在此处输入图像描述

0 投票
0 回答
128 浏览

c - 需要有关格式字符串漏洞的帮助

你好!我正在做 ctf 练习(Overthewire 5 级,纳尼亚)。这是我尝试过的代码,但我不明白为什么第二个选项不起作用。

这个有效

有了这个我得到SegFault

两种变体的原理是相同的,您传递地址和 %n 说明符读取传递的字节量,因为地址需要 4 个字节,我们添加 496 个字节和填充。据我了解,在他们两个中 %n 都会读取堆栈上的下一个地址。谢谢,您的回答。

0 投票
1 回答
277 浏览

assembly - Verified correct shellcode segfaults when run normally; “No such file” in GDB…?

For a wargame, I'm exploiting a buffer overflow to inject some shellcode to spawn /bin/sh. I started by writing my own shellcode, but I got some bizarre errors, so I tried a piece of known working shellcode – and got the same error! However, it gets weirder: running it locally (i.e. not on the wargame server) works fine (so I've verified the problem isn't with the code), and running it in GDB produces a different error.

When run normally:

When run in GDB:

The shellcode can be found here, or, in NASM Intel syntax:

I've confirmed in GDB that the code is inserted properly, that it's jumped to in the correct place, and even that execution reaches the int 0x80 that's supposed to spawn a shell – but as soon as you try to si past it, it gives you the error above.

I've also confirmed at the point of the int 0x80 that the registers are, as far as I can tell, in order for an execve call. Here are the inspected registers from my own shellcode (not from the shellcode above, which sets up ecx and edx to null pointers, but this produces the same error):

Why does this execve syscall not work? And… what in the world could /proc/2242/exe be? The string sent to execve is "/bin/sh"! Given that this works when run locally, could the issue somehow be with the server's environment?

Some considerations:

  • file output: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=..., not stripped
  • ASLR is off.
  • It's not a pointer alignment issue – I tried aligning them to 4-byte boundaries, and nothin' changed.
  • /bin/sh exists, so that's not the file that isn't being found.
  • To reiterate, just to be sure, it works with the exact same binary and the exact same shellcode on another system, so it's not an issue with the code itself.
0 投票
1 回答
121 浏览

assembly - mov.b 指令中的负操作数

我目前正在努力解决 Microrupt CTF 中的河内阶段。此 CTF 侧重于 MSP430 系列(RISC,16 位)。

我偶然发现了以下几行:

其中包含引用 (r4) 前面的负操作数的移动指令。我假设这将指向存储在 r4 中的任何内容(前面两个字)前面的寄存器,但是查看内存转储,这个假设似乎不正确。

我使用https://www.ti.com/lit/ug/slau049f/slau049f.pdf作为参考,第 3-52 页是对 mov.b 的参考。

请填写我这里到底发生了什么,或者给我一些关键字来搜索。

任何帮助表示赞赏!

PS:请不要剧透如何解决这个阶段,我想自己想办法。谢谢!

0 投票
0 回答
47 浏览

python - 是否可以在 cobra 编译器中启动 python 代码

所以我在 python 中有这段代码,但它不会运行,因为数字太大,python 无法处理,我发现 Cobra 这样的东西运行得更快,几乎和 C++ 一样,可以处理这样的任务。我已经尝试自己重写代码,但我不断收到编译错误,我正在在线编译器tio.run上编译

这是原始代码:

这是我根据我对互联网上 python 和 cobra 之间差异的研究,尝试重写它所取得的成果,这非常糟糕。