'2012/09/26'에 해당되는 글 3건

  1. 2012.09.26 Microsoft IIS 환경에서의 modsecurity 설치,설정방법
  2. 2012.09.26 modsecurity를 활용한 웹보안 강화
  3. 2012.09.26 [sql injection]sqlmap

Microsoft IIS 환경에서의 modsecurity 설치,설정방법

|

Modsecurity의 IIS 설치 msi파일을 통해 Microsoft IIS에서도 Modsecurity 웹서버 보안강화도구를 사용할 수 있다.

아래는 IIS에서 Modsecurity를 설치, 설정하는 방법이다. 만약, IIS에서 Modsecurity를 사용하고자 한다면, 참고가 되시길..

또한, Modsecurity를 설치하기 위해 사전에 설치해야 하는 목록에 추가적으로 .NET Framework이 필요하다.(참고하세요)

 

Installation for Microsoft IIS

The source code of ModSecurity’s IIS components is fully published and the binary building process is described (see mod_security/iis/winbuild/howto.txt). For quick installation it is highly recommended to use standard MSI installer available from SourceForge files repository of ModSecurity project or use binary package and follow the manual installation steps.

Manually Installing and Troubleshooting Setup of ModSecurity Module on IIS

Prerequisites

Before installing ModSecurity one has to install Visual Studio 2010 Runtime:

Installation Steps

Download binary package and unzip the content to a separate folder:

The installation process of ModSecurity module on IIS consists of three parts:


1. Copying of binaries: copyfiles.bat
The following binary files are required by ModSecurity module and by default should be copied to %windir%\system32\ (32-bit binaries) and/or %windir%\SysWOW64\ (64-bit binaries):
  • libapr-1.dll
  • libapriconv-1.dll
  • libaprutil-1.dll
  • libxml2.dll
  • lua5.1.dll
  • ModSecurityIIS.dll
  • pcre.dll
  • zlib1.dll
The mlogc tool can be copied to any place, together with libcurl.dll:
  • libcurl.dll
  • mlogc.exe


2. Registering of the module: register.bat
An IIS module must be properly registered before it can be used by web applications. The following command, executed in %windir%\system32\inetsrv, performs the registration:
appcmd.exe install module /name:ModSecurityIIS /image:%windir%\system32\inetsrv\modsecurityiis.dll
The registration process itself is described with details in the following articles:


3. Extending of the configuration schema.
The last step extends IIS configuration schema with ModSecurity entities, using ModSecurity.xml file provided in the binary:
iisschema.exe /install ModSecurity.xml
and iisschema.exe tool. More information about the tool and this step is available here:

Configuration

After the installation the module will be running in all websites by default. To remove it from a website add to web.config:
<modules>
    <remove name="ModSecurityIIS" />
</modules>
To configure module in a website add to web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <ModSecurity enabled="true" configFile="c:\inetpub\wwwroot\xss.conf" />
    </system.webServer>
</configuration>
where configFile is standard ModSecurity config file.


Events from the module will show up in "Application" Windows log.

Common Problems

If after installation protected website responds with HTTP 503 error and event ID 2280 keeps getting logged in the application event log:
Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Event ID:      2280
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Description:
The Module DLL C:\Windows\system32\inetsrv\modsecurityiis.dll failed to load.  The data is the error.

most likely it means that the installation process has failed and the ModSecurityIIS.dll module is missing one or more libraries that it depends on. Repeating installation of the prerequisites and the module files should fix the problem. The dependency walker tool:

can be used to figure out which library is missing or cannot be loaded.

 

위 내용에 더불어 아래와 같은 msi 설치파일도 있네요..;; 갠히 고생했네;;

아래 파일을 통한 설치도 해보시면 좋겠네요.

 

ModSecurityIIS_2.7.0-rc3.zip

 

설치 후, 설정은 아래 사이트를 참조하세요,,

http://blogs.technet.com/b/srd/archive/2012/07/26/announcing-the-availability-of-modsecurity-extension-for-iis.aspx

And

modsecurity를 활용한 웹보안 강화

|

<Modsecurity>

