问题描述
#define PORT 7070
int exec_command(int sock,char *buf) {
char command[300];
// redirecting the stdout to the socket
close(STDOUT_FILENO);
dup2(sock,STDOUT_FILENO);
// The following line is different for each linux command to be executed.
sprintf(command,"/usr/bin/nslookup %s",buf);
system(command);
return 0;
}
因此,假设我们具有上面显示的代码段,其中客户端输入url输入供服务器在其上进行curl搜索。我认为该漏洞一直存在,并且是“ sprintf”,问题是我尝试了多次输入来尝试提示服务器提供一些堆栈内存,但到目前为止都没有成功。有谁知道如何远程攻击这种类型的漏洞?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)