开发者

can you fake *nix uptime?

开发者 https://www.devze.com 2023-02-10 03:27 出处:网络
Just curious, Can you fake an uptime, for instance开发者_如何学Go increase it to 10 years? I have tried changing system time, and it won\'t do this trick.alias uptime=\'echo \" 11:07:17 up 10 BILLION

Just curious, Can you fake an uptime, for instance开发者_如何学Go increase it to 10 years?

I have tried changing system time, and it won't do this trick.


alias uptime='echo " 11:07:17 up 10 BILLION YEARS!,  4 users,  load average: 0.38, 0.52, 0.41"'

If you want to get extra-fancy, you could take the actual uptime output and modify that.


Have a look at this utility: UptimeFaker.


Yeah, you should be able to attach a gdb to the running kernel, and hack the uptime value. You'd need to know where it was kept, and have a symbols file. I am assuming here, that uptime is held in something statically allocated.

Alternatively, write a small kernel module which hacks the uptime when you load it (and immediately unloads again).

0

精彩评论

暂无评论...
验证码 换一张
取 消