패킷을 완전 변조 하고 싶습니다 --;

puaxx의 이미지

특정 아이피 로부터 패킷의 body에 일치하는 내용이 있으면 패킷의 내용이 실행중인 프로세스에 전달되기 전에 변조를 하고 싶은데요.
혹은 실행중인 프로세스에서 특정아이피로 날아가는 패킷의 body에 일치하는 내용이 있으면 특정아이피로 전달되기 전에 변조를 하고 싶습니다..

혹시 방법을 아시는분 계신가요?

윈도우즈라면 힘들지 몰라도 리눅스를 미들로 놓고 리눅스 커널을 손보면 되지 않을까란 생각도 듭니다.

혹 커널에서 TCP 패킷을 처리하는 부분이 어딘지 아시는분 알려주세요.

익명 사용자의 이미지

끊어버리는(DROP) 것도 아니고, 변조란 말이지요?
단순 프로세스로 되지는 않으며(쉽게 되지 않는다는), 일단 가능합니다.
제한적이지만(문자열 길이변경불가), 이미 이를 구현한 패키지도 있습니다.

일단 패키지는 snort_inline이라는 것이고, 아래는 그 예인데요.

Quote:

1.5.3 Replacing Packets with Snort Inline
Additionally, Jed Haile's content replace code allows you to modify packets before they leave the network. For example:

alert tcp any any <> any 80 (msg: "tcp replace"; content:"GET"; replace:"BET";)
alert udp any any <> any 53 (msg: "udp replace"; \
content: "yahoo"; replace: "xxxxx";)

These rules will comb tcp port 80 traffic looking for GET, and udp port 53 traffic looking for yahoo. Once they are found, they are replaced with BET and xxxxx, respectively. The only catch is that the replace must be the same length as the content.

위의 룰 (alert tcp어쩌구....)을 설명하면,
tcp 80포트와 통신하는 임의의 세션에서,
GET이라는 문자열이 나타나면, 이를 BET으로 바꿔라.
그리고, 이를 로그로(alert) 남겨라.
로그 메시지는 "tcp replace"이다.
입니다.

* 주의: GET -> XXXX 처럼 문자열의 길이가 틀리면 아니되옵니다.

익명 사용자의 이미지

참, inline이라는 의미를 이해하셔야 겠는데요.

라인선상에 있다는 얘기지요.
즉, 게이트웨이에 있다는 얘기가 됩니다.

host --------------------------------- host

==>

host ----------- snort inline -------- host

이런 식으로 라인선상에 위치하게 된다는 얘기가 됩니다.

puaxx의 이미지

Anonymous wrote:
끊어버리는(DROP) 것도 아니고, 변조란 말이지요?
단순 프로세스로 되지는 않으며(쉽게 되지 않는다는), 일단 가능합니다.
제한적이지만(문자열 길이변경불가), 이미 이를 구현한 패키지도 있습니다.

일단 패키지는 snort_inline이라는 것이고, 아래는 그 예인데요.

Quote:

1.5.3 Replacing Packets with Snort Inline
Additionally, Jed Haile's content replace code allows you to modify packets before they leave the network. For example:

alert tcp any any <> any 80 (msg: "tcp replace"; content:"GET"; replace:"BET";)
alert udp any any <> any 53 (msg: "udp replace"; \
content: "yahoo"; replace: "xxxxx";)

These rules will comb tcp port 80 traffic looking for GET, and udp port 53 traffic looking for yahoo. Once they are found, they are replaced with BET and xxxxx, respectively. The only catch is that the replace must be the same length as the content.

위의 룰 (alert tcp어쩌구....)을 설명하면,
tcp 80포트와 통신하는 임의의 세션에서,
GET이라는 문자열이 나타나면, 이를 BET으로 바꿔라.
그리고, 이를 로그로(alert) 남겨라.
로그 메시지는 "tcp replace"이다.
입니다.

* 주의: GET -> XXXX 처럼 문자열의 길이가 틀리면 아니되옵니다.

상당히 제한적이지만 일단 많은 도움이 되었습니다.ㅎ...어디 더 좋은게 있으면 좋으련만 ^^;

익명 사용자의 이미지

* transparent proxy를 구현하여 이를 시도해 볼수도 있겠습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.