能力值:
( LV3,RANK:30 )
|
-
-
2 楼
从 web 登录,到克隆 MAC 页面,捕获一下更改 MAC 的数据包就可以了
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
路由器的MAC只能是get,不能set修改
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
开始 - 运行-ipconfig /all,就能查到
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
MAC地址不是一般都有厂家在生产的时候就已经分派好了的吗?只能get不能set
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
楼主你想一下你打开路由器网页进行配置,路由器就充当http服务器的角色,
你通过网页设置mac克隆,会发送一个http请求到路由器,你可以抓包看下,然后模拟发包就可以了
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
发现电脑上有份比较烂的代码,楼主可以参考下:
这个是TP-LINK TL-R402+设置ASDL用户名以及密码进行自动拨号的,如果是设置MAC克隆,GET请求就不一样了,楼主自己手工设置抓包看下就可以了;当然有些路由器不是用GET,是用POST的,数据包的构造就得改改了
char Data[1024]={
//TP-LINK TL-R402+ 1
"GET /userRpm/PPPoECfgRpm.htm?wantype=2&VnetPap=0&"
"acc=%s&psw=%s&linktype=4&waittime2=0&"
"Connect=%%C1%%AC+%%BD%%D3 HTTP/1.1\r\n"};
char Header[1024]={
//TP-LINK TL-R402+ 1
"Accept: */*/\r\n"
//"Referer: http://192.168.1.1/userRpm/WanCfgRpm.htm\r\n"
"Accept-Language: zh-cn\r\n"
"UA-CPU: x86\r\n"
"Accept-Encoding: gzip, deflate\r\n"
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;)\r\n"
"Host: 192.168.1.1\r\n"
"Connection: Keep-Alive\r\n"
"Authorization: Basic %s\r\n\r\n"};
int RouterDial(char *username, char *password)
{
char *headers;
char *SendText;
SendText =(char *)malloc(4024);
headers =(char *)malloc(2024);
memset(SendText, 0, sizeof(SendText));
memset(headers, 0, sizeof(headers));
sprintf(SendText, Data, username, password);
sprintf(headers, Header, "YWRtaW46YWRtaW4=");
if(RouterSend(strcat(SendText,headers))==FALSE)
{
return FALSE;
}
free(SendText);
free(headers);
return TRUE;
}
LRESULT RouterSend(char *Request)
{
WSADATA ws;
SOCKET s;
struct sockaddr_in addr;
int Result;
char *strBuffer;
int err;
WORD ver;
ver=MAKEWORD(2,2);
err=WSAStartup(ver,&ws);
strBuffer=(char *)malloc(1024*sizeof(char));
s = socket(AF_INET, SOCK_STREAM, 0);
if( s == INVALID_SOCKET )
{
MessageBox(0,TEXT("Failed to create a socket!"),TEXT("Error"),MB_OK);
return FALSE;
}
addr.sin_family = AF_INET;
addr.sin_port = htons(80);
addr.sin_addr.s_addr = inet_addr("192.168.1.1");
Result = connect(s, (struct sockaddr *)&addr, sizeof(addr));
if(SOCKET_ERROR == Result)
{
MessageBox(0, TEXT("Connect fail!"),TEXT("Error"),MB_OK);
WSACleanup();
return FALSE;
}
else //success
{
Result = send(s, Request, strlen(Request), 0);
if(SOCKET_ERROR == Result )
{
MessageBox(0, TEXT("Error!"),TEXT("Error"),MB_OK);
return FALSE;
}
do
{
Result = recv(s, strBuffer, 1023, 0);
if( strstr(strBuffer, "200 OK")!=NULL || strstr(strBuffer, "GoAhead-Webs")!=NULL )
{
free(strBuffer);
WSACleanup();
return TRUE;
}
}while(Result > 0);
WSACleanup();
}
free(strBuffer);
return FALSE;
}
|
|
|