[Modsecurity]웹서버 Apache의 모듈로 동작하는 공개 SW 웹애플리케이션 방화벽(?)정도의 웹서버 보안강화도구이다. Modsecurity는 서버측에서 접근하는 요청(Request) 트래픽or패킷에 대한 Ruleset을 통해 정의된 트래픽or패킷을 자동으로 차단하는 식으로 동작한다.

 

[Modsecurity의 출현배경]

□ 웹 애플리케이션 취약점 보안을 위한 대대적인 소스 코드 수정이 필요하게 됨.

□ 대 다수의 중소기업이 개발인력 미비로 지속적인 침해사고에 대응 못함.

□ 기존 애플리케이션에 수정 없이 이미 존재하는 취약점에 대하여 능동적인 대응이 필요하게 됨.

 

[Modsecurity의 특징]

□ 웹페이지 주요 취약점 해결을 위해 아파치 모듈로 개발/공개된 웹보안 강화도구

□ 웹에서의 요청(Request)을 웹서버 또는 다른 모듈들이 처리하기 전에 분석/필터링

□ 우회 공격용 스트링("//","\/",".." 등)을 제거하고 인코딩된 URL을 디코딩하는 우회방지기술 적용

□ HTTP 프로토콜을 이해 가능한 엔진을 적용하여 정밀한 필터링 수행

□ GET/POST 메소드 요청분석

□ 모든 요청에 대한 상세 로깅가능이 가능하며, 차단 기능 비활성을 통해 침입탐지 역활수행

□ HTTPS를 통한 공격 필터링 가능

 

[Windows Modsecurity 설치방법]

<설치방법>

1. Modsecurity 설치에 필요한 파일(libxml2.dll, mod_security2.so)을 Apache "Modules" 폴더내에 복사

2. Ruleset파일을 Apache conf 폴더에 복사

<설치 전 주의사항>

※ 윈도우 계열에서 modsecurity를 설치하기 위해서는 Apache 2.2.x 이상 버전에서만 설치 가능

※ VC 2008 Redistributable Package를 설치해야 정상적으로 동작 (윈도우용 modsecurity는 visual studio 2008에서 개발되었기 때문)

※ VC 2008 Redistributable Package 다운로드: http://www.microsoft.com/en-us/download/details.aspx?id=29

<설치 후 주의사항>

※ Apache는 기본저긍로 mod_unique_id.so 모듈이 Disable 되어 있기 때문에 이 모듈을 Enable로 설정변경. (unique_id 모듈은 유닉스 환경과 마찬가지로 modsecurity의 정상적인 필터링을 가능하게 해주는 모듈이다.)

 

[Linux Modsecurity 설치방법]

<설치방법>

1. yum을 통한 설치: yum install mod_security ( or source build )

2. 방화벽에서 사용할 Ruleset 추가/생성

3. 서비스 시작

 

아래 URL은 Modsecurity wiki 페이지이다. 상세한 내용은 아래에서 참고하시길 ...

 

http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Main_Page

 

And

[sql injection]sqlmap

|

<sqlmap>

 

[sqlmap]은 파이썬으로 개발된 Commend 라인 기반의 sql 취약성 점검도구이다.

당연하게도 이 도구는 윈도우/리눅스 모두에서 동작하며(단, 파이썬이 설치된 시스템에서..) Mysql, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase, SAP MaxDB등을 대상으로 한 점검에 매우 강력한 도구이다.

아래와 같은 단점이 있는 듯 보이지만 다양한 DB 점검이 가능하다는 점과, Command 기반의 도구를 잘 활용하면 얻을 수 있는 이점들을 충분히 얻을 수 있을 것같다.

□ 타 도구에 비해 점검시간이 오래걸림.

□ 다양한 DB구성 시, 검사내용의 신뢰도 떨어짐.

 

<sqlmap injection technic>

□ Boolean-based blind

□ Time-based blind

□ Error-based Union query

□ Stacked queries

□ Out-of-band

 

아래는 sqlmap 홈사이트이며, 좀 더 자세한 내용은 홈사이트의 내용을 참조하길 바란다. (물론 아래 위치에서 다운로드도 가능하다. )

★ http://sqlmap.org/

 

 

<Usage>

And
prev | 1 | next