cmdi
-
Secure Coding - Command InjectionJava/Spring 2018. 9. 7. 14:39
Command Injection Cmdi - .sh나 .bash 등 배치파일이나 커맨드 입력으로 injection 수행 Tools - Encoder/Hash -> programs=calc.exe&shutdown -t -s 36000 붙이고 URL Encoding programs%3Dcalc.exe%26shutdown -t -s 36000를 붙여놓고 요청을 수행한다. WhiteList기법을 이용해서 Cmdi를 방어한다. Runtime.getRuntime().exec("cmd.exe /c " + command); 로 OS에 명령을 실행한다. String command = request.getParameter("programs"); WhiteList 기법 -> Map을 사용한다. Map whiteList = ..