Example: dental hygienist

GCFA Gold, CISSP, MCTS, MCDBA, MCSD, MCSE Kevvie Fowler

SQL server Database ForensicsKevvie Fowler , GCFA gold , cissp , mcts , mcdba , mcsd , MCSEB lack Hat USA 20072 SQL server Forensics | Why are Databases Critical Assets? Why are databases critical assets? Databases hold critical information Industry trends are scaling in versus out Database servers today hold more sensitive information than ever before Data security legislations & regulations dictate that security breaches must be reported Database security breaches are Front Page news Maxx | million credit/debit cards disclosed CardSystems Solutions | 200,000 credit/debit cards disclosed3 SQL server Forensics | The Problem With Traditional Forensics Traditional investigations often exclude databases4 SQL server Forensics | The Solution Database ForensicsThe application of computer investigation and analysis techniques to gather databaseevidence suitable for presentat

4 SQL Server Forensics | The Solution Database Forensics The application of computer investigation and analysis techniques to gather database evidence suitable for presentation in a court of law

Tags:

  Analysis, Gold, Server, Sql server, Cissp, Esmc, Mcts, Mcdba, Mcsd

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of GCFA Gold, CISSP, MCTS, MCDBA, MCSD, MCSE Kevvie Fowler

1 SQL server Database ForensicsKevvie Fowler , GCFA gold , cissp , mcts , mcdba , mcsd , MCSEB lack Hat USA 20072 SQL server Forensics | Why are Databases Critical Assets? Why are databases critical assets? Databases hold critical information Industry trends are scaling in versus out Database servers today hold more sensitive information than ever before Data security legislations & regulations dictate that security breaches must be reported Database security breaches are Front Page news Maxx | million credit/debit cards disclosed CardSystems Solutions | 200,000 credit/debit cards disclosed3 SQL server Forensics | The Problem With Traditional Forensics Traditional investigations often exclude databases4 SQL server Forensics | The Solution Database ForensicsThe application of computer investigation and analysis techniques to gather databaseevidence suitable for presentation in a court of law Benefits Retrace user DML & DDL operations Identify data pre and post transaction Recover previously deleted data rows Can help prove/disprove a data security breach Can help determine the scope of a database intrusion For the real world.

2 No dependency on 3rd party auditing tools or pre-configured DML orDDL triggers5 SQL server Forensics | Database Forensics Primer(1) Database files Data files (.mdf) contain the actual data Consists of multiple data pages Data rows can be fixed or variable length Log files (.ldf) hold all data required to reverse transactions and recover the database Physical log files consist of multiple Virtual Log Files (VLF) A VLF is the unit of truncation for the transaction log According to Microsoft: Although you might assume that reading the transaction log directly would be interesting or even useful, it s just too much information.

3 Inside SQL server 2005: The Storage Engine, Microsoft Press, 2006 VLF #2(Inactive )VLF #3(Active)VLF #4( Inacti ve )VLF #1( Inacti ve )FreeSpacePage01:0059 Page01:0060 Page01:0067 Data RowPage HeaderData RowData RowPage01:0067 Row offset arrayData server Forensics | Database Forensics Primer(2)Inside the transaction log:1. CurrentLSN2. Operation3. Context4. Transaction ID5. Tag Bits6. Log Record Fixed Length7. Log Record Length8. PreviousLSN9. Flag Bits10. AllocUnitID11. AllocUnitName12. Page ID13. Slot ID14. Previous Page LSN15. PartionID16. RowFlags17. Num Elements18. Offset in Row19.

4 Checkpoint Begin20. CHKPT Begin DB Version21. MaxXDESID22. Num Transactions23. Checkpoint End24. CHKPT End DB Version25. Minimum LSN26. Dirty Pages27. Oldest Replicated Begin LSN28. Next Replicated End LSN29. Last Distributed End LSN30. server UID31. UID32. SPID33. BeginLogStatus34. Begin Time35. Transaction Name36. Transaction SID37. End Time38. Transaction Begin39. Replicated Records40. Oldest Active LSN41. server Name42. Database Name43. Mark Name44. Master XDESID45. Master DBID46. PrepLogBegin LSN47. PrepareTime48. Virtual Clock49. Previous Savepoint50. Savepoint Name51. Rowbits First Bit52.

