리눅스 권한에 관한것입니다 !!

sjb5의 이미지

리눅스 파일 중에 “setuid” flag가 셋팅되어 있으면서, others에게 “rwx” 권한이 존재하는 경우에, 심각한 security hole이 생겼다고 볼 수 있다. 이유가 무엇인가?

회사 첫출근했는데 선배님이 저런질문을갑자기했습니다.근데 제가 대답을못했어요..
아무리찾아도 없네요 알려주세요 고수님들 좀길게좀..

eminency의 이미지

흠... 정확히는 hole이 생겼다기보다 코딩시 다른 프로그램보다 더더욱 신경을 써야 되겠지요 -_-;

예를 들어 vi 같은 경우 setuid를 설정해 놓고 일반 유저로 띄운 뒤 :!sh를 실행해 버리면 일반 유저도 root 권한으로 아무거나 할 수 있게 됩니다(물론 vi의 owner는 root겠죠).

다른 계정의 권한을 갖고 실행한다는 점에서 setuid 프로그램은 보안상 매우 주의깊게 작성되어야 할 겁니다.

...이상은 일반론적인 얘긴데 선배님이 이걸 의도하신 건지는 모르겠군요 -_-;

노루가 사냥꾼의 손에서 벗어나는 것 같이, 새가 그물치는 자의 손에서 벗어나는 것 같이 스스로 구원하라 -잠언 6:5

ssehoony의 이미지

setuid 의 기능은 아실테구요
others에게 rwx 의 권한까지 있다면 해당 파일을 others 가 완전히 다시 쓸수(write)가 있다는 말이지요.
그렇기 때문에 others 가 shell 을 실행하는 프로그램을 하나 만든 다음 그 프로그램을 setuid가 설정된 파일로
덮어 쓴다면 어떻게 될지는 짐작하시겠죠?

anycastle의 이미지

하여튼감사합니다. 더긴내용을남겨주시면 고맙겠습니다.

ptmono의 이미지

buffer overflow를 이용해서도 root 권한을 얻을 수 있겠군요.

파일권한이 rwx니까 실행파일 자체가 buffer overflow를 일으키지 않더라도

파일을 알려진 buffer overflow되는 소스로 바꾸어서

실행해 주어도 root을 리턴 받지 않나 싶습니다.

------------------------------------------
FC5, KDE
http://www.linuxquestions.org/
http://www.fedoraforum.org/
http://stanton-finley.net/fedora_core_5_installation_notes.html

------------------------------------------
emacs user

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.