'Snort'에 해당되는 글 2건

  1. 2011.09.19 SNORT+BASE 설치 메뉴얼 (DEBIAN/UBUNTU)
  2. 2009.10.09 byte_test 기능에서 & 연산방법
SNORT2011. 9. 19. 15:15

깔끔하게 정리가 잘되어있습니다.

아래 링크에서 받으실 수 있으며, 혹시나 해서 첨부합니다.


http://binary-zone.com/Projects/howto-install-config-snort.pdf

'SNORT' 카테고리의 다른 글

정규 표현식 기호-2  (0) 2010.03.02
정규 표현식 기호-1  (0) 2010.03.02
byte_test 기능에서 & 연산방법  (0) 2009.10.09
국내 Snort Rule 공유 블로그  (1) 2009.09.15
Posted by regexkorea
SNORT2009. 10. 9. 16:16
공부하고 있는 것이다보니 틀린 부분이 분명히 있을것입니다.. 그리고 영어 이해력이 떨어져서 옵션의 설명이 틀릴 수 있습니다. 틀린 부분에 대한 지적 부탁 드리겠습니다.

byte_test는 특정 필드 값을 연산자를 이용해서 매칭 하는 기능(?)

사용방법
 byte_test: <bytes to convert>, [!]<operator>, <value>, <offset>[,relative] [,<endian>] [,<number type>, string];

byte to convert : 패킷으로 부터 끄집어 낼 byte 수
operator : <,>,=,!,&,^
value : 변환된 값과 비교할 값
offset : payload에서 프로세싱 시작할 byte 수
relative : 마지막으로 패턴 매칭된 offset에서 시작
endian : [byte to convert] 의 값을 big endian 또는 little endian 형태로 처리하는 옵션
            big-big endian으로 테이터 처리(default)
            little-little endian으로 데이터 처리
string :  패킷에서 데이터는 string 형태로 저장된다.(?)
number type : type of number being read
                    hex-변환된 string 데이터는 16진수로 표현된다.
                    dec-변환된 string 데이터는 10진수로 표현된다.
                    oct-변환된 string 데이터는 8진수로 표현된다

위에서 연산자 & 에 대해서 알아보자.
예는 https://forums.snort.org/forums/rules/topics/byte_test-and-the-operator-2 에서 언급된 것으로 해보자.

payload의 첫 16 byte 가 아래와 같다고 하자.
65 98 85 83 00 01 00 00 00 01 00 00 08 63 70 64

byte_test:1,&,2,3

10000101= '85’
00000010 = '2'
.........^ Not set
위 값들을 and 연산하면 아래와 같다.
00000000 ='0' 이기때문에 거짓

byte_test:1,&,1,3 
10000101 = ‘85’
00000001 ='1'
...........^ Set and Match!
00000001 ='1' 이기때문에 참

byte_test:1,&,128,2 
10011000 = ‘98’
10000000 = '128'
^ Not set
00000000 = '0' 이기때문에 거짓

snort에서는 참이면 탐지하는 것이다.

참고 했던 사이트에서 Joel_Esler 라는 사람이 답변한 내용에서 Bit Sequence 부분은 이해가 가지 않는다.

& is a bitwise “and”. So, for the first byte_test, it moves three bytes into a packet, takes one
byte, and checks to see if it is a 2. (So the 7th bit in the Bit Sequence is set), the second one
indicates that the 8th bit in the Bit Sequence is set, and the 3rd one indicates that the first bit in
the Bit Sequence is set.

'SNORT' 카테고리의 다른 글

SNORT+BASE 설치 메뉴얼 (DEBIAN/UBUNTU)  (0) 2011.09.19
정규 표현식 기호-2  (0) 2010.03.02
정규 표현식 기호-1  (0) 2010.03.02
국내 Snort Rule 공유 블로그  (1) 2009.09.15
Posted by regexkorea