zt2 / sqli-hunter

SQLi-Hunter is a simple HTTP / HTTPS proxy server and a SQLMAP API wrapper that makes digging SQLi easy.
424 stars 128 forks source link

404 not Found #9

Closed Imanfeng closed 4 years ago

Imanfeng commented 4 years ago

I have always encountered some problems. When I access resources that require host configuration, I always get 404, but when I enter docker, I can access resources. Why is it 404?

image

zt2 commented 4 years ago

hi,可以给一个能复现的环境和步骤?图里的 care.qiku.com 我所在的环境已经无法访问了

Imanfeng commented 4 years ago

那个是内网的一个资产 是我自己配置的host。我判断应该是走代理的那个组建不根据host配置来访问,直接走公网解析。我在docker里面是可以访问到资产的,但是http代理过不去,返回404

发自我的iPhone

------------------ Original ------------------ From: ztz <notifications@github.com> Date: Fri,Apr 17,2020 11:55 PM To: zt2/sqli-hunter <sqli-hunter@noreply.github.com> Cc: ONE <863788955@qq.com>, Author <author@noreply.github.com> Subject: Re: [zt2/sqli-hunter] 404 not Found (#9)

hi,可以给一个能复现的环境和步骤?图里的 care.qiku.com 我所在的环境已经无法访问了

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zt2 commented 4 years ago

emm,为了定位问题,你那边可不可以帮我确认下面这几个场景的结果?

  1. 在 docker 外,不使用 SQLi-Hunter 提供的代理情况下,单纯使用 curl 配置 Host 头发出同样的请求的结果
  2. 在 docker 外,使用 SQLi-Hunter 提供的代理情况下,使用 curl 配置 Host 头发出同样请求的结果
  3. 在 docker 内,不使用 SQLi-Hunter 提供的代理情况下,单纯使用 curl 配置 Host 头发出同样的请求的结果
  4. 在 docker 内,使用 SQLi-Hunter 提供的代理情况下,使用 curl 配置 Host 头发出同样请求的结果

多谢

Imanfeng commented 4 years ago

这四种情况我试了下 都可以访问到,图中域名是个公网资产 我在burp里面走Upstream Proxy Servers的http代理,然后Repeater发包情况是不行的 image

zt2 commented 4 years ago

已经找到问题了,造成 Ruby HTTP 代理出现 404 的原因是 URL 不是绝对路径是相对路径,只要手动在 Repeater 里的 URL 前面添加完整 HTTP 路径就行

以 httpbin.org 为例,默认加载到 Repeater 里的请求 URL 为相对路径,BP 原封不动将包发给上游代理:

image

手动添加完整 URL:

image

Imanfeng commented 4 years ago

好的 thx