웹해킹

[suninatas]Game 01 풀이

bbostudyy 2025. 5. 15. 20:38

Game 01

 

Game 01

<%    str = Request("str")    If not str = "" Then        result = Replace(str,"a","aad")        result = Replace(result,"i","in")        result1 = Mid(result,2,2)        result2 = Mid(result,4,6)  

suninatas.com

문제에 들어갔더니 이런 창이 떴다. 따로 어디 접속해서 푸는건아니고 이 코드들만 잘 해석하면 인증키를 얻을 수 있을 것 같다.

먼저 Replace,와Mid에 대해 검색해서 이게 무슨 함수인지 알아봤다.

 

replace는 첫번째 스트링을 두번째 스트링으로 대치하는 함수이다.
(str,"a","aad")=a를 aad로 바꾸는 것

 

Mid(str,pos,length)는 pos인덱스에서 length길이만큼 호출하는 함수이다.
Mid(result,4,6)=result에서 4번째 문자부터 6개의 문자를 호출하는 것

 

result=result1 & result2 인 것을 보아 두 함수의 결과를 합친 것이 result라는 것 같다.

admin이 result인 것은 나와있으니 이것을 거꾸로 계산해보면 키를 얻을 수 있을 것 같다.

 

여러 번 해본 뒤

 


result1

ami
aadmin

 

result2
ad
min

 

result1 &result2
admin

 ami인 것을 확인하였고 이것을 입력하니 키가 나왔다.

 

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

[Root Me] PHP - Command injection 풀이  (0) 2025.05.28
[Root Me] File upload - MIME type 풀이  (0) 2025.05.28
[Root Me]Local File Inclusion 풀이  (0) 2025.05.15
[suninatas]Game 02 풀이  (0) 2025.05.15
[Dreamhack]ex-reg-ex풀이  (0) 2025.05.13