This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

catch all the HTTP requests to a certain domain

0

Is there a filter to get all HTTP requests to certain domain? For example, all the HTTP requests whose "Host" header is like xxxx.mydomain.com.

Thanks.

asked 11 May '15, 10:25

pktUser1001's gravatar image

pktUser1001
201495054
accept rate: 12%

Do you mean capture or display filters?

(11 May '15, 13:28) Christian_R

Yes. Don't think it's possible with capture filter, display filter is the best hope. Thanks.

(11 May '15, 13:36) pktUser1001

2 Answers:

0

What about this filter? (http.host == "xxx.mydomain.com") && (http.request.method == "GET")

You can generate your own complex filters very easily. You only have to right click the value for what you are interested in the packet detail view and then you can either choose "prepare a filter" or "apply as a filter" in the context menu.

answered 11 May '15, 14:08

Christian_R's gravatar image

Christian_R
1.8k2625
accept rate: 16%

edited 11 May '15, 14:10

That's a good start, but the issue is, we don't know what are the possible host names are. xxx is a place holder. Thanks.

(11 May '15, 14:11) pktUser1001

0

Use this display filter:

http.host matches "mydomain\.com"

This will match on "mydomain.com" anywhere in the http.host field. Because the matches operator uses regular expression syntax, you have to escape the period with a backslash.

answered 11 May '15, 14:13

Jim%20Aragon's gravatar image

Jim Aragon
7.2k733118
accept rate: 24%

Thanks, this is the best possibility so far. The corner cases are: To prevent xmydomain.com from being matched, we better use ".mydomain.com". However, that may miss http request to "mydomain.com".

(11 May '15, 14:16) pktUser1001

Then I think this could work (http.host matches "\.mydomain\.com") || (http.host matches "^mydomain\.com")

(11 May '15, 14:33) Christian_R

http.host matches "([^\.]+\.)*domain\.com"

Matches:

  • domain.com
  • aaa.domain.com
  • aaa.bbb.domain.com
  • aaa.bbb.ccc.domain.com
  • etc.

If you only want the first two:

http.host matches "([^\.]+\.)?domain\.com"

Regards Kurt

(12 May '15, 04:45) Kurt Knochner ♦