从进程列表中隐藏进程
如何从进程列表和 /proc/pid/cmdline 中隐藏进程名称。 如果进程名称出现在进程列表中那么就可以了,但是它的参数不应该出现在列表中。 因为参数包含我想隐藏的纯文本密码和/或一些敏感信息。
TIA, 萨蒂什
How do I hide the name of process from process list and from /proc/pid/cmdline.
If process name is seen in process list then it is fine, but arguments of it should not come in the list.
Cause arguments contain the plain-text password and/or few sensitive information, that I wanna hide.
TIA,
Satish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你无法隐藏它。这就是为什么许多优秀的 CLI 程序不提供在命令行提供密码的原因。
有一些软件可以隐藏进程,它被称为 Rootkit,因为它们想要隐藏。
提供密码的更好方法是提供仅进程用户可读的文件,并将密码存储在其中。例如,这是通过 mount 和凭据选项来完成的。
You cannot hide it. This is the reason why so many good CLI programs just do not offer to provide a password at the command line.
There is software out to hide processes and it is know as rootkits, because they want to hide.
A better way to give a password is by providing a file only readable by the process user, and store the password there. This is e.g. done by mount, with the credentials option.
一般来说,不要在命令行上传递敏感信息。将其传递到环境变量*或文件内容中,或通过文件描述符通过管道传入。
可以在程序启动后修改命令行(通过覆盖 argv[1] 指向的内存),但这会在程序启动和擦除其参数之间留下一个漏洞窗口。一般来说,你无法避免这种情况。因此,不要对任何敏感数据使用程序命令行参数。
* - 环境变量的安全性可能因 Unix 系统而异。在 Linux 上它应该是安全的 - 如果你有能力读取环境变量,你也有能力直接读取进程内存。
In general, don't pass sensitive information on the command line. Pass it in environment variables*, or in the content of a file, or pipe it in via a file descriptor.
It is possible to modify the command line after a program starts (by overwriting the memory pointed to by argv[1]), but this leaves a window of vulnerability between when the program starts and when its arguments are erased. You cannot avoid this in general. So don't use program command line arguments for any sensitive data.
* - The security of environment variables may vary between unixes. On Linux it should be safe - if you have the ability to read env variables, you also have the ability to read process memory directly.