완료됨
fetch로 푸는게 아닌가요?

제 풀이에서 어느 부분이 잘못되었는지 알려주시면 감사드리겠습니다.

  1. XSS 발생하는 것을 확인함
  2. '/auth'엔드포인트로 POST를 전송, data를 받아서 alert로 출력함
    fetch('http://host8.dreamhack.games:18013/auth', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        user: 'admin',
        pass: 'admin'
      })
    })
    .then(response => response.json())
    .then(data => alert(data))
  1. Response는 404만 나옴
(index):3  POST http://host8.dreamhack.games:18013/auth 404 (NOT FOUND),
(index):1 Unchecked runtime.lastError: The message port closed before a response was received
#web
작성자 정보
더 깊이 있는 답변이 필요할 때
드림핵 팀과 멘토에게 직접 문의해 보세요!
답변 2

브라우저 콘솔에서 실행하면 오류가 발생 할거에요

그래서 브라우저가 아닌 서버 가이드 환경에서 요형해야 해요
그래서 이렇게 고치면돼요
import fetch from 'node-fetch';

const res = await fetch('http://host8.dreamhack.games:18013/auth', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ user: 'admin', pass: 'admin' })
});
const data = await res.json();
console.log(data);
ㅎㅎ

2025.10.21. 23:37
avatar
BYTE255
웹해킹 고인물
avatar
BYTE255
웹해킹 고인물

/auth 엔드포인트는 127.0.0.1:5001에서 작동하므로 외부에서 접근할 수 없습니다.
xss가 아닌 다른 공격을 시도해보시길 바랍니다.

2025.10.21. 23:42