我是一个初学者,最近在Ubuntu 22.04上做CSAPP攻击实验室。我下载了文件,在终端运行cttarget,
./ctarget
字符串
通常情况下,CTARGET应该接收stdin作为代码注入,注入太多的字符会导致分段错误。但是,没有输入任何东西,程序会突然终止:
Ouch!: You caused a segmentation fault!
Better luck next time
FAILED
型
我尝试使用GDB来检查错误,当它终止时,我检查了堆栈帧:
(gdb) bt
#0 0x00007ffff7c750d0 in __vfprintf_internal (
s=0x7ffff7e1a780 <_IO_2_1_stdout_>,
format=format@entry=0x4044bc "Type string:", ap=ap@entry=0x556311b8,
mode_flags=mode_flags@entry=0)
at ./stdio-common/vfprintf-internal.c:1244
#1 0x00007ffff7c6079f in __printf (
format=format@entry=0x4044bc "Type string:")
at ./stdio-common/printf.c:33
#2 0x00000000004022c3 in launch (offset=<optimized out>)
at support.c:293
#3 0x000000000040233d in stable_launch (offset=<optimized out>)
at support.c:340
型
但是我已经没有办法科普。o(Ubuntu)o由于ubuntu系统的原因,这可能吗?如果我切换到其他Linux发行版,它会工作吗?
非常感谢你回答我的问题。
1条答案
按热度按时间uklbhaso1#
我自己解决!原来失败的原因是由于我选择的操作系统。我尝试的Ubuntu版本都没有(
20.04
、21.03
、21.10
和22.04
)工作;然而,Fedora 39
允许它正常运行。这让我怀疑ctarget
应用程序是专门为在Fedora上运行而构建的,或者可能需要特定的依赖项或依赖项版本,而我下载的Ubuntu操作系统没有。