> For the complete documentation index, see [llms.txt](https://donghyunlee.gitbook.io/write-up/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://donghyunlee.gitbook.io/write-up/wargame/webhacking.kr/old-54-100.md).

# old-54 (100)

첫 화면이다. `Password is`  뒤의 문자가 계속 바뀌더니 일정 시간 후 `?` 로 고정된다.

![](https://4149640791-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LybinW10qeKqY56a-jw%2F-M26ssyaAqLVBJK1d41y%2F-M26t2nDjSoEEw77GTXD%2Fimage.png?alt=media\&token=780364d4-5464-40e5-a1dc-532f7c3a709c)

페이지 소스는 아래와 같다.

```markup
<html>
<head>
<title>Challenge 54</title>
</head>
<body>
<h1><b>Password is <font id=aview></font></b></h1>
<script>
function run(){
  if(window.ActiveXObject){
   try {
    return new ActiveXObject('Msxml2.XMLHTTP');
   } catch (e) {
    try {
     return new ActiveXObject('Microsoft.XMLHTTP');
    } catch (e) {
     return null;
    }
   }
  }else if(window.XMLHttpRequest){
   return new XMLHttpRequest();
 
  }else{
   return null;
  }
 }
x=run();
function answer(i){
  x.open('GET','?m='+i,false);
  x.send(null);
  aview.innerHTML=x.responseText;
  i++;
  if(x.responseText) setTimeout("answer("+i+")",20);
  if(x.responseText=="") aview.innerHTML="?";
}
setTimeout("answer(0)",1000);
</script>
</body>
</html>
```

크롬 개발자도구 콘솔에 아래와 같이 입력한다.

위 소스에서 30번째 줄을 수정하고 33번째 줄을 삭제한 스크립트이다.

```javascript
function run(){
  if(window.ActiveXObject){
   try {
    return new ActiveXObject('Msxml2.XMLHTTP');
   } catch (e) {
    try {
     return new ActiveXObject('Microsoft.XMLHTTP');
    } catch (e) {
     return null;
    }
   }
  }else if(window.XMLHttpRequest){
   return new XMLHttpRequest();
 
  }else{
   return null;
  }
 }
x=run();
function answer(i){
  x.open('GET','?m='+i,false);
  x.send(null);
  aview.innerHTML+=x.responseText;
  i++;
  if(x.responseText) setTimeout("answer("+i+")",20);
}
setTimeout("answer(0)",1000);
```

실행결과, 아래와 같이 플래그가 뜬다.

![](https://4149640791-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LybinW10qeKqY56a-jw%2F-M26vKPMwgCFoP2j5tdW%2F-M26vOaSw3OnURiEbUpO%2Fimage.png?alt=media\&token=7d8e237f-b2db-419a-928d-8fbac1e0f920)

Auth 창에 `FLAG{a7981201c48d0ece288afd01ca43c55b}` 를 넣고 제출하면 문제가 풀린다.

![](https://4149640791-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LybinW10qeKqY56a-jw%2F-M26vKPMwgCFoP2j5tdW%2F-M26vbifutySbNpfrQFQ%2Fimage.png?alt=media\&token=999c5361-d7eb-4e3b-9a56-7bb8ca7fb27e)
