MSSQL Forensic을 위한 Query

in kr •  6 years ago 

데이터베이스는 그 양이 방대하여 삭제된 영역의 복구가 쉽지 않다. Apex라는 툴을 MS-SQL에서 제공하기는 하나, 이는 서버 관리 차원에서의 도구로 디지털 포렌식에 십분 활요하기 어렵다.

데이터베이스 내에서 삭제된 레코드를 복구하는 방법은 크게 다음 네 단계로 나눌 수 있다.

  1. Table List 획득
  2. Scheme 획득
  3. Table의 Data Page 리스트 획득
  4. Page의 미할당영역 탐색
  5. 복구

1~3 단계는 메타데이터를 획득하는 과정, 4~5는 실질적으로 복구하는 과정이다.

메타데이터를 획득하는 과정이 특히 중요한데, 조사관이 분석PC에서 압수한 DB를 SQL에 올릴 수 있는 경우에는 Query를 사용하여 DB 정보를 획득할 수 있다.

select name, id from sysobjects where type='U'
select COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '[table name]'
select COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION,CHARACTER_MAXIMUM_LENGTH from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '[table name]'
 
dbcc traceon(3604)
go
dbcc ind (0,'[table name]',-1)

dbcc page(0,1,[page number],1)



일반적으로 DBCC (DataBase Consistency Checker)는 시스템 관리자의 DB관리를 목적으로 사용되나, 디지털 포렌식에서도 유용하게 사용된다. ( 참고 : http://msdn.microsoft.com/en-us/library/ms188796.aspx )

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @forensicmon! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

Are you a DrugWars early adopter? Benvenuto in famiglia!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!