SlideShare a Scribd company logo
Assignment 2 of Database (Database Security)
Group 8
• นายเฉลิมเกียรติชนะชาญ
• นายธนวิชญ์โทราช
• นสอัญธิกาหนองบัว
Assignment 2
Database Security
Compare With File-System Security (Permission)
• Standard Permission เป็น Permission ที่ได้นำเอำ Special
Permission มำจัดกลุ่มให้จำนวนรำยกำรลดลงเหลือเพียง4 กลุ่มสำหรับ
แฟ้ มข้อมูลได้แก่
Database Security
Compare With File-System Security (Permission)
• Read(RX) ประกอบด้วย Special Access 2 รำยกำรคือ Read และ Execute
ซึ่งหมำยถึงสำมำรถอ่ำนข้อมูล และเรียกโปรแกรมมำทำงำน (ถ้ำแฟ้ มนั้นเป็นโปรแกรมรวม)
• Change(RWXD) ใช้สำหรับอ่ำน/แก้ไข/ลบข้อมูล
• Full Control(RWXDPO) สำมำรถทำรำยกำรได้ทั้งหมด
• No Access() ไม่สำมำรถเรียกดูข้อมูลได้ ถึงแม้ว่ำจะอยู่ในกลุ่มที่กำหนดให้เรียกดูได้ (หมำยถึง
No Access จะ Overwrite ควำมสำมำรถอื่น) รำยกำรสำหรับโฟลเดอร์ ได้แก่ (รูปแบบกำร
แสดงเป็ น xxxx (dir-permission) (file-permission) วงเล็บแรกเป็นกำรกำหนดสิทธิ
สำหรับโฟลเดอร์นั้น ส่วนวงเล็บหลังเป็นกำรกำหนดสิทธิของแฟ้ มข้อมูลในโฟลเดอร์นั้น
Assignment 2 of Database (Database Security)
Specifications of
Computer
Assignment 2 of Database (Database Security)
Simple Database For
A1 User
TablesName Users Passenger Airport Staff Admins
Airport R CRU Full Control (CRUD)
Airplane_Type - CRU Full Control (CRUD)
Airplane - CRU Full Control (CRUD)
Leg_Instance - CRU Full Control (CRUD)
Seat R CRU Full Control (CRUD)
Flight_Leg R CRU Full Control (CRUD)
Flight R CRU Full Control (CRUD)
Fare R CRU Full Control (CRUD)
Can_Land - CRU Full Control (CRUD)
Discretionary
Access Control
R: Read, Retrieve C: Create U: Update, Modify D: Delete, Destroy
Create User
•Mysql
Create User
•Mysql
คำสั่งที่ใช้
ผลลัพธ์ที่ได้
•Mysql
Passenger
คำสั่งที่ใช้
•Mysql
สิทธิ์ที่ user Passenger สำมำรถเข้ำถึงได้
•Mysql
Airport Staff
คำสั่งที่ใช้
ผลลัพธ์ที่ได้
•Mysql
Admins
คำสั่งที่ใช้
ผลลัพธ์ที่ได้
•PostgreSQL
Create user
•PostgreSQL
คำสั่งที่ใช้
ผลที่ได้
•PostgreSQL
Passenger
คำสั่งที่ใช้
•PostgreSQL
Airport Staff
คำสั่งที่ใช้
•PostgreSQL
Admins
คำสั่งที่ใช้
•PostgreSQL
ผลลัพธ์ที่ได้
•SQLite3
คำสั่งที่ใช้
สร้ำง user ubuntu ขึ้นมำ 2 user โดยที่ admins จะ ทำได้ทุกอย่ำง เช่นกำรอ่ำนข้อมูล
•SQLite3
Passenger จะอ่ำนได้อย่ำงเดียว ถ้ำ insert จะขึ้นดังรูป
admin insert+select ได้
Database Log Files
Database Log Files
• ตำแหน่งข อง Log files
ใน Ubuntu : /var/log/postgresql/
การดู Database Log Files
• สำมำรถกดดูได้ด้วยคำสั่ง cat , tail , head , nano , gedit
ตัวอย่ำง tail postgresql-9.3-main.log
ตัวอย่ำง nano postgresql-9.3-main.log
Backup/Restore
Backup /Restore Database Files
• Backup ใช้คำสั่ง pg_dump –Fc Database Name > Backup_Name.bak
หรือ pg_dump –Ft Database Name > Backup_Name.tar
• Restore ใช้คำสั่ง pg_restore –Fc Database Name > Backup_
Name.bak หรือ pg_resotre –Ft Database Name > Backup_Name.tar
PostgreSQLBackup /Restore
ไฟล์จะอยู่ใน /var/lib/postgreSQL
PostgreSQLBackup /Restore
สร้ำงdatabase ใหม่
คำสั่ง restore
เสร็จแล้วจะปรำกฏดังรูป
PostgreSQLBackup /Restore
SQLite3Backup /Restore
คำสั่ง backup
ไฟล์จะอยู่บน desktop
SQLite3Backup /Restore
คำสั่ง restore
mySQLBackup /Restore
คำสั่ง backup
คำสั่ง restore
mySQLBackup /Restore
Possible unethical uses
of your group database?
•Our Database
about airline reservations system.
 การเปิดเผยข้อมูลลูกค้า (ผู้โดยสาร) เป็นการไม่สมควร
เนื่องจากถือเป็นการละเมิดสิทธิส่วนบุคคล ซึ่งผิดต่อกฎหมาย
และอาจก่อให้เกิดความเสียหายได้
 การเปิดเผยข้อมูลเที่ยวบิน เนื่องจากอาจก่อให้เกิดความเสียหาย
ต่อสายการบิน ทั้งด้านความปลอดภัย และความน่าเชื่อถือ อาจเป็น
เหตุทาให้เกิดการก่ออาชญากรรมบนเครื่องบินได้ง่าย เพราะทราบ
ข้อมูลทั้งหมดแล้ว
SQL Injection
• SQL INJECTION
SQL injection is a technique where malicious users can inject SQL commands into an SQL
statement, via web page input.
เป็นเทคนิคที่ผู้ประสงค์ร้ายสามารถบีบคาสั่งของ SQL เข้าไปในข้อความ SQL ผ่านทางหน้าเวปเพจ
Injected SQL commands can alter SQL statement and compromise the security of a web
application.
คาสั่ง SQL ที่ถูกบีบอัด สามารถปรับเปลี่ยนคาสั่ง SQL และยอมรับความปลอดภัยของเวป
แอปพิเคชั่น
• Example of SQL Injection
ต้องกำรค้นหำข้อมูลสำยกำรบิน DMK
คำสั่ง SELECT * FROM Airport WHERE Airport_code = ‘DMK’;
• Example of SQL Injection
และถ้ำเพิ่ม or 1=1
คำสั่ง SELECT * FROM Airport WHERE Airport_code = ‘DMK’ or 1=1;
• How to test SQL Injection
ตรวจสอบเพื่อที่ต้องการหาว่าการค้นหาหรือดึงข้อมูล (Query) จากดาต้าเบส นั่นถูกต้องตามที่
ต้องการหรือไม่
ส่วนที่ต้องการตรวจสอบก็คือส่วนที่มีปฏิสัมพันธ์กับข้อมูลโดยตรง
เช่น ส่วนของล็อกอินของผู้ใช้(Authentication) , ส่วนค้นหาข้อมูล(Search Engines) , ส่วนที่กรอก
จานวนสินค้า หรือราคาต่างๆ (E-commerce)
• Standard SQL Injection Testing
1. SQL Injection based on 1 = 1 is always TRUE
2. SQL Injection based on “=“ is alsways TRUE
3. SQL Injection based on batched SQL statements
• SQL Injection Based on ""="" is Always True
SELECT * FROM Airport WHERE Airport_code = ‘DMK’ or 1=1;
• SQL Injection based on “=“ is alsways TRUE
• SQL Injection based on batched SQL statements
Assignment 2 of Database (Database Security)

More Related Content

PPT
Server2Go เว็บพกพาตัวจริง
PDF
Database Tuning for e-Learning
PDF
lesson6 JSP
PDF
lesson4 JSP
DOCX
การตรวจเช็คฐานข้อมูล Oracle v1 draft
 
PDF
Try PostgreSQL on linux
PDF
Example Database normal form
Server2Go เว็บพกพาตัวจริง
Database Tuning for e-Learning
lesson6 JSP
lesson4 JSP
การตรวจเช็คฐานข้อมูล Oracle v1 draft
 
Try PostgreSQL on linux
Example Database normal form

Viewers also liked (20)

PDF
Assignment 1 of Database (MySQL & Sqlite3)
PPTX
Access Database Library Assignment
PPTX
Database Programming Project Assignment
PPT
Er diagram
PDF
Vanson Bourne Data Summary: Shadow IT - BDMs
PPTX
00137
PPT
Mapping
PPT
Special lecture er diagram
PPTX
Er diagrams presentation
PPTX
ICT Students Presentations
PPTX
Unilever
PPT
Eer >r.model
PDF
ER Diagrams Simplified
PDF
Mapping ER and EER Model
PPT
Entity relationship diagram
PPTX
Statistical learning
PPT
enhanced er diagram
PPTX
Enhanced ER(database)
PPTX
Entity Relationship Diagram Templates by Creately
Assignment 1 of Database (MySQL & Sqlite3)
Access Database Library Assignment
Database Programming Project Assignment
Er diagram
Vanson Bourne Data Summary: Shadow IT - BDMs
00137
Mapping
Special lecture er diagram
Er diagrams presentation
ICT Students Presentations
Unilever
Eer >r.model
ER Diagrams Simplified
Mapping ER and EER Model
Entity relationship diagram
Statistical learning
enhanced er diagram
Enhanced ER(database)
Entity Relationship Diagram Templates by Creately
Ad

Similar to Assignment 2 of Database (Database Security) (20)

PPT
Database basic new
PPT
PPT
ส่วนประกอบของคอมพิวเตอร์
PPT
Com element
PPT
Basic linux
PPT
Basic Linux
PPT
Database basic new
PPTX
บทที่ 1
PPT
Database basic new
PDF
Hotspotubuntu8
PDF
NETWORK SERVICEOPENSSH + NTP + SQUID
PPTX
เครื่องมือและเทคนิคการวิเคระห์ในกลุ่มซอฟต์แวร์วิเคราะห์ข้อมูลกิจกรรมแม่ข่ายเว็บ
PDF
วิชาระบบจัดการฐานข้อมูลและการออกแบบ-ปวส.
PDF
คู่มือการติดตั้ง Cent os
PPT
Portable Moodle : Moodle & Server2Go
PDF
Cent OS-book
PPTX
องค์ประกอบของระบบปฏิบัติการ
PPTX
องค์ประกอบของระบบปฏิบัติการ
PPTX
องค์ประกอบของระบบปฏิบัติการ
PDF
Coovaubuntu904
Database basic new
ส่วนประกอบของคอมพิวเตอร์
Com element
Basic linux
Basic Linux
Database basic new
บทที่ 1
Database basic new
Hotspotubuntu8
NETWORK SERVICEOPENSSH + NTP + SQUID
เครื่องมือและเทคนิคการวิเคระห์ในกลุ่มซอฟต์แวร์วิเคราะห์ข้อมูลกิจกรรมแม่ข่ายเว็บ
วิชาระบบจัดการฐานข้อมูลและการออกแบบ-ปวส.
คู่มือการติดตั้ง Cent os
Portable Moodle : Moodle & Server2Go
Cent OS-book
องค์ประกอบของระบบปฏิบัติการ
องค์ประกอบของระบบปฏิบัติการ
องค์ประกอบของระบบปฏิบัติการ
Coovaubuntu904
Ad

More from Aey Unthika (8)

PDF
Assignmet 2 selectedtopic Topic in Computer Engineer
PDF
Assignmet1 selectedtopic Topic in Computer Engineer
PPTX
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
PPTX
To try use XSL for display group XML file movies
PPTX
To try and create DTD and XML Schema
PPTX
Try to Use DOM and SAX API (python)
PDF
Xml parser week2
PDF
Introduction to XML.
Assignmet 2 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer Engineer
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
To try use XSL for display group XML file movies
To try and create DTD and XML Schema
Try to Use DOM and SAX API (python)
Xml parser week2
Introduction to XML.

Assignment 2 of Database (Database Security)