Skip to content

Instantly share code, notes, and snippets.

@ts0818
Created November 5, 2015 08:03
Show Gist options
  • Save ts0818/10c0d490904c9dd5a764 to your computer and use it in GitHub Desktop.
Save ts0818/10c0d490904c9dd5a764 to your computer and use it in GitHub Desktop.
パーフェクトPHP eval攻撃
<?php
/**
* このプログラムは脆弱性のサンプルです。
* 公開サーバに設置しないでください
*/
$string = 'こたんたにたちたわた、世界!';
eval("echo htmlspecialchars(str_replace('" . $_GET['keyword'].
"','', '".$string."'), ENT_QUOTES, 'UTF-8');");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment