漏洞描述
nhttpd 1.9.6及之前版本中存在路径穿越漏洞。攻击者可利用该漏洞访问web server路径之外的文件。
漏洞分析
目录穿越
在main.c中,处理header处存在如下代码
程序将会调用http_verify对每个header进行有效性验证,如上图1568行
2025年06月12日
nhttpd 1.9.6及之前版本中存在路径穿越漏洞。攻击者可利用该漏洞访问web server路径之外的文件。
在main.c中,处理header处存在如下代码
程序将会调用http_verify对每个header进行有效性验证,如上图1568行
2025年06月12日
urllib是python内置的http客户端库,用于网络请求相关的主要是urllib.request子模块。
from urllib import request
# 发送GET请求并获取响应
response = request.urlopen('http://httpbin.org/get')
# 读取响应内容
html = response.read().decode('utf-8')
print(html)
#输出
{
"args": {},
"headers": {
"Accept-Encoding": "identity",
"Host": "httpbin.org",
"User-Agent": "Python-urllib/3.8",
"X-Amzn-Trace-Id": "Root=1-6820512b-44adb7d37a1f15233ad07016"
},
"origin": "6x.xxx.xx.xx",
"url": "http://httpbin.org/get"
}
2025年06月12日
function posturl($gateurl,$data){
$headers = array("Content-type: application/x-www-form-urlencoded", "'charset='utf-8'");
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$gateurl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch ,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch ,CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$res = curl_exec($ch);
curl_close($ch);
$result = json_decode($res, true);
return $result;
}
2025年06月12日
import java.io.IOException;
import java.net.URLEncoder;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.client.utils.HttpClientUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
2025年06月12日
一、准备资料:
1、访问
https://open.weixin.qq.com/,注册账户。
2、开发者认证:企业。
3、创建一个网站应用:网站域名必须备案(可使用二级域名),获得相应的AppID和AppSecret,申请微信登录且通过审核。
2025年06月12日
如果我们要访问一个网站,需要知道这个网站的地址,网站的地址一般被称为URL,他的全称是Uniform Resource Locator。那么什么是URI呢?