Книга - 19 смертных грехов, угрожающих безопасности программ
Warning: mb_convert_encoding(): Unable to detect character encoding in /var/www/u2150601/data/www/ae-books.online/wp-content/themes/twentyfifteen/content.php on line 442
19 ,
, , . 19 , , , . C/C++, C#, Java, Visual Basic, Visual Basic.NET, Perl, Python Windows, Unix, Linux, Mac OS, Novell Netware. , , , Microsoft. , . , .
, ,
19 , .
. , , , ? , : !
, , .
. .
-
Microsoft Corp. Writing Secure Code ( ). Basic Training Security & Privacy Magazine Processes to Produce Secure Software ( ), National Cyber Security Partnership (Department of Homeland Security). Microsoft, , .
, , Webroot Software. Microsoft, Microsoft Office, Trustworthy Computing Microsoft. Writing Secure Code Assessing Network Security ( ), . .
19 . . Secure Software (www.securesoftware.com). Building Secure Software ( ), Network Security and Cryptography with OpenSSL ( . OpenSSL) Secure Programming ( ). CLASP, . . (Cyberspace Policy Institute). , .
Symantec Corporation. , , . 20 . Symantec , , , Microsoft, IBM, Tektronix, Step Technologies. Screenplay Systems, Quark Continental Insurance. , .
. , . Software Inspection: An Industry Best Practice ( : ), Ada95: The Lovelace Tutorial Secure Programming for Linux and UNIX HOWTO ( Linux UNIX). .
. , , . . , . , .
, , , , , . , . : , , , , .
, . , , , . .
, , . , , , . !
, , , , . , . , , . , , , .
19 . , , . . , , , . , : . , , , . , , . , , .
,
, ,
21 2005 .
. , ( ) , . , , : (David Raphael), (Mark Curphy), (Rudolph Arauj), (Alan Krassowski), (David Wheeler) (Bill Hilf). McGrawHill. : (Jane Brownlow), (Jennifer Housh) Qody McKenzie).
2004 , , , 95% , , 19 , . , , .
, , , , . Blaster .
, , , : , , . , , , . , , .
, , .
? . . , . , . , .
? . : , . .
? . , , , . , , .
? . : , .
. , . :
? , , ;
? ; , ;
? , ;
? , ;
? ;
? : . , , ;
? , ;
? , (Common Vulnerabilities and Exposures CVE) (www.cve.mitre.org). BugTraq (www.securityfocus.com) (Open Source Vulnerability Database) (www.osvdb.org). . : , 15 2005 CAN CVE CVE. , CAN CVE. , CAN20040029 ( Lotus Notes Linux), CVE20040029;
? , . ;
? , . , , ;
? , : , ;
? , , . , . ! .
. , , , . , , , ++, Java, #, ASP, ASP.NET, Visual Basic, PHP, Perl JSP. Windows, Linux, Apple Mac OS X, OpenBSD Solaris, : , Web. , , , . , .
, . , , .
, , , , , (Web . .).
, .
? 6, 12 13.
? C/C++, 1, 2 .
? Web , JSP, ASP, ASP.NET, PHP, CGI Perl, 7 9.
? , Oracle, MySQL, DB2 SQL Server, 4.
? (, Web ), 5, 8, 10, 14 15.
? , 8, 10, 11, 17 18.
? Linux, Mac OS X UNIX, 16.
? , 19.
, , , , . , .
, , , 2005 .
1.
, . , , . ++ .
, , , , , . , 2. , . , .
, (root, Administrator System), . , . finger, finger . ( ). , 1988 , , .
, , . , , , ++, . , , , , (offbyone overflow). , , , , .
, , ++. , . , ++ , , . STL , ++ . , ++, .
, , , . , Java, # Visual Basic, , ( ). , , , . ++, . , , ++. # .NET, unsafe. , , C/C++, C/C++ . , , , .
, , , .
. (, ). , 86 , . , . , . , . , , , . , .
: ? , , , 64 Intel Itanium, . , , 64 .
, , . , . : , , , . ++ . , Web Internet Information Server (IIS) 6.0 ; , , . , . , ++ .
, .
tinclude
void DontDoIhis (char* input)
{
char buf[16];
strcpy(buf, input);
printf("%s\n ,buf);
}
int main(int argc, char* argv[])
{
//
// ,
// strcpy?
DontDoThis(argv[l]);
return 0;
}
, . , . , DontDoThis, , . strcpy:
0x0012FEC0 8 fe 12 00 .. < buf
0x0012FEC4 4 18 32 00 .2. < input
0x0012FEC8 d0 fe 12 00 .. < buf
0x0012FECC 04 80 40 00 .<
0x0012FED0 el 02 3f 4f .?0
0x0012FED4 66 00 00 00 f < buf
0x0012FED8 e4 fe 12 00 .. < EBP
0x0012FEDC 3f 10 40 00 ?.@. <
0x0012FEE0 c4 18 32 00 .2. < DontDoThis
0x0012FEE4 cO ff 12 00 ..
0x0012FEE8 10 13 40 00 ..@. < , main()
, ( ). Intel littleendian. , , 3f104000 0x0040103f.
, , buf . buf EBP (Extended Base Pointer ). ; . , 0x0012fe00 ( ), .
, . , , , , . , ( shell, (shell)) . , , , . , , .
, . , . , , Stackguard (Crispin Cowan), ProPolice, IBM, /GS Microsoft.
, , . ++ , ; . , (, X Window System Microsoft Windows), .
, , . , . , , , , . , , . , . , www.metasploit.com, shell, .
, , , , . , , ( ), . , .
, , , ! , , . . , 20 ( ), , , , . , , . !
. , , , , , .
, , . . , , . . . Matthew shok Conover Oded Horovitz Reliable Windows Heap Exploits ( Windows), http://cansecwest.com/csw04/csw04Oded+Connover.ppt. , , . , .
C/C++
C/C++ . , finger :
char buf[20] ;
gets (buf) ;
gets . fgets. , strcpy (. ). :
char buf[20];
char prefix[] = "http://";
strcpy(buf, prefix);
strncat(buf, path, sizeof(buf));
? strncat. , , . , :
char buf[MAX_PATH];
sprintf(buf, "%s %d\n", path, errno);
, sprintf . Microsoft Windows , sprintf . . MS04011 ( ).
:
char buf [ 32] ;
strncpy(buf, data, strlen(data));
? , !
. ASCII, , Unicode . :
_snwprintf(wbuf, sizeof(wbuf), %s\n, input);
:
bool CopyStructs(InputFile* pInFile, unsigned long count)
{
unsigned long i;
m_pStructs = new Structs[count];
for(i = 0; i < count; i++)
{
if(!ReadFromFile(pInFile, &(m_pStructs[i])))
break;
}
}
? new[] ++ , :
ptr = malloc(sizeof(type) * count);
count , , . , , . ++, Microsoft Visual Studio 2005, . calloc, . , : , . 3.
:
#define MAX_BUF 256
void BadCode(char* input)
{
short len;
char buf[MAX_BUF];
len = strlen(input);
// , strcpy
if(len < MAX_BUF)
strcpy(buf, input);
}
, , ? . 3, , signed int. ( input) 32, len , int MAX_BUF, . , 64. : len . size_t. , . :
const size_t MAX_BUF = 256;
void LessBadCode(char* input)
{
size_t len;
char buf[MAX_BUF];
len = strlen(input);
// , strcpy
if(len < MAX_BUF)
strcpy(buf, input);
}
. strn , .
, , . .
. , , . , , .
:
? , , ;
? ;
? ;
? .
, . . , , , , . , , ( , ), .
, , . strcpy, strcat, sprintf , , . , .
. , , 3. , , , .
, , , . , .
(fuzz testing), . . : . , , 260 , 256. , , , , . , .
, . , , : , +1 = 0.
. , , . , . .
, :
assert(len < MAX_PATH);
if(len >= MAX_PATH)
{
assert(false);
return false;
}
, AppVerifier Windows (. ). , .
, (CVE) http://cve.mitre.org. , , CVE buffer overrim 1734 . CERT, , 107 .
CVE19990042
: IMAP POP . CERT 199709. , Post Office Protocol (POP) Internet Message Access Protocol (IMAP). , , root. .
, , SLMail 2.5 Seattle Labs, www.winnetmag.com/Article/ArticleID/9223/ 9223.html.
CVE20000389 CVE20000392
CVE20000389: krb_rd_req Kerberos 4 5 root.
CVE20000390: krb425_conv_principal Kerberos 5 root.
CVE20000391: krshd, Kerberos 5, root.
CVE20000392: krshd, Kerberos 5, root.
Kerberos CERT 200006 www.cert.org/advisories/CA200006.html. (strcat), 2000 .
CVE20020842, CVE20030095, CAN20030096
CVE20020842:
mod_dav, (, Oracle9i Application Server 9.0.2), , URI, 502 BadGateway. dav_lookup_uri() mod_dav.c , ap_log_rerror().
CVE20030095:
ORACLE.EXE Oracle Database Server 9i, 8i, 8.1.7 8.0.6 , . , , LOADPSP.
CAN20030096:
Oracle 9i Database Release 2, Release 1, 8i, 8.1.7 8.0.6 , (1) TO_TIMESTAMP_TZ, (2) TZ_OFFSET (3) DIRECTORY BFILENAME.
CERT 200305 www.cert.org/advisories/CA200305.html. Next Generation Security Software Ltd. , , .
CAN20030352
CVE:
DCOM, RPC, Microsoft Windows NT 4.0,2000, Server 2003, , . Blaster/MSblast/LovSAN and Nachi/Welchia.
, , . , . , . , Windows 2003 .
www.cert.org/ advisories/CA200323.html www.microsoft.com/technet/security/bulletin/MS03039.asp.
. , , . , .
strcpy, strcat sprintf . . , , , . 3 , , . strsafe, Safe CRT ( ), Microsoft Visual Studio ( ANSI C/C++), strlcat/strlcpy *nix. , . , , . Microsoft Office Office 2003 , ( ) , .
. 3 , .
, . ; , , .
++,
і, , ++. STL. STL, , , (RTFM Read The Fine Manual) , . std::string std::wstring.
STL
STL, vector, , vector::iterator . , , STL , , .
C/C++ , Coverity, PREfast Klocwork. . Visual Studio .NET 2005 PREfast Source code Annotation Language (SAL ), , . SAL . () , data count: data count . , char * and a size_t.
void *DoStuff(char *data, size_t count) {
static char buf[32];
return memcpy(buf, data, count);
}
, ( , , ). count 32, . SAL, :
void *DoStuff(__in_ecount(count) char *data, size_t count) {
static char buf[32];
return memcpy(buf, data, count);
}
, / PREfast data count.
. , . , , , , . .
Stackguard, Microsoft /GS. , . . , , , . ProPolice, IBM Gnu Compiler Collection (GCC). .
, . . , Java #. , libc, , .
, , , . , , , . , . , Windows , AMD Athlon 64 FX Windows SP2. Windows Data Execution Protection (DEP ), No eXecute (NX).
Windows Server 2003 SP1 , Linux OpenBSD.
? Writing Secure Code, Second Edition by Michael Howard and David C. LeBlanc (Microsoft Press, 2002), Chapter 5, Public Enemy #1: Buffer Overruns
? Defeating the Stack Based Buffer Overflow Prevention Mechanism of Microsoft Windows Server 2003 by David Litchfield: www.ngssoftware.com/papers/ defeatingw2k3stackprotection.pdf
? Nonstack Based Exploitation of Buffer Overrun Vulnerabilities on Windows NT/2000/л by David Litchfield: www.ngssoftware.com/papers/nonstackbowindows.pdf
? Blind Exploitation of Stack Overflow Vulnerabilities by Peter WinterSmith: www.ngssoftware.com/papers/NISR.BlindExploitation.pdf
? Creating Arbitrary Shellcode In Unicode Expanded Strings: The 'Venetian' Exploit by Chris Anley: www.ngssoftware.com/papers/unicodebo.pdf
? Smashing The Stack For Fun And Profit by Alephl (Elias Levy): www.insecure.org/stf/smashstack.txt
? The Tao of Windows Buffer Overflow by Dildog: www.cultdeadcow.com/ cDc_files/cDc351/
? Microsoft Security Bulletin MS04011/Security Update for Microsoft Windows (835732): www.microsoft.com/technet/security/Bulletin/MS04011 .mspx
? Microsoft Application Compatibility Analyzer: www.microsoft.com/windows/ appcompatibility/analyzer.mspx
? Using the Strsafe.h Functions: http://msdn.microsoft.com/library/enus/winui/ winui/windowsuserinterface/resources/strings/usingstrsafefunctions.asp
? More Secure Buffer Function Calls: AUTOMATICALLY!: http://blogs.msdn.com/michael_howard /archive/2005/2/3.aspx
? Repel Attacks on Your Code with the Visual Studio 2005 Safe and ++ Libraries: http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCand / default.aspx
? strlcpy and strlcat Consistent, Safe, String Copy and Concatenation by Todd C. Miller and Theo de Raadt: www.usenix.org/events/usenix99/millert.html
? GCC extension for protecting applications from stacksmashing attacks: www.trl. ibm.com/projects/security/ssp/
? PaX: http://pax.grsecurity.net/
? OpenBSD Security: www.openbsd.org/security.html
? Static Source Code Analysis Tools for C: http://spinroot.com/static/
? .
? , /GS ProPolice.
? , DEP .
? , , .
? , , .
? .
? C/C++, .
? .
? ++ .
2.
,
, . (Lamagra Argamal) 23 2000 (www.securityfocus.com/archive/1/66842). (Pascal Bouchareine) (www.securityfocus.eom/archive/l/70552). (Mark Slemko) (www.securityfocus.com/archive/1 /10383) , .
.
.
, (https://www.litres.ru/devid-leblank/19-smertnyh-grehov-ugrozhauschih-bezopasnosti-programm/) .
Visa, MasterCard, Maestro, , , , PayPal, WebMoney, ., QIWI , .
- Жанр: Зарубежная компьютерная литература, Программирование
- Язык: Книги на русском языке
- Объём: 360 стр. 27 иллюстраций
- ISBN: 5-9706-0027-X
- Дата выхода книги: 29 июля 2011
- Версия: 📚 Электронная книга
Эта книга необходима всем разработчикам программного обеспечения, независимо от платформы, языка или вида приложений. В ней рассмотрены 19 грехов, угрожающих безопасности программ, и показано, как от них избавиться. Рассмотрены уязвимости на языках C/C++, C#, Java, Visual Basic, Visual Basic.NET, Perl, Python в операционных системах Windows, Unix, Linux, Mac OS, Novell Netware. Авторы издания, Майкл Ховард и Дэвид Лебланк, обучают программистов, как писать безопасный код в компании Microsoft. На различных примерах продемонстрированы как сами ошибки, так и способы их исправления и защиты от них. Если вы программист, то вам просто необходимо прочесть эту книгу.
Как скачать книгу - "19 смертных грехов, угрожающих безопасности программ" в fb2, ePub, txt и других форматах?
- Нажмите на кнопку "полная версия" справа от обложки книги на версии сайта для ПК или под обложкой на мобюильной версии сайта
Полная версия книги
- Купите книгу на литресе по кнопке со скриншота
Если книга "19 смертных грехов, угрожающих безопасности программ" доступна в бесплатно то будет вот такая кнопка - Выполните вход в личный кабинет на сайте ЛитРес с вашим логином и паролем.
- В правом верхнем углу сайта нажмите «Мои книги» и перейдите в подраздел «Мои».
- Нажмите на обложку книги -"19 смертных грехов, угрожающих безопасности программ", чтобы скачать книгу для телефона или на ПК.
В разделе «Скачать в виде файла» нажмите на нужный вам формат файла:
Для чтения на телефоне подойдут следующие форматы (при клике на формат вы можете сразу скачать бесплатно фрагмент книги "19 смертных грехов, угрожающих безопасности программ" для ознакомления):
- FB2 - Для телефонов, планшетов на Android, электронных книг (кроме Kindle) и других программ
- EPUB - подходит для устройств на ios (iPhone, iPad, Mac) и большинства приложений для чтения
Для чтения на компьютере подходят форматы:
- TXT - можно открыть на любом компьютере в текстовом редакторе
- RTF - также можно открыть на любом ПК
- A4 PDF - открывается в программе Adobe Reader
Другие форматы:
- Сохраните файл на свой компьютер или телефоне.
Видео по теме - ТЕТРАДЬ СМЕРТИ ЗА 63 МИНУТЫ