본문 바로가기
해킹/suninatas (써니나타스)

써니나타스 웹 1번 풀이(작성 중

by yenua 2022. 5. 14.
반응형

http://suninatas.com/challenge/web01/web01.asp

<%
    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)
        result = result1 & result2
        Response.write result
        If result = "admin" Then
            pw = "????????"
        End if
    End if
%>

 

가장 특이해보이는 함수인 Mid를 검색하니 대부분 엑셀에 대한 글이 뜨다가, 어느 카페 게시글에서 vb6의 내장함수인 mid를 설명해주는 글을 보게 되었다.

https://m.cafe.daum.net/0pds/37U1/60

 

vb를 키워드로 더 검색해보니 아래와 같은 메뉴얼들을 찾을 수 있었다.

https://docs.microsoft.com/ko-kr/dotnet/visual-basic/language-reference/operators/concatenation-operator

https://chennaiiq.com/developers/reference/visual_basic/functions/replace.asp

 

<%
    str = Request("str")

    If not str = "" Then
        result = Replace(str,"a","aad") ' a를 aad로 치환
        result = Replace(result,"i","in") ' i를 in으로 치환
        result1 = Mid(result,2,2) ' 2번째글자부터 2 글자를 잘라서 result1에 저장
        result2 = Mid(result,4,6) ' 4번째글자부터 6 글자를 잘라서 result2에 저장
        result = result1 & result2 ' result1 + result2
        Response.write result
        If result = "admin" Then ' result가 admin이면 Authkey 제공
            pw = "????????"
        End if
    End if
%>

 

몰랐는데, 티스토리 코드 블럭에도 VB.net을 설정할 수 있는 것이 있었다.

VB가 

 

Authkey : k09rsogjorejv934u592oi

반응형