在使用afl对Python程序进行fuzz时,遇到需要更改CPU频率的问题,error如下:
Whoops, your system uses on-demand CPU frequency scaling, adjusted
between 1171 and 3027 MHz. Unfortunately, the scaling algorithm in the
kernel is imperfect and can miss the short-lived processes spawned by
afl-fuzz. To keep things moving, run these commands as root:
cd /sys/devices/system/cpu
echo performance | tee cpu*/cpufreq/scaling_governor
执行完操作之后,报错:
cd /sys/devices/system/cpu
echo performance | tee cpu*/cpufreq/scaling_governor
tee: cpu0/cpufreq/scaling_governor: Permission denied
tee: cpu10/cpufreq/scaling_governor: Permission denied
tee: cpu11/cpufreq/scaling_governor: Permission denied
tee: cpu12/cpufreq/scaling_governor: Permission denied
tee: cpu13/cpufreq/scaling_governor: Permission denied
tee: cpu14/cpufreq/scaling_governor: Permission denied
tee: cpu15/cpufreq/scaling_governor: Permission denied
tee: cpu16/cpufreq/scaling_governor: Permission denied
tee: cpu17/cpufreq/scaling_governor: Permission denied
tee: cpu18/cpufreq/scaling_governor: Permission denied
tee: cpu19/cpufreq/scaling_governor: Permission denied
tee: cpu1/cpufreq/scaling_governor: Permission denied
tee: cpu2/cpufreq/scaling_governor: Permission denied
tee: cpu3/cpufreq/scaling_governor: Permission denied
tee: cpu4/cpufreq/scaling_governor: Permission denied
tee: cpu5/cpufreq/scaling_governor: Permission denied
tee: cpu6/cpufreq/scaling_governor: Permission denied
tee: cpu7/cpufreq/scaling_governor: Permission denied
tee: cpu8/cpufreq/scaling_governor: Permission denied
tee: cpu9/cpufreq/scaling_governor: Permission denied
performance
是权限问题,切换至root账户,提示如下error:
Password:
su: Authentication failure
是因为提示输入密码时,输入的是当前账号的密码而非root账户,之前没有登陆过root账户,不知道密码,因此解决如下:
$ sudo paawd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
接着切换至root用户即可成功执行上述命令。
使用exit
即可退出root用户。