< >
    首页

    一个有意思的Linux软件,用假的系统时间欺骗应用程序

    地址是:https://github.com/wolfcw/libfaketime

    如何编译和安装(Linux)

    先安装好 gitgccmake,然后运行下面的几个命令:

    git cone https://github.com/wolfcw/libfaketime.git
    cd libfaketime
    make
    make install
    

    如何使用

    下面以 date 命令为例,编一个脚本,一看你就明白怎么用了:

    #!/usr/bin/bash
    export LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1
    export FAKETIME="@2022-08-06 10:00:00"
    date
    

    运行上面的脚本会得到输出:

    2022年 08月 06日 星期六 10:00:00 CST
    
    备案号:苏ICP备19034936号/ 苏ICP备19034936号-1/ 苏ICP备19034936号-2A    站长邮箱:fuhuizn@163.com   版权所有

    苏公网安备 32050702010684号

    Powered by MarkdownWeb