How can I know if a website is using apache, nginx or other and get this information in python? Thanks in advance
Asked
Active
Viewed 79 times
0
-
This is not a place to ask and forget, you should tinker a little bit with your code and provide a working proof of concept. Having said this, you could use the response header ``server:``from an http request to obtain what technology is being used by the backed. Note that this is not a very reliable method as you can hide/spoof those headers in your backend config files. – Gonzalo Oct 20 '22 at 15:06
1 Answers
0
This information if available is given in the header of the response to a HTTP Request. With Python you can perform HTTP requests using the module requests.
Make a simple GET request to the interested site and then print the headers parameter of the returned object.
import requests
r = requests.get(YOUR_SITE)
print(r.headers)
The output is made of a dictionary of keys and value, you have to look for the Server parameter
server = r.headers['Server']
You must be aware that not all websites return this information for several reasons, so you could not find this key in the response header.

Matteo
- 91
- 3