- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作一个简单的缓冲区溢出教程,通过 xinetd 将下面的程序作为端口 8000 上的服务运行。代码是使用
编译的gcc -o bof bof.c -fno-stack-protector
ubuntu 也关闭了堆栈保护。
本地利用,即
python -c ---snippet--- | ./bof
成功,隐藏函数被执行,显示文本文件内容。
但是,将其作为服务运行并执行
python -c ---snippet--- | nc localhost 8000
利用时不返回任何内容。我在这里遗漏了什么吗?
#include <stdio.h>
void secret()
{
int c;
FILE *file;
file = fopen("congratulations.txt", "r");
if (file) {
while ((c= getc(file)) !=EOF)
putchar(c);
fclose(file);
}
void textdisplay()
{
char buffer[56];
scanf("%s", buffer);
printf("You entered: %s\n", buffer);
}
int main()
{
textdisplay();
return 0;
}
最佳答案
默认情况下输出是缓冲的。要禁用此功能,您可以在 main 顶部执行以下操作:
setbuf(stdin, NULL);
这应该可以解决您的问题。
关于c - 通过 xinetd 的简单缓冲区溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39198274/
这可能是也可能不是编码问题。也可能是 xinetd deamon 问题,我不知道。 我有一个从运行 xinetd 的 linux 服务器触发的 python 脚本。 xinetd 已设置为仅允许一个实
我在 Fedora 上使用 xinetd。我在 etc/xinetd.d 文件夹中放置了一个名为 telnet 的文件,其中包含以下内容: service telnet { disable
我只是为我的二进制文件之一设置 xinetd 作为服务运行。然而,在我看来,stdout 和 stderr 都被重定向到套接字流中。 有没有办法禁用标准错误?我在 xinetd 设置的服务器字段中尝试
我正在尝试制作一个简单的缓冲区溢出教程,通过 xinetd 将下面的程序作为端口 8000 上的服务运行。代码是使用 编译的 gcc -o bof bof.c -fno-stack-protector
我想将 xinetd 连接转发到另一个本地端口(比如 12345)。我的解决方案基于 CentOS/Redhat 文档第 17 章。TCP Wrappers and xinetd, article 1
我希望 xinetd 在某个端口接收到连接时执行 shell 脚本。为此,请遵循本教程:[在此处输入链接描述][1] 不幸的是,整个事情并没有像我希望的那样工作,这就是我要展示的原因你我的配置。 xi
任何人都知道要使服务器与 xinetd 一起工作需要进行哪些更改? 服务器是在 Linux 上运行的 .NET 邮件服务器。 引用这篇文章的底部: Lumisoft Mailserver Forum
伙计们,我在使用 xinetd 时遇到问题,错误消息是 'xinetd[20126]: execv(/home/fulu/download/mysqlchk_status2.sh ) failed:
我读到了这个: You can use xinetd to add a service starting your python script. The standard input and outp
默认:打开 # description: mysqlchk service mysqlchk { # this is a config for xinetd, place it in /etc/xin
当用户尝试执行由 xinetd 启动并作为单个实例运行的远程脚本时,我想为他提供一些反馈。 通过 UDP 或 TCP 套接字,用户将一些文本发送到 xinetd 正在监听的端口。如果该脚本尚未被使用,
我安装了一个 VNC 服务器并在某处阅读了我必须安装 xinetd 的信息。稍后我决定删除 VNC 服务器,所以我也删除了 xinetd。似乎 xinetd 删除了一些与 plesk 相关的文件,如果
我有一个 C 网络软件,目前在 listen 和 fork 模式下工作。它正在监听一些服务器套接字并接受传入连接。然后它调用提供新接受套接字的核心服务器函数。 现在我正试图让该软件也能在 xinetd
我正在运行 7Days to Die 服务器。通常我通过 ssh 与用户“linux”连接并运行命令: /home/linux/start 这有效,服务器正在运行。 但是当我将用户切换到root(su
如何从 xinetd 通过流套接字启动的 Ruby 脚本中获取客户端 IP 地址?在 PHP 中,我只使用 stream_socket_get_name(STDIN, true); 提前致谢! 最佳答
尝试创建一个简单的 xinetd 风格的服务器,而不需要首先创建一个完整的服务。我有以下位于 /etc/xinetd.d/myscript 的文件: service tester {
我想知道当 xinetd 通过 udp 从随机主机(在 lan 中)接收命令时是否可以将 args 传递给 bash 脚本。清除:当我发送例如hello 从随机客户端到 xinetd 服务器 我希望
我有一个服务,它会在启动后监听端口 8443。我已将 xinetd 配置为在端口 8443 上建立连接时启动我的服务。 所以 Xinetd 应该启动我的应用程序,然后让我的应用程序处理任何更多的传入连
我是一名优秀的程序员,十分优秀!