Web

URL Globbing

pin4ction 2026. 3. 20. 16:13

1. URL Globbing?

비슷한 형태의 여러 URL을 한 번에 표현하는 방법이다.

*, ?, {} 같은 기호로 표현한다.

https://example.com/page1
https://example.com/page2
https://example.com/page3

이 대신 아래와 같이 쓸 수 있다.

https://example.com/page[1-3]

2. 왜  필요한가?

  • 비슷한 구조의 여러 파일을 한 번에 요청하고 싶을 때
  • 연속된 번호의 API 엔드포인트나 페이지를 테스트할 때
  • 반복 작업을 줄이고 자동화할 때

3. 패턴

1) 범위 지정

https://example.com/file[1-5].txt
↓  ↓
https://example.com/file1.txt
https://example.com/file2.txt
https://example.com/file3.txt
https://example.com/file4.txt
https://example.com/file5.txt

 

 

2) 목록 지정

https://example.com/{a,b,c}
↓  ↓
https://example.com/a
https://example.com/b
https://example.com/c

 

 

3) 조합 사용

https://example.com/{img,thumb}[1-3].jpg
↓  ↓
https://example.com/img1.jpg
https://example.com/img2.jpg
https://example.com/img3.jpg
https://example.com/thumb1.jpg
https://example.com/thumb2.jpg
https://example.com/thumb3.jpg

이런식으로 사용한다.


4. 활용

curl https://example.com/{a,b,c}.json

실제로 curl에서 여러 리소스를 한 번에 가져오는 데 사용할 수 있다.

(그러나 모든 프로그램이 URL Globbing을 지원하는 것을 아니다.) 

 

보안 관점에서는 필터가 검사하는 문자열과 실제 처리된 문자열의 차이를 이용해서 필터링을 우회하는데 사용할 수 있다.

그래서 curl의 경우 아래와 같이 우회할 수 있다.

..  → {.}.
flag   →  fla{g}  

애플리케이션의 문자열 필터는 안전하다고 착각했지만, 실제 요청 해석은 curl이 수행하기 때문에 우회가 가능하다.

'Web' 카테고리의 다른 글

[Dreamhack] Hello World! / Write up  (0) 2026.03.25
[Dreamhack] non-admins / Write up  (0) 2026.03.20
[Dreamhack] Curlove / Write up  (0) 2026.03.19
DOM Clobbering  (0) 2026.03.13
[Dreamhack] Strong BypassIF / Write up  (0) 2026.03.13