연구실에서 첨으로 아침 해를 보는 경험을 하면서 일단 내가 1차적으로 해야 할 일은 끝냈다. 하지만 프로젝트가 끝난 것이 아니기에 내 일은 계~~속 된다. ㅎㅎ
끝 없이 나를 괴롭히는 이 놈의 파이썬 님은 라이브러리 정리가 잘 되있음에도 나를 삽질의 길로 인도하셨다.
그래서 결론 적으로 나는 모듈에서 컨트롤러 하나, 모델 하나, DB하나를 만듬 샘이다.
wiki 관리는 계~속 하고 있고.
요즘은 취약점 분류에 따라 정리를 시작했는데 이제 포맷이 거의 정해져서 정리하기 수월하다.
===== Name(취약점 이름) =====
*Uploading files of dangerous types/Download code whithout integrity check
===== Level(위험도) =====
*Uploding files of dangerous types: CWE-8
*Download code without integrity check: CWE-20
===== Risk Factor(위험요소) =====
*Uploding files of dangerous types: .asp, .php등의 형식의 파일이 업로드 되면 파일이 업로드 된 경로로 접근 시에 자동으로 실행이 된다. Linux환경 같은 경우네는 이런 파일들이 실행 되면서 OS에 대한 제어까지 가능하다.
*Download code without integrity check: 신뢰할 수 없는 코드를 다운 받에 됨으로써 공격자는 희생자의 client에서 원하는 명령을 실행하거나, 민간함 자료 등에 접근할 수 있게 된다.
===== Attack Surface(공격지점) =====
*Uploding files of dangerous types: form-action, form-method="post", form-enctype="multipart/form-data", input-type=file, input-type="submit"
*Download code without integrity check: 소스코드 내의 함수 부분
===== Detection(탐지 방법) =====
*Uploading files of dangerous: .php, .html, .asp등의 파일을 업로드 시도 해본다. 필터링 되지 않는다면 취약한 것이다. 필터링 할 경우 대소문자를 다꾸거나 php.txt등으로 확장자를 변경하여 업로드 해본다. 클라이언트에서 프록시를 이용해 우회해보고 서버에서 필터링 하는지 확인해 본다.
*Downloda of code without integrity check: 이 취약점의 경우는 자동 탐지는 어렵다. 수동으로 실재와 여러 파일을 다운로드 하면서 세션에 어떠한 변화가 있는지를 확인해야 한다.
===== Sample Scenario(간단한 공격 예제 시나리오) =====
*Uploading files of dangerous types:
* input: sample file(sample.php, sample.asp, sample.html)
* output: sample file's url(ex).../sample.php)
* algorithm '
def __init__()
def detectAttackSurface()
...
def uploadFiles()
...make request for uploading files of dangerous types
def detectuploadingFiles()
...detect url of uploading files
*Download code whithout integrity check:
자동 탐지 불가
===== Attack Patterns(공격 패턴들) =====
*Uploading files of dangerous
*apNo: 미정
*vNo: 미정
*asNo: 9,10,11,12
*Patterns
*Pattern: <form action=“upload_picture(ex)“method=post> <input type=“file” name=Myvultest.txt.pHp, Myvultest.txt.phP3, Myvultest.txt.Php4, Myvultest.txt.PhP5, MYvultest.txt.jSp, Myvultest.txt.cgI, Myvultest.txt.Pl, Myyultest.txt.Inc Myvultest.txt.hTml, Myvultest.txt.AsP, Myvultest.txt.pHtml, Myvultest.pHp.kr, Myvultest.phP.jp, Myyultxt.php.cN… >
*apSNo: 1~14...
*apDesc: form of upload for file
*expectedCondition:KW| url| scheme/netloc/path+Myvultest.txt.xxx
* Prevention: 파일 업로드 모듈에서 특정 파일의 업로드가 불가능하도록 확장자 필터링, 파일 업로드 폴더 내에서 파일 실행 제한
* Related Vulnerabilities: 미정
* Refernces: [[http://cwe.mitre.org/data/definitions/434.html|CWE-434]]
===== Prevention(취약점 방어 방법) =====
*파일 업로드 모듈에서 특정 파일의 업로드가 불가능하도록 확장자 필터링한다.
*서버의 권한 설정을 통하여 파일 업로드 폴더 내에서 파일 실행 제한
===== Related Vulnerabilities(관계가 있는 취약점) =====
*미정
===== References(참조 링크) =====
*[[http://cwe.mitre.org/data/definitions/434.html|Uploading files of dangerous types download code without integrity check]]
*[[http://cwe.mitre.org/data/definitions/494.html|Download of code without integrity check]]