Proxy Interview Questions and Answers Vol 1.0
Proxy Interview Questions and Answers Vol 1.0
Proxy sits between an end system and remote server and acts as a mediator. The client
requesting resource connects to proxy server and once validated proxy connects to remote
server and provides requested content to client. This setup is used to prevent from attack
and unexpected access by techniques like hiding the IP address of the client computer. Proxy
functions on layer 7 placed in Semi-secured DMZ Zone of Data Centers or offices.
Reverse Proxy –
A reverse proxy does the exact opposite of what a forward proxy does. While a forward
proxy proxies in behalf of clients (or requesting hosts), a reverse proxy proxies in behalf of
servers. A reverse proxy accepts requests from external clients on behalf of servers
stationed behind it
Forward proxy –
Forward Proxy takes origin connections from the intranet clients and connect them to
servers outside on the internet. In other words, A forward proxy takes requests from an
internal LAN network and forwards them towards the Internet. Sometimes, forward proxy
may even serve the requesting client with cached information rather than passing the
request towards the internet.
Transparent Proxy –
Transparent proxy acts as intermediate between an end user and a web service. When an
end user connects to a service, the transparent proxy intercepts the request before passing
it on to the provider. Transparent proxies are called transparent because end user isn’t
aware of proxy in the path.
Ques 4. What are different deployment modes of proxies?
FreeProxy
Squid
Privoxy
Polipo
Ques 6. What is the default port of squid and how to change its operating port?
With understanding that current port in use is 3128 and we need to change it to 3130, next
step is to find configuration file as below –
Step 1 –
locate squid.conf
You should receive a result similar to:
/etc/squid/squid.conf
Step 2 –
Edit the squid.conf file and change configuration from “http_port 3128” to “http_port 3130”
Step 3 –
Exit and save the file, and then restart Squid:
Step 4 –
Issue below command to view port number being used
netstat –plant
The output will show new port number 1337 on which Squid is listening.
Windows –
Run MMC and load the services snap-in, kill the running squid process.
Empty Squid’s cache folder (e.g. C:\squid\vars\cache\).
Run Squid with the –z parameter to rebuild the cache folder structure (e.g.
C:\squid\sbin\squid.exe –z).
From the services snap-in of MMC, restart the squid service
Linux –
Step 1 -
Stop squid
squid -k shutdown
Step 2-
Erase all the files in your cache directory
rm -fr /var/lib/squid/cache/*
Step 3 -
Re-create the swap directory structure:
squid -z
Step 4 -
start squid again...
An HTTP Proxy is a server that receives requests from Client (i.e. web browser of end user)
and then makes the request to the Web Server on behalf of Client. It then returns the results
to the browser. It also caches the data for improved end user experience. In short, HTTP
Server receives request from a Client (in most cases a Browser) and then acting as an HTTP
Client and making requests on behalf of other HTTP Clients.
Ques 11. What is SOCKS proxy?
A SOCKS server is a general purpose proxy server that establishes a TCP connection to another
server on behalf of a client, then routes all the traffic back and forth between the client and the
server.
The SOCKS server does not interpret the network traffic between client and server in any way,
and is often used because clients are behind a firewall and are not permitted to establish TCP
connections to servers outside the firewall unless they do it through the SOCKS server
Client computer => proxy1 => proxy2 => ... => proxy X => web-site
When using proxy chaining, we create one "virtual proxy". And when you want to use chain
proxy1 => proxy2 => ... => proxy X you need to use address of created "virtual proxy". This
address you will know when you set up your chain of proxies.
Proxy chaining involves forwarding traffic from one proxy server to another. This method
leverages existing proxy servers, with no additional changes to the network.
A PAC file is a text file (coded in JavaScript) that instructs a web browser to determine whether
to send web traffic direct to the Internet or be sent via a proxy server .For example, a PAC file
can specify on what days of the week or what hours of the day traffic is sent to a proxy, or for
which domains and URLs traffic is not sent to a proxy.PAC files can control how a web browser
handles HTTP, HTTPS, and FTP traffic.
Ques 15. Which network ports need to be open in firewalls to allow use of the proxy service?
Generally proxy works on port 8080, 80 or 3128 which needs to be allowed on firewall.
Step 1 -
Open Settings.
Step 2 -
Click Network & Internet.
The list of network- and Internet-related settings appears.
Step 3 -
Click Proxy.
The list of available proxy settings appears.
Step 4 -
In the Manual Proxy Setup section, set the Use a Proxy Server switch to On.
Step 5 -
In the Address field, type the IP address.
Step 6 -
In the Port field, type the port.
Step 7 -
Click Save; then close the Settings window.
Ques 17. What is the default port of squid and how to change its operating port?
By default, Squid launches listens on port 3128.With understanding that current port in use is
3128 and we need to change it to 3130, next step is to find configuration file as below –
Step 1 –
locate squid.conf
You should receive a result similar to:
/etc/squid/squid.conf
Step 2 –
Edit the squid.conf file and change configuration from “http_port 3128” to “http_port 3130”
Step3 –
Exit and save the file, and then restart Squid:
Step 4 –
Issue below command to view port number being used
Netstat –plant
The output will show new port number 1337 on which Squid is listening.
A reverse proxy is usually an Internet-facing proxy used as a front-end to control and protect
access from outside Network to a server on a private network. A reverse proxy commonly
also performs tasks such as load-balancing, authentication, decryption or caching. A reverse
proxy accepts requests from external clients on behalf of servers stationed behind it.
In the general scenario, reverse proxy performs following tasks -
- Check for validity of request from Internet client (based on configured parameters).If
rejected, the client is supplied with error message
- If above request if accepted, reverse proxy looks in cache for requested information. If
information is available in cache, it is served to the Internet based client.
- If no cached information is available, the reverse proxy sends request to destination
Content server inside LAN and further relays the required data to the end client on Internet.
The information is cached for future reference.
Ques 19. What are the different filters that we can apply using proxy?
URL
DNS blacklists
URL regex filtering
MIME
Content keyword filtering
Ques 20. In a standard Data Center setup, Proxy server should be provisioned in which security
Zone?
Proxy Server should be stationed in DMZ Security Zone within a Data Center. This way proxy
will protect critical internal user and Business applications from being directly vulnerable to
attack from Internet/outside world.