Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Question about HTTP headers

I looked around online, however I was unable to find a confirmation.

What I want to know is: If I'm sending an HTTP-GET Request to a web server, can the server deny the request if a certain HTTP Header isn't present in the request?
Example: a web server only accepts the request (returns an HTTP 200 'OK' response) if a header like Connection: Keep-Alive is present.

If you can block requests lacking certain headers, how does a server do this? Thanks!

-mutate
This is literally a search away from you knowing it.
(Dec 25, 2020 01:45 PM)FlashyBeach Wrote:  This is literally a search away from you knowing it.

Then why not help? Or at least point me in the right direction? Doesn't make much sense for a comment like that. I'm very new to this, and It's possible I'm not using the right search terms. I know you can harden the processing of HTTP requests sent to a server, but the information I pulled up on this referenced XXS and clickjacking protection, etc. Not what I was curious about.

Example: If I'm sending a simple get request to Google:
Code
GET / HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0; en) Opera 9.50
Content-Encoding: gzip

Is there a way Google would detect the Content-Encoding header and deny the request? For whatever reason, ofc. I'm just trying to figure out if that's possible or not. I assume it is, but I'm failing to see how that would be implemented; either at the origin server or at the CDN.
bro you are not thinking this logically waht is the content-encoding header used for. And yes some WAFs block requests ifhtey don't have certain headers e.g. referer header etc.
In your .htaccess the following:

Code
RewriteEngine On
RewriteCond %{HTTP: connection} !^keep-alive$ [NC]
RewriteRule ^ - [F]
Contact me for:
- Any development (bots, checkers, homework, websites, ...)
- System administration (Linux, Windows, websites, ...)
- Cybersecurity (Reverse engineering, cracking, forensics, ...)
(Dec 25, 2020 03:22 PM)SecuroServ Wrote:  In your .htaccess the following:

Code
RewriteEngine On
RewriteCond %{HTTP: connection} !^keep-alive$ [NC]
RewriteRule ^ - [F]

Thank you. I'll look into this 😎


Possibly Related Threads...
Thread / Author Replies Views Last Post
by VentureSep 11, 2019 06:43 AM 4 191 Sep 11, 2019 06:43 AM
Last Post: SIGRU
by Gee4rceMar 9, 2018 01:11 PM 4 337 Mar 9, 2018 01:11 PM
Last Post: sydffe
by Johnny5698May 19, 2017 06:33 PM 0 109 May 19, 2017 06:33 PM
Last Post: Johnny5698