Last active
August 8, 2019 09:43
-
-
Save Tsutou/5ac5ae976b620480e2fdc3b901012078 to your computer and use it in GitHub Desktop.
Webセキュリティ覚書 : "攻撃" 編 [ 初学者向け ] ref: https://qiita.com/Tsutou/items/4fd498f8ab2638bd5650
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM users WHERE id='$user_id' and password='$password' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM users WHERE id='$user_id' and password='' or '1' = '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://hanzai.com?location=%0d%0d<script type=”text/javascript”>alert(“アホなの?”);</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<str><data1>aaa</data1><data2>bbb</data2></str> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE str [ | |
<!ENTITY pass SYSTEM "/etc/password"> | |
]> | |
<str><data1>&password;</data1><data2></data2></str> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM users WHERE id= ? and password= ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = "SELECT * FROM users WHERE id= ? and password= ? "; | |
//プリペアードステートメント->実行したいSQLをコンパイルした一種のテンプレート | |
$sth = $dbh->prepare($sql); | |
//1つ目の?にバインド | |
$sth->bindParam(1, $user_id, PDO::PARAM_STR); | |
//2つ目の?にバインド | |
$sth->bindParam(2, $password, PDO::PARAM_INT); | |
//PDPStatement::excecute-> プリペアドステートメントを実行する | |
$sth->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name= 'nickname' > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $_POST['nickname']; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type=”text/javascript”> | |
alert("お前はアホなのか?"); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
& => & | |
< => < | |
> => > | |
" => " | |
' => ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escape($str) { | |
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106662 | |
106664 | |
106666 | |
106668 | |
106669 | |
106675 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment