완료됨
fetch로 푸는게 아닌가요?
제 풀이에서 어느 부분이 잘못되었는지 알려주시면 감사드리겠습니다.
- XSS 발생하는 것을 확인함
- '/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))
- 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);
ㅎㅎ