[WEB SECURITY] to BurpSuite non-local network proxy settings

In the Web penetration testing, BurpSuite is one of the indispensable artifact.

The core BurpSuite a proxy Proxy, normally routine use BurpSuite are: BurpSuite proxy browser settings -> Access Web Applications -> BurpSuite packet capture analysis.
I thought of writing something different, to BurpSuit non-local network proxy settings

Generally 0x01

The most common scenario is for Web application penetration test using the HTTP protocol. In this case, the direct set your browser proxy server BurpSuite can, by default 127.0.0.1:8080.

Of course, direct change your browser's proxy settings more complicated, the better approach is to use a browser plug-in, pre-set program agency, then the actual situation of a key switch. Chrome is recommended to use Proxy SwitchyOmega plugin:

Mobile terminal traffic crawling 0x02

Sometimes, we also need to be mobile APP packet capture analysis, this time how to do?

Actually very simple, two-step can be solved.

The first step in the Proxy Listeners BurpSuite, check the current proxy in use, click on the left side of the Edit button in the dialog box, the Bind to address option is set to All interfaces.

The second step, the mobile phone and PC connected to the same Wifi, Wifi open the phone settings, set HTTP proxy server IP address BurpSuite where the PC port is the proxy port BurpSuite.
In iPhone, for example, which is provided as shown below:

Of course, if APP is taking the HTTPS channel, still need to install the certificate to a normal visit, during the installation of the certificate of here, I did not write up, there are many online write better.

0x03 multi-proxy case

In some network environments, the need to go to access the target site agent. For example, to access google.com,

I have a good match ahead of a proxy server M State

(如果不清楚怎么搭建代理服务器的话,推荐看一下我的另一篇博文:linux搭建代理服务器 https://www.cnblogs.com/-mo-/p/11251369.html

现在我想对google.com进行渗透测试,那么该怎么设置浏览器代理?

这时候不能简单的把浏览器代理设置为BurpSuite,这样虽然可以进行抓包,但是没有了M国代理服务器的帮助,我们是无法访问google.com的,抓包也就没有意义了。这时候该怎么办?

在这种情况下,我们必须借助代理链了。

顾名思义,代理链就一系列的代理形成的链条。像刚才那种情形,我们首先设置浏览器的代理为BurpSuite以便能够抓包;然后为BurpSuite再设置一个上游代理即M国的代理服务器。

这样访问google.com时,请求数据先经过BurpSuite,于是可以进行抓包了;然后再流向M国的代理服务器,最后经过本地服务器到达google.com。

服务器端返回的响应则刚好相反。通过这个BurpSuite ==> M国代理服务器的代理链,我们就解决了本节开头所描述的问题。

作为一个神器,BurpSuite是具备这个功能的。

在BurpSuite的User options下的Connections页面中,有『Upstream Proxy Servers』和『SOCKS Proxy』这两个配置项,都是跟代理链相关的。接下来逐一进行说明。

3.1 Upstream Proxy Servers

在该设置项中,可以设置多个上游代理服务器规则,满足规则的请求将被发送至相应的代理服务器。只说概念过于无聊,这里就以chaipip.com(一个查询IP地址的网址)为例,进行说明。

为了对chaipip.com进行抓包分析,我们首先要设置浏览器的代理为BurpSuite,这一点是毫无疑问的。

为了能够通过代理访问chaipip.com,还需要设置BurpSuite的上流代理为(113.121.20.183:9999)(这个上流代理也就是上文所说的那台代理服务器的IP及端口)

点击Upstream Proxy Servers列表框左侧的Add按钮,打开『Edit upstream proxy rule』对话框。

这里一共有8个设置项,一般情况下只需关注前4个:

  • Destination host:这里填入目标网站域名或者IP,支持通配符(*表示0个或者任意个字符,?表示除点号之外的任意一个字符)。在本例中,我们可以填入*.chaipip.com。

  • Proxy host:填入代理服务器的IP地址,即113.121.20.183。如果为空表示直接连接。

  • Proxy port:填入的代理地址,即9999。

  • Authentication type:这里选择认证类型,由于这是免费使用的一个代理,无需认证,这是选择None。如果Authentication type为None,则接下来的4项内容无需理会,否则需要根据实际情况设置以下4项内容。

  • Username:用户名。

  • Password:密码。

  • Domain:域。仅用于NTLM认证类型。

  • Domain hostname:域主机名。仅用于NTLM认证类型。

设置内容如下图所示,最后点击OK即可。

这时候,你通过浏览器使用的本地代理选项,会发现chaipip.com所显示你的IP为刚刚设置的代理服务器的IP,并且BurpSuite中也成功地抓取到了相应的请求报文。

你可以同时设置多个Upstream Proxy Servers,在使用过程中,BurpSuite会按顺序将请求的主机与Destination host中设置的内容进行比较,并将请求内容发送至第一个相匹配的Proxy server。

因此,Proxy Server的顺序很重要,讲究个先来后到!

3.2 SOCKS Proxy

与Upstream Proxy Servers的作用类似,SOCKS Proxy的功能也是将请求内容发送至相应的代理服务器。不同之处在于,SOCKS Proxy作用于TCP协议层,因此如果设置了该项,那么所有的请求数据都会被发送至SOCKS代理服务器。所以,SOCKS Proxy的设置更简单。同样以免费的代理服务器为例,先在下方的输入框中依次填入SOCKS代理服务器的IP、端口(如果SOCKS代理服务器需要认证,还需要填写用户名和密码),然后勾选Use SOCKS proxy即可。

需要注意的一点是,如果同时设置了Upstream Proxy Servers和SOCKS Proxy,则根据规则应该发送至上游代理的请求将会通过SOCKS Proxy发送。

0x04 参考链接

https://www.anquanke.com/post/id/85925

Guess you like

Origin www.cnblogs.com/-mo-/p/11306569.html