5 Rowbits Bit Count53. Rowbits Bit Value54. Number of Locks55. Lock Information56. LSN Before Wrties57. Pages Written58. Data Pages Delta59. Reserved Pages Delta60. Used Pages Delta61. Data Rows Delta62. Command Type63. Publication ID64. Article ID65. Partial Status66. Command67. Byte Offset68. New Value69. Old Value70. New Split Page71. Rows Deleted72. Bytes Freed73. CI Table ID74. CI Index ID75. NewAllocationUnitID76. FIlegroupID77. Meta Status78. File Status79. File ID80. Physical Name81. Logical Name82. Format LSN83. RowsetID84. TextPtr85. Column Offset86. Flags87. Text Size88. Offset89.

6 Old Size90. New Size91. Description92. Bulk allocated extent count93. Bulk rowinsertID94. Bulk allocationunitID95. Bulk allocation first IAM Page ID96. Bulk allocated extent ids97. RowLog Contents 098. RowLog Contents 199. RowLog Contents 2100. RowLog Contents 3101. RowLog Contents 47 SQL server Forensics | Database Forensics Primer(3) server Process ID (SPID) A unique value used by SQL server to track a given session within the database server Transaction log activity is logged against the executing SPID Data type storage and retrieval 31 different data types Data types are stored and retrieved differently within SQL server Little-endian ordering (LEO) is applicable to selected data types Storing and retrieving value: 21976 in various data types results in the following.

7 Procedure Cache Contains ad-hoc and parameterized statements8 SQL server Forensics | Database Evidence Repositories SQL server data resides natively within SQL server and storedexternally within the native Windows operating system Evidence repositories SQL server Volatile database data Database data files Database log files Plan cache Data cache Indexes Tempdb Version store Operating System Trace files System event logs SQL server error logs Page file Memory9 SQL server Forensics | Investigation Tools SQL server Management Studio Express SQLCMD Windows Forensic Toolchest DD\DCFLDD MD5 SUM Netcat\CryptCat WinHex Native SQL server views, functions and statements Dynamic Management Views (DMV) Database Consistency Checker (DBCC) commands FN_* Lots of sanitized acquisition media10 SQL server Forensics | Evidence Collection(1)Evidence Collection11 SQL server Forensics | Evidence Collection(2) Determine the scope of evidence collection Prioritize evidence collection1.

8 Volatile database data (sessions/connections, active requests, active users, memory, etc.)2. Transaction logs3. Database files4. SQL server error logs5. System event logs6. Trace files12 SQL server Forensics | Evidence Collection(3) Collecting volatile database data Can be automated using WFT & command line SQL tools GUI front end, binary validation and thorough logging Gathers volatile data internal and external to SQL Server13 SQL server Forensics | Evidence Collection(4) SQLCMD Load command line tool and establish logging Collecting the active transaction log Determine on disk locations of the transaction log filesResults.

9 14 SQL server Forensics | Evidence Collection(5) Collecting the active transaction log (cont d) Gather the VLF allocationsResults:2 = Active0 = Recoverable or unused15 SQL server Forensics | Evidence Collection(6) Collecting the active transaction log (cont d) Fn_dblog filters transactions by: Target database object Specific columns SPID and/or date/time rangeSelect * from ::fn_dblog(NULL, NULL) DBCC Log More resource intensive Dumps transaction log in its entiretydbcc log(<databasename>, 3)0 = minimal info1 = slightly more info2 = detailed info including (page id, slot id, etc.)3 = full information about each operation4 = full information on each operation in addition to hex dump of current data row16 SQL server Forensics | Evidence Collection(7) Collecting the database plan cache Collecting the plan cacheselect * from cross (plan_handle) Collect additional plan cache specifics- select * from select * from cross (plan_handle) Collecting database data files & logs (\\Microsoft SQL server \ \MSSQL\DATA\*.)

10 MDF | *.LDF) Collecting default trace files (\\Microsoft SQL server \ \MSSQL\LOG\LOG_#.TRC) Collecting SQL server error logs (\\Microsoft SQL server \ \MSSQL\LOG\ERRORLOG) Collecting system event log (WFT)17 SQL server Forensics | Evidence analysis (1)Evidence Analysis18 SQL server Forensics | Evidence analysis (2) Windows event log SQL server authentication data (failures, successful log-on/off) SQL server startup and shutdown IP addresses of SQL server client connections Error log SQL server authentication data (failures, successful log-on/off) SQL server startup and shutdown IP addresses of SQL server client connections19 SQL server Forensics | Evidence analysis (3)


Related search queries