<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.other.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'book.taint.php',
    1 => 'Taint',
    2 => 'Taint',
  ),
  'up' => 
  array (
    0 => 'refs.basic.other.php',
    1 => 'Outras Extens&otilde;es B&aacute;sicas',
  ),
  'prev' => 
  array (
    0 => 'yaconf.has.php',
    1 => 'Yaconf::has',
  ),
  'next' => 
  array (
    0 => 'taint.setup.php',
    1 => 'Instala&ccedil;&atilde;o/Configura&ccedil;&atilde;o',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/taint/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.taint.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.taint" class="book">
 
 <h1 class="title">Taint</h1>
 

 <div id="intro.taint" class="preface">
  <h1 class="title">Introdução</h1>
  <p class="para">
   Taint é uma extensão usada para detectar códigos XSS (strings
   contaminadas).
   E também pode ser usada para identificar vulnerabilidades de
   injeção de SQL, injeção de shell, etc.
  </p>
  <p class="para">
   Quando o taint está habilitado, se for passada uma string contaminada (proveniente de <var class="varname"><a href="reserved.variables.get.php" class="classname">$_GET</a></var>,
   <var class="varname"><a href="reserved.variables.post.php" class="classname">$_POST</a></var> ou <var class="varname"><a href="reserved.variables.cookies.php" class="classname">$_COOKIE</a></var>) para algumas funções, o taint irá avisár sobre isso.
  </p>
  <div class="example" id="example-1">
   <p><strong>Exemplo #1 Exemplo de <span class="function"><a href="function.taint.php" class="function">Taint()</a></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #DD0000">'a'</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB">$file_name </span><span style="color: #007700">= </span><span style="color: #DD0000">'/tmp' </span><span style="color: #007700">.  </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$output    </span><span style="color: #007700">= </span><span style="color: #DD0000">"Welcome, </span><span style="color: #007700">{</span><span style="color: #0000BB">$a</span><span style="color: #007700">}</span><span style="color: #DD0000"> !!!"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$var       </span><span style="color: #007700">= </span><span style="color: #DD0000">"output"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql       </span><span style="color: #007700">= </span><span style="color: #DD0000">"Select *  from " </span><span style="color: #007700">. </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql      </span><span style="color: #007700">.= </span><span style="color: #DD0000">"ooxx"</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #0000BB">$output</span><span style="color: #007700">;<br /><br />print $</span><span style="color: #0000BB">$var</span><span style="color: #007700">;<br /><br />include </span><span style="color: #0000BB">$file_name</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>O exemplo acima produzirá
algo semelhante a:</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
Warning: main() [function.echo]: Attempt to echo a string that might be tainted

Warning: main() [function.echo]: Attempt to print a string that might be tainted

Warning: include() [function.include]: File path contains data that might be tainted

Warning: mysql_query() [function.mysql-query]: SQL statement contains data that might be tainted
</pre></div>
   </div>
  </div>
 </div>

 






 






 







<ul class="chunklist chunklist_book"><li><a href="taint.setup.php">Instala&ccedil;&atilde;o/Configura&ccedil;&atilde;o</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="taint.installation.php">Instala&ccedil;&atilde;o</a></li><li><a href="taint.configuration.php">Configura&ccedil;&otilde;es em Execu&ccedil;&atilde;o</a></li></ul></li><li><a href="taint.detail.php">Mais detalhes</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="taint.detail.basic.php">Fun&ccedil;&otilde;es e instru&ccedil;&otilde;es que espalhar&atilde;o a marca contaminada de uma
   string contaminada</a></li><li><a href="taint.detail.taint.php">Fun&ccedil;&otilde;es e instru&ccedil;&otilde;es que verificar&atilde;o strings contaminadas</a></li><li><a href="taint.detail.untaint.php">Fun&ccedil;&otilde;es que descontaminam a string contaminada</a></li></ul></li><li><a href="ref.taint.php">Fun&ccedil;&otilde;es de Taint</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.is-tainted.php">is_tainted</a> — Verifica se uma string est&aacute; contaminada</li><li><a href="function.taint.php">taint</a> — Contamina uma string</li><li><a href="function.untaint.php">untaint</a> — Descontamina strings</li></ul></li></ul></div><?php manual_footer($setup); ?>