Troubleshooting the Web server with forward proxy logs

Source: Internet
Author: User

Tags: exception forward proxy log

0x00 Event Background

One day, the application administrator came to tell you something, and there were a lot of strange logs on the server. Have access to Taobao, Qzone, 163 and other various records, may be hung horse. A number of investigations and studies have been conducted on this matter.

0x01 forward Proxy and log comparison for normal access

Set up an environment that uses Apache as a Web server to begin viewing the browser settings agent with the packet and server logs that do not set the proxy. Where as the client, as a web Server.

    • Do not set browser proxy

      In this case, everything is normal and used as a contrast.

650) this.width=650; "src=" Http:// "title=" 111. PNG "alt=" Wkiol1gkft2iydtwaabwhofouyu390.png "/>

650) this.width=650; "src=" Http:// "title=" 111. PNG "alt=" Wkiom1gkfzpscdpyaauiuc1y4om659.png "/>

    • Set browser proxy, server open forward Proxy

Grab bag can see, when the browser set the proxy, get back is not a simple path, but the full HTTP URL. Therefore, the reverse proxy is turned on by the Web server to which it is acting, requesting the page, and not returning its own resources on the Web server.

650) this.width=650; "src=" Http:// "title=" 111. PNG "alt=" Wkiol1gkfukroalgaaby81krhue790.png "/>

Check the logs on the server, and the logs are consistent with the packet capture.

650) this.width=650; "src=" Http:// "title=" 222. PNG "alt=" Wkiom1gkf3tx6floaahv8t4ebq8694.png "/>

However, if the get domain name or IP is indeed the domain name or IP of the server, the Web server will return its own resources, but also through the server to self-request another HTTP request to complete.

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 111.png "alt=" Wkiom1gkhhyqt0wraaa8ixf_hk0139.png "/>

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 222.png "alt=" Wkiol1gkhhyjaqfraaa-ijh0qke170.png "/>

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 333.png "alt=" Wkiom1gkhh2tub8uaaa4uk6r9cw345.png "/>

From the server log, the server records two logs, one is a forward proxy log, and the other is a normal log. From Netstat, two connections are established, one is from the client, and the other is the one that requests its own connection.

It is therefore possible to confirm that the request is being made to the Proxy server's own HTTP resource and that it needs to proxy itself to request and return the resource.

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 444.png "alt=" Wkiol1gkhh-q8xz3aaddojpvqdq858.png "/>

    • Set the browser proxy, but do not open the forward proxy for the server

      In this case, the server receives a forward proxy request, but ignores the domain name in the GET request, intercepts only the path in its own resource, and returns the Web server's own resources.

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 111.png "alt=" Wkiol1gkhxvrqtobaadblzlrlja383.png "/>

650) this.width=650; "src=" Http:// "style=" float: none; "title=" 222.png "alt=" Wkiol1gkhxzr6h6uaadbic0my4i953.png "/>

650) this.width=650; "src=" Http:// "title=" 333. PNG "alt=" Wkiol1gkhelcyyedaaad4qm0ol0864.png "/>

0x02 reason for the presence of forward proxy logs

According to the troubleshooting, the server with the forward proxy log does not have the forward proxy feature turned on, and the phenomenon is no longer present. After consulting with a cow, the following are some reasons why the exception is being presented to the agent log.

    • Server IP was a proxy, now IP for the use of people, can not be used, but still someone use this proxy (this situation is not confirmed)

    • Server has been hacked, IP and port has been used as a proxy (this can be confirmed by troubleshooting server past security Events)

    • Client DNS problem, error resolution to this IP (this situation is not good to confirm, unable to confirm the DNS server IP used by clients)

    • Proxy Scan Tool is not perfect, mistakenly put the server IP into the proxy address library (This situation is not very good confirmation)

    • The server is hacked, and before the troubleshooting, someone will be configured to restore the proxy, when necessary and open (can be resolved by troubleshooting all access logs, as long as there is no forward proxy log path is not part of the path of the Web server, but the corresponding response code is 20X)

Troubleshooting the Web server with forward proxy logs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: