使用 base64 命令绕开服务器无权限上传文件问题
base64 Linux Windows 大约 1023 字Windows 平台
生成 base64 字符串
生成的base64
字符串保存到back.txt
文件。
certutil -encode test.png back.txt
base64 恢复成文件
certutil -decode back.txt test-recover.png
校验文件 md5 是否一致
原始文件md5
值:
certutil -hashfile test.png md5
输出
C:\Users\fendoudebb\Desktop>certutil -hashfile test.png md5
MD5 的 test.png 哈希:
edad7c9c3752e2ac95f3db6881705984
CertUtil: -hashfile 命令成功完成。
恢复文件md5
值:
certutil -hashfile test-recover.png md5
输出
C:\Users\fendoudebb\Desktop>certutil -hashfile test-recover.png md5
MD5 的 test-recover.png 哈希:
edad7c9c3752e2ac95f3db6881705984
CertUtil: -hashfile 命令成功完成。
注意
certutil
不能使用>
管道命令符。
Windows
平台certutil
命令生成的base64
字符串头部及尾部携带了两行字符串。如果需要把文字拷贝到Linux
服务器,则必须去除这两行。
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Linux 平台
生成 base64 字符串
base64 test.png > back.txt
base64 恢复成文件
base64 -d back.txt > test-recover.png
校验文件 md5 是否一致
原始文件md5
值:
md5sum test.png
输出:
edad7c9c3752e2ac95f3db6881705984 test.png
恢复文件md5
值:
md5sum test-recover.png
输出:
edad7c9c3752e2ac95f3db6881705984 test-recover.png
注意
Linux
必须使用>
管道命令符。
阅读 2192 · 发布于 2021-03-04
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓
昵称:
随便看看
换一批
-
Kubernetes Pod 控制器 CronJob阅读 1104
-
IDEA 破解后打不开解决方法阅读 16967
-
Spring Boot JPA 控制台输出格式化后的 SQL 语句阅读 5213
-
Angular 添加事件监听阅读 2665
-
Spring Cloud OpenFeign 使用指定配置阅读 1000
-
Go 中的 GOROOT 和 GOPATH阅读 4496
-
Redis: I detected a non zero amount of anonymous huge pages used by your process.阅读 1936
-
Java 13 JVM 参数 FlightRecorder 被标记为过时阅读 675
-
Java 并发编程之自定义线程池阅读 1931
-
k3s 部署简化版 Kubernetes阅读 1521