Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SQL Injection
Search
kubo-hide-kun
January 27, 2021
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SQL Injection
kubo-hide-kun
January 27, 2021
More Decks by kubo-hide-kun
See All by kubo-hide-kun
CA BASE NEXT でスクロールに 連動したUIを構築した話
kubo_programmer
1
600
ハイレベルな環境こそが最高である 科学的なお話
kubo_programmer
0
180
IPアドレスとは何か?
kubo_programmer
0
3.8k
クライアント/サーバーシステム
kubo_programmer
0
16k
DHCPサーバ
kubo_programmer
0
3.4k
How to make Readable Slide
kubo_programmer
0
160
AtomicDesignの説明と所感
kubo_programmer
0
2k
Moonblock入門
kubo_programmer
3
1.4k
TCP/UDPの違い
kubo_programmer
4
6.1k
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
「人を評価する AI」の設計と実装
ryoyanara
0
180
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
160
霧の中の代数的エフェクト
funnyycat
1
490
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
540
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
590
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
AIが無かった頃の素敵な出会いの話
codmoninc
1
390
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.1k
Cloudflare is Agents
chimame
0
150
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
450
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
590
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
360
New Earth Scene 8
popppiees
3
2.5k
Darren the Foodie - Storyboard
khoart
PRO
3
3.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
470
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Transcript
42-ΠϯδΣΫγϣϯ 2021.01.28 - クボ太郎
・SQL について ・SQLインジェクション is 何?
SQL について
データベースとは, テキストやデーアを保存するためのツール 3 σʔλϕʔε σʔλϕʔε ニンジン 文字 (例: 名前) 3
数値 (例: 個数)
JE OBNF QSJDF EBUF ΓΜ͝ δϟΨΠϞ
ۄͶ͗ χϯδϯ レコード ( 横 ) カラム ( 縦 ) データベースは,下の図のような表データを管理している. 表のことを「テーブル」,縦の列のことを「カラム」, 横の列のことを「レコード」と呼ぶ.
データベースに送る命令 = クエリ 3 σʔλϕʔε σʔλϕʔε クエリ データ データベース内の 〇〇というデータを下さい!!
・ SELECT文 ・ INSERT文 ・ UPDATE文 ・ DELETE文 ・・・ ・・・
・・・ ・・・ データを取得する命令 データを追加する命令 データを更新する命令 データを削除する命令 SQLでよく使われるクエリ
SQLインジェクション is 何?
SQLインジェクションとは, Webサイトの入力フォームなどに『SQLクエリを含む文字列』を入力することで, デーアベースを不正操作するサイバー攻撃の一種です. ID: PASSWORD: SQL文を含む文字列を 「ID」 や 「PASSWORD」 に入力
ログイン成功
攻撃事例: 前提条件として,以下のようなSQL文で画面から入力された 「ID」と「パスワード」がデータベースに存在するか確認し、 存在すればログイン成功、存在しなければログイン失敗と判断します。 SELECT id, pass FROM login_user WHERE
id=‘入力されたid’ AND pass=‘入力されたパスワード’; idとpassのデータを 取得する login_userという テーブルから idが ’入力されたid’ と passが ‘入力されたパスワード’ と 一致するもののみという条件
攻撃方法: 「ID」に以下の文字列を入力してログインするだけで不正ログイン可能です。 ※パスワードには何もいれなくて問題ないです。 1’ or ‘1’ = ‘1’; --
なぜ攻撃可能なのか? 「id」の条件が "1" または"1 = 1”という条件になので、結果は必ずtrueです。 そしてSQL文で「--」はコメントアウトを表します。 そのため,条件文「-- AND pass=‘';」はコメントとして扱われ無視されます。
SELECT id, pass FROM login_user WHERE id=‘1’or’1’=‘1’; --’ AND pass=‘ ’;
おしまい !!