검색결과 리스트
2010/01에 해당되는 글 5건
- 2010/01/28 백업기록 조회 (1)
- 2010/01/28 데이터베이스 간략정보 추출 쿼리 (4)
- 2010/01/28 UTC 시간을 확인하기 위한 스크립트
- 2010/01/27 2년전 백업 정보 삭제 쿼리(mssql 2000)
- 2010/01/27 WebDAV 인증 우회에 대한 취약점
글
MSSQL 2005 이상부터 사용이 가능합니다.
IF OBJECT_ID('TEMPDB..#TMP_BACKUPHISTORY') IS NOT NULL
DROP TABLE #TMP_BACKUPHISTORY
SELECT *
INTO #TMP_BACKUPHISTORY
FROM (
select s.server_name, s.database_name, workname = s.name, s.backup_set_id, s.backup_finish_date,
mdf_file=f.physical_name , backup_file = m.physical_device_name ,f.file_size
from msdb..backupset s, msdb..backupmediafamily m , msdb..backupfile f
where s.media_set_id=m.media_set_id and f.backup_set_id=s.backup_set_id
and s.type='D' and f.file_type='D' and has_dbaccess(s.database_name)=1
and s.database_name not in (N'tempdb', N'model', N'msdb')
and s.backup_finish_date > DATEADD(dd,-7,CONVERT (char(10), CURRENT_TIMESTAMP, 20))
) A
select * from #TMP_BACKUPHISTORY
DROP TABLE #TMP_BACKUPHISTORY
트랙백
댓글
글
MSSQL 2005 이상부터 사용이 가능합니다.
SELECT sysDa.Name,sysDa.create_date,sysDa.recovery_model_desc, temp.DBSize8KBPage
FROM
(
SELECT sysMas.database_ID, sysMas.size, (sum(size)*8/1024)-2 AS DBSize8KBPage
FROM sys.master_Files sysMas
WHERE sysMas.file_guid is Not Null and sysMas.type=0
GROUP BY sysMas.DataBase_ID, sysMas.size
)
temp
INNER JOIN
Sys.DATABASES sysDa
ON temp.Database_ID = sysDa.DataBase_ID
WHERE sysDa.Name Not In (N'tempdb', N'model', N'master', N'msdb', N'ReportServerTempDB',N'ReportServer')
'윈도우' 카테고리의 다른 글
| 윈도우 업데이트 에러 0x80070422 (0) | 2010/02/09 |
|---|---|
| IIS7 에서는 일반연결(http) 와 보안연결(https) 간 세션유지가 되지 않습니다. (2) | 2010/02/06 |
| 데이터베이스 간략정보 추출 쿼리 (4) | 2010/01/28 |
| UTC 시간을 확인하기 위한 스크립트 (0) | 2010/01/28 |
| 2년전 백업 정보 삭제 쿼리(mssql 2000) (0) | 2010/01/27 |
| WebDAV 인증 우회에 대한 취약점 (0) | 2010/01/27 |
트랙백
댓글
글
http://www.u229.no/stuff/snippets/UTC.asp
http://www.paulsadowski.com/wsh/timestamp.htm
Sample output:
timestamp.vbs
1041812764
timestamp.vbs 1041812764
Mon Jan 6 00:26:04 2003
You can specify multiple timestamps on the command-line.
Please change the constant 'off' to reflect the offset in hours from UTC for your locale.
--------------------------------------------------------------------------------
An example script:
' Your timezone's offset, in hours, from UTC (change for your locale)
Const off = -5
args = WScript.Arguments.Count
if args = 0 then
SecsSince = CLng(DateDiff("s", "01/01/1970 00:00:00", Now))
wscript.echo SecsSince - 3600 * abs(off)
else
for x = 0 to args - 1
dt = DateAdd("s", WScript.Arguments.Item(x), "01/01/1970 00:00:00")
fdt = FormatDateTime(DateValue(dt))
ftm = FormatDateTime(TimeValue(dt))
if Len(fdt) < 10 then
fdt = space(10 - Len(fdt)) & fdt
end if
if Len(ftm) = 10 then
ftm = " " & ftm
end if
ThisTime = fdt & " " & ftm
Wscript.Echo WeekDayName(WeekDay(ThisTime), true) &_
space(1) & MonthName(Month(ThisTime), true) & space(1) &_
Day(ThisTime) & space(1) & right("00" & Hour(ThisTime), 2) &_
":" & right("00" & Minute(ThisTime), 2) & ":" & right("00" &_
Second(ThisTime), 2) & space(1) & Year(ThisTime)
next
end if
--------------------------------------------------------------------------------
Bare Functions
Function TS2Date(TS)
TS2Date = DateAdd("s", TS, "01/01/1970 00:00:00")
End Function
Function UDateNow()
UDateNow = CLng(DateDiff("s", "01/01/1970 00:00:00", Now))
End Function
Function UDate(ThisDate)
UDate = CLng(DateDiff("s", "01/01/1970 00:00:00", ThisDate))
End Function
'윈도우' 카테고리의 다른 글
| IIS7 에서는 일반연결(http) 와 보안연결(https) 간 세션유지가 되지 않습니다. (2) | 2010/02/06 |
|---|---|
| 데이터베이스 간략정보 추출 쿼리 (4) | 2010/01/28 |
| UTC 시간을 확인하기 위한 스크립트 (0) | 2010/01/28 |
| 2년전 백업 정보 삭제 쿼리(mssql 2000) (0) | 2010/01/27 |
| WebDAV 인증 우회에 대한 취약점 (0) | 2010/01/27 |
| 커맨드라인의 활용 - 변수를 쓰자 (5) | 2009/12/15 |
트랙백
댓글
글
DECLARE @backupID int
DECLARE @mediaID int
DECLARE @restoreID int
DECLARE @year char(4)
DECLARE @month char(2)
DECLARE @day char(2)
DECLARE @deleteday char(10)
SET @year = year(getdate())-2 -- 2년전
SET @month = month(getdate())
SET @day = day(getdate())
IF len(@month) = 1
SET @month = '0'+ @month
IF len(@day) = 1
SET @day = '0'+ @day
SET @deleteday = @year +'-'+ @month +'-'+ @day
SELECT TOP 1 @backupID = backup_set_id, @mediaID = media_set_id from msdb..backupset
where
backup_finish_date > @deleteday
SELECT TOP 1 @restoreID = restore_history_id From msdb..restorehistory
Where
restore_date > @deleteday
delete from msdb..restorefile where restore_history_id < @restoreID
delete from msdb..restorefilegroup where restore_history_id < @restoreID
delete from msdb..restorehistory where restore_history_id < @restoreID or backup_set_id < @backupID
delete from msdb..backupfile where backup_set_id < @backupID
delete from msdb..backupmediafamily where media_set_id < @mediaID
delete from msdb..backupset where backup_set_id < @backupID
use msdb
DBCC SHOWCONTIG
DBCC DBREINDEX (restorefile, '', 100)
DBCC DBREINDEX (restorefilegroup, '', 100)
DBCC DBREINDEX (restorehistory, '', 100)
DBCC DBREINDEX (backupfile, '', 100)
DBCC DBREINDEX (backupmediafamily, '', 100)
DBCC DBREINDEX (backupset, '', 100)
'윈도우' 카테고리의 다른 글
| 데이터베이스 간략정보 추출 쿼리 (4) | 2010/01/28 |
|---|---|
| UTC 시간을 확인하기 위한 스크립트 (0) | 2010/01/28 |
| 2년전 백업 정보 삭제 쿼리(mssql 2000) (0) | 2010/01/27 |
| WebDAV 인증 우회에 대한 취약점 (0) | 2010/01/27 |
| 커맨드라인의 활용 - 변수를 쓰자 (5) | 2009/12/15 |
| [ASP] Session.Timeout 최대값은 24시간 (2) | 2009/12/08 |
트랙백
댓글
글
WebDAV 인증 우회에 대한 취약점
마이크로소프트 보안 권고문 971492(http://www.microsoft.com/technet/security/advisory/971492.mspx)이 5월 18일자로 공지되었습니다.
Microsoft Internet Information Services (이하 IIS) 의 WebDAV 를 사용하는 경우에 발생할수 있습니다.
WebDAV 에서 유니코드(동아시아 언어권에서 주로사용)로 코드를 처리하는 과정에서 발생하는 취약점으로
HTTP GET 요청에 "Translate: f" 를 HTTP 해더에 추가하여서 WebDAV폴더로 파일을 업로드 하는 방법 입니다.
다음에 해당하시는 분들에게 영향을 줄수 있는 내용입니다.
- IIS 5.x, IIS 6 의 버전을 사용
- WebDAV 를 사용 (IIS 6.0 에서는 기본적으로 WebDAV 가 비활성화되어 있습니다. )
대응 방법
1. 파일 ACL 을 이용해서 웹서비스에 사용되는 IUSR_<computername> 계정에 대한 쓰기 거부
기술문서 : IIS 5.0 웹 서버에 필요한 NTFS 권한 및 사용자 권한을 설정하는 방법
http://support.microsoft.com/kb/271071
2. WebDAV 설정의 비활성화
기술문서 : IIS 5.0용 WebDAV를 해제하는 방법
http://support.microsoft.com/kb/241520
3. URLScan 을 이용한 요청제한
기술문서 : UrlScan Security Tool (기본설정으로는 서비스에 문제가 있을수 있으니 반드시 테스트후 적용해야합니다.)
http://technet.microsoft.com/en-us/security/cc242650.aspx
4. Webknight 를 이용한 방법 ( 2.2 버젼 기준 )
- Web Applications - Allow WebDAV 비활성
해제방법펼쳐두기..
참고1. 윈도우 버전별 IIS 의 버전
Windows 2000 - IIS 5.0
Windows XP - IIS 5.1
Windows 2003 - IIS 6.0
Windows 2008 - IIS 7.0
참고2. 참조문서
- IIS 인증우회에 대한 추가정보
http://blogs.technet.com/srd/archive/2009/05/18/more-information-about-the-iis-authentication-bypass.aspx
- WebDAV 인증우회에 대한 추가정보
http://blogs.technet.com/srd/archive/2009/05/20/answers-to-the-iis-webdav-authentication-bypass-questions.aspx
'윈도우' 카테고리의 다른 글
| UTC 시간을 확인하기 위한 스크립트 (0) | 2010/01/28 |
|---|---|
| 2년전 백업 정보 삭제 쿼리(mssql 2000) (0) | 2010/01/27 |
| WebDAV 인증 우회에 대한 취약점 (0) | 2010/01/27 |
| 커맨드라인의 활용 - 변수를 쓰자 (5) | 2009/12/15 |
| [ASP] Session.Timeout 최대값은 24시간 (2) | 2009/12/08 |
| 좋은 저장프로시저를 위한 21가지 팁 (14) | 2009/08/11 |
thank for your sharing,i like it very much!