joaovarelas / Obfuscator-LLVM-16.0

GNU General Public License v3.0
84 stars 16 forks source link

May I ask why remap debuginfo=true is not used #10

Open androiddisk opened 2 months ago

androiddisk commented 2 months ago

https://b1n.io/posts/orust-mimikatz-bypass-kaspersky/#%e6%b7%b7%e6%b7%86%e7%89%88rust-mimikatz-bypass%e5%8d%a1%e5%b7%b4%e6%96%af%e5%9f%ba It seems that this article was also written by you, as mentioned in the article

大家都知道, rust默认编译后会将一些敏感目录打包进二进制文件, rust的库也存在类似的问题. 一般的解决方案是使用--remap-path-prefix去映射, 但是在编译rust的本身的库的时候, 是无法完全控制的, 为什么说无法完全控制呢? 因为确实可以控制一部分, 在编译rust的config.toml的文件里rust选项下有个remap-debuginfo选项, 取消注释, 并且设置为true即可去除部分路径, 这条配置启用之后, rust本身的调试路径将会映射到/rust/$sha/..., 但是部分rust依赖的crate并不能靠这条命令完成映射
有两个解决方法, 一是在编译时, 重新编译这些库, 并且配置好--remap-path-prefix, 命令如下
joaovarelas commented 2 months ago

Hello thanks for sharing, nice blog.

I am aware of --remap-path-prefix but if you compile inside Docker container, the filesystem path disclosure is not a problem. But can be added anyway.