라벨이 Web인 게시물 표시

SSRF to Redis

SSRF (Server-Side Request Forgery) SSRF는 서버의 요청을 변조하여 원하는 데이터 또는 원하는 타겟에 대해 서버의 자원을 이용해 요청을 보내는 공격 방법입니다. 다수의 마이크로 서비스로 이루어지는 모던 스택 또는 다른 서비스와 상호작용하는 형태에서 다른 서비스에 접근하여 취약점을 유발하는 SSRF취약점의 가치는 증가하게 되었습니다. Redis Key-Value 데이터 모델을 가진 NoSQL 데이터베이스입니다. 데이터를 메모리에 저장하는 인메모리 데이터베이스로 read/write 속도가 빠르다는 장점으로 대중적으로 많이 사용되고 있습니다. Redis는 왜 해커의 타겟이 되었나? Redis는 SSRF취약점 발생 시 주로 타겟이 되는 서비스 중 하나입니다. 이에 대한 이유는 아래와 같다고 생각됩니다. - 인증 체계 기본적으로 Redis는 인증 체계가 없으며, bind 127.0.0.1, port 6379로 서비스가 설정됩니다.  redis.conf의 내용 중 port와 bind에 대한 내용입니다. ```apache # Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. port 6379 ... # By default Redis listens for connections from all the network interfaces # available on the server. It is possible to listen to just one or multiple # interfaces using the "bind" configuration directive, followed by one or # more IP addresses. # # Examples: # # bind 192.168.1.100 10.0.0.1 bind 12

Defcon CTF quals 2019 : ooops

Category: Web Points: 137 Solves: 34 ## Description ``` On our corporate network, the only overflow is the Order of the Overflow. <a href="https://s3.us-east-2.amazonaws.com/oooverflow-challs/b48fb18a0837e8e6840d5101ff44bb9ee5ee1d22846580487ccce756b966f6b2/info.pac">info.pac</a> ``` ## Write-up ### 1. javascript deobfuscate. Change `eval` to `console.log`. ```js FindProxyForURL = function(url, host) { /* The only 'overflow' that employees can access is the Order of the Overflow. Log in with OnlyOne:Overflow. HTTPS support is coming soon. */ if (shExpMatch(host, 'oooverflow.io')) return 'DIRECT'; return 'PROXY ooops.quals2019.oooverflow.io:8080'; } ``` we can access challenge page ! ### 2. DNS Rebinding. if you send a URL, the bot access to the URL. And you look at the referer of http header, you can see that it starts from the internal IP address. (ex: 10.x.x.x) I tried DNS rebinding. I could not access the internal