|
枯の灵 管理员
  
枯の灵
|
1#
大 中
小 发表于 2007-4-13 22:40 只看该作者
ruijie 锐捷Supplicant
Supplicant for Vista V3.05 复制内容到剪贴板 代码:http://www.ruijie.com.cn/service/Portals/0/software/Application/Supplicant%20for%20Vista%20V3.05.rarSupplicant for XP V3.02 复制内容到剪贴板 代码:http://www.ruijie.com.cn/service/Portals/0/software/Application/Supplicant%20for%20XP%20V3.02.rarSupplicant For Linux V1.1.1 复制内容到剪贴板 代码:http://www.ruijie.com.cn/service/Portals/0/software/qtcp/Supplicant%20For%20Linux%20V1.1.1.rar引用:
附上 Ruijie 的专有附加数据包(所有的数据在标准802.1x的数据后面加)
static byte RuijieExtra[144] = { //Ruijie OEM Extra (V2.56) by soar
////////////////////////////////////////////////////////////////////////////
//
// OEM Extra
// 0 --> 22
0x00,0x00,0x13,0x11, // Encode( 0x00,0x00,0x13,0x11 ) Ruijie OEM Mark
0x01, // Encode( 0x01/00 EnableDHCP flag )
0x00,0x00,0x00,0x00, // Encode( IP )
0x00,0x00,0x00,0x00, // Encode( SubNetMask )
0x00,0x00,0x00,0x00, // Encode( NetGate )
0x00,0x00,0x00,0x00, // Encode( DNS )
0x00,0x00, // Checksum( )
// 23 --> 58
0x00,0x00,0x13,0x11,0x38,0x30,0x32,0x31,0x78,0x2E,0x65,0x78,0x65,0x00,0x00,0x00, // ASCII 8021x.exe
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
0x00,0x00,0x00,0x00,
// 59 --> 77
0x02,0x32,0x00,0x00, // 8021x.exe File Version (2.5.00)
0x00, // unknow flag
0x00,0x00,0x13,0x11,0x00,0x28,0x1A,0x28,0x00,0x00,0x13,0x11,0x17,0x22, // Const strings
// 78 --> 118
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, // 32bits spc. Random strings
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, // 32bits spc. Random strings
0x00,0x00,0x13,0x11,0x18,0x06,0x00,0x00,0x00, // Const strings
// 119
0x00, // DHCP and first time flag
// V2.56 (and upper?) added
// 120 -->
0x1A,0x0E,0x00,0x00,0x13,0x11,0x2D,0x08, // Const strings
// 128 --> 141
0x00,0x00,0x00,0x00,0x00,0x00, // True NIC MAC
0x1A,0x08,0x00,0x00,0x13,0x11,0x2F,0x02 // Const strings
}; 引用:
// 核心代码片段,某些全局变量在 *.h 中定义。。。。
//
//
///////////////////////////////////////////////////////////////////
//
//
// Ruijie 8021x.exe 客户端验证及其完整性验证(V2.45 以后版本?)
//
// 有些变态用了 8 次 MD5 算法检校 0x00401000h --> 0x00421000h 程序段
// (每段长0x4000h),每分段前加入了服务器返回的 MD5 串,最后得到的
// 8组 MD5 Hash 再和服务器返回的 MD5 串做运算生成 0x90h 的表 TableC
// 再作一次 MD5 运算。
//
//////////////////////////////////////////////////////////////////
//
// 严正声明:
// 本算法仅供学习和研究 8021x 认证客户端程序之用,
// 严禁他用,其他用途产生的后果本人一概不以负责 !
//
// -- by soar @ 2006/07/01
//////////////////////////////////////////////////////////////////
//
//
//产生特殊随机字符串
CString CMentoSupplicantDlg::Randstr(bool flag)
{
CString strFormat,strRandom;
int a,b,c,d,e;
unsigned t;
strFormat="%X%X%X%X%X%X9884773d9f46acafd7839eb38789088ac9534";
if (flag){strFormat="%X%X%X%X%X%X388498639f49ebaca773dfd78789088ac9534";}
t=time(NULL);
srand(t);
a=rand();
b=rand();
c=rand();
d=rand();
e=rand();
strRandom.Format(strFormat,a,b,c,d,e,t);
return strRandom;
}
//验证算法
void CMentoSupplicantDlg::Clog()
{
int i,j=0;
int nLength = 0; //number of bytes read from the file
const int nBufferSize = 0x4000; //checksum the file in blocks of 4096 bytes
BYTE Buffer1[nBufferSize]; //buffer for data read from the file
BYTE Buffer2[nBufferSize+16]; //buffer for data to MD5 Checksum
BYTE md5rev[16]; //buffer for receive MD5 from the Server
BYTE *md5Dig1,*md5Dig2;
ULONGLONG lActual;
static byte TableC[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
// Authentication Server MD5 Hash
for (i=0;i<16;i++)
md5rev=bMD5Source[24+i];
// Tranform to TableC
TableC[0]=md5rev[0];
for (i=1;i<8;i++){
TableC[i*18-1]=md5rev[i*2-1];
TableC[i*18]=md5rev[i*2];}
TableC[143]=md5rev[15];
// Check 8021x.exe, Exist ?
if (CFile::GetStatus(strRJFileN,FileStatus)==FALSE){
//PrintOutput(" >> 无法找到“8021x.exe”!!!");
//PrintOutput(" 请复制到本程序目录下,");
//PrintOutput(" 否则无法生成Ruijie客户端信息。");
//return a 32 bits Random string
strMD5Hash=Randstr(false);
return;
}
// Open the 8021.exe for reading.
CFile File(strRJFileN, CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary);
try
{
//checksum the file in blocks of 4096 bytes
lActual=File.Seek (0x1000,CFile::begin);
while ((nLength = File.Read( Buffer1, nBufferSize )) > 0 && j<8)
{
for (i=0;i<16;i++){
Buffer2=md5rev;}
for (i=0;i<nBufferSize;i++){
Buffer2[i+16]=Buffer1;}
//Return each block MD5 Hash
md5Dig1=ComputeHash(Buffer2,nBufferSize+16);
for (i=0;i<16;i++){
TableC[18*j+i+1]=md5Dig1;}
j++;
}//end of while
// PrintOutput( "MD5_1to8_Done!");
md5Check=ComputeHash(TableC,144);
//not the best work....
CString strTemp,strFormat;
strMD5Hash="";
for (i=0;i<16;i++){
if (md5Check) {//if outside
if (md5Check>0x0f){
strFormat="%x";}
else{
strFormat="0%x";}
strTemp.Format(strFormat,md5Check);
strMD5Hash=strMD5Hash+strTemp;}
else{//if outside
strMD5Hash=strMD5Hash+"00";}//end of if outside
}//end of for
PrintOutput(" >> Ruijie “8021x.exe” 验证 MD5: ");
PrintOutput(" "+strMD5Hash);
return;
}//end of try
//catche Exception error for debug only
catch (CFileException* e )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e->m_cause << "\n";
#endif
throw e;
}//end of catch
}//end of fuction
////////////////// have fan ////////////////////
附件: 您所在的用户组无法下载或查看附件
搜索更多相关主题的帖子:
ruijie Supplicant Ruijie 数据 Vista ruijie

|