bash - How Can I Detect something from HTTP Response -


i'am developing bash script can detect web application firewall header tags can find example idea ?

to find request headers bash can use curl. if you're on windows you'll want new windows bash shell or cygwin run it.

there dozens more tricks can play curl whatever want in whatever format want, lots of questions on answer questions come with.

curl --head www.google.com   http/1.1 200 ok date: thu, 06 apr 2017 02:07:00 gmt expires: -1 cache-control: private, max-age=0 content-type: text/html; charset=iso-8859-1 p3p: cp="this not p3p policy! see https://www.google.com/support/accounts/answer/151657?hl=en more info." server: gws x-xss-protection: 1; mode=block x-frame-options: sameorigin set-cookie: nid=100=ionzfnvsz_oaewiqe182ysgvshozyrvkjtqsq5gqkrz1ewxwav2ae5gpo_bx0apr39pnn4yvm5rfsmqnj_qfmllvws34ts-bnrvkzdfifaokkdto1bxhddi69dubn1f9kx4sxj_rcck28og6; expires=fri, 06-oct-2017 02:07:00 gmt; path=/; domain=.google.com; httponly transfer-encoding: chunked accept-ranges: none vary: accept-encoding 

here's example of getting response headers using curl:

curl -d - www.google.com   http/1.1 200 ok date: thu, 06 apr 2017 02:11:26 gmt expires: -1 cache-control: private, max-age=0 content-type: text/html; charset=iso-8859-1 p3p: cp="this not p3p policy! see https://www.google.com/support/accounts/answer/151657?hl=en more info." server: gws x-xss-protection: 1; mode=block x-frame-options: sameorigin set-cookie: nid=100=drualbdihkizkx0yettowdwhefjjy7iopu0fe7wch9pbbyi8mesbg8m42dhmwu-hkzmyulne7viglhj_zi6byg_pyptu5s2kyuv9xjpeh-gfsotsq22i2gneqxzwhjv-bdn0ayzcuugf9fhb3q; expires=fri, 06-oct-2017 02:11:26 gmt; path=/; domain=.google.com; httponly accept-ranges: none vary: accept-encoding transfer-encoding: chunked  <!doctype html><html itemscope="" itemtype="http://schema.org/webpage" lang="en"><head><meta content="search world's information, including webpages, images, videos , more. google has many special features find you're looking for." name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=utf-8" http-equiv="content-type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop=<cut rest of http request> 

Comments