用于检查漏洞 CVE-2015-0235 的 Ansible playbook。该 playbook 基于芝加哥大学提供的测试程序(链接)。Ansible 允许你同时指定大量主机进行测试。
这不会修补或重启任何东西,仅报告你的系统是否受影响。
假设远程已安装 gcc。
请勿随意在你的主机上运行此程序,先阅读代码了解其作用 :)
需要 Ansible。将 ghost.yml:2 中的 user: your_remote_user 修改为你的远程系统用户名。
pip install ansible
ansible-playbook -i hosts_to_test ghost.yml
af:ghost aaronfay$ ansible-playbook ghost.yml -i aaron_host
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [foobar.com]
TASK: [copy the GHOST script to the machine] **********************************
ok: [foobar.com]
TASK: [compile it] ************************************************************
ok: [foobar.com]
TASK: [run it!] ***************************************************************
ok: [foobar.com]
TASK: [show me the results] ***************************************************
ok: [foobar.com] => {
"ghost.stdout_lines[0]": "vulnerable"
}
PLAY RECAP ********************************************************************
foobar.com : ok=5 changed=0 unreachable=0 failed=0