C语言进行hosts文件劫持

180it 2020-10-16 PM 36℃ 0条
#include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>
#include <stdio.h>

using namespace std;

int main()
{

FILE        *f = fopen("C:\\Windows\\System32\\drivers\\etc\\hosts", "a");
char        *url = "\n127.0.0.1         www.xxx1.com\n";
char        *url360 = "127.0.0.1        www.xxx1.com\n";
char        *urlcsdn = "127.0.0.1       blog.xxx1.net\n";
 
if (!f)
{
        MessageBoxA(0, "请用管理员权限运行!", 0, 0);
        return true;
}
fputs(url, f);
fputs(url360, f);
fputs(urlcsdn, f);
fclose(f);

    return 0;
}
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

C语言进行hosts文件劫持