c - 如何用c编写shellcode?
问题描述
我尝试使用 c 在文件中编写 shell 代码,但在执行程序后我发现文件中的 ASCII 代码不是 shell 代码。这是代码:
FILE *shell;
shell = fopen("shell.txt", "w");
fprintf(shell,"shell = '\xbd\x7f\x94' \n");
fclose(shell);
解决方案
在 C 中要打印反斜杠,您需要对其进行转义,因为它是转义字符。
所以要打印
shell = '\xbd\x7f\x94' <LF>
指定
"shell = '\\xbd\\x7f\\x94' \n"
反而。
推荐阅读
- ruby-on-rails-5 - rails 5 中 attr_protected 的替代品是什么?
- c# - 无法通过等待和任务获取异步 ActionResult 中的 linq 查询数据,错误:等待不能与异步方法一起使用
- android-studio - 发现飞机后,HandMotion 动画不会禁用 (ARCore)
- python - RecursionError:超出最大递归深度 - 二叉树
- php - 当我尝试使用 phpmailer 发送邮件时,出现错误
- python - 使用 Tkinter 多次显示菜单
- python - Kivy Weather App 如何打印输出到标签?
- eclipse - 如何在 Eclipse 上调试 Jhipster/Gradle 项目
- node.js - 我如何在服务器端节点js上加载谷歌字体
- forms - 如何将“选择的下拉选项”发送给reciepnt,而不是在contactform7中与它相关联的相应电子邮件ID?