Version 1.4

*08.03.2025 -> Anpassungen sendHeaders für Clouflare Erkennung
This commit is contained in:
2025-03-08 08:14:17 +01:00
parent 2bee4170dc
commit a8238c811c
2 changed files with 22 additions and 12 deletions

View File

@@ -5,6 +5,12 @@ Das Speichern von Zugangsdaten auf öffentlichen Servern stellt ein hohes Risiko
Nenninger N-Tools.de
Version 1.2
*16.03.2024 -> Anpassung an Update 21
Version 1.3
*20.08.2024 -> UTF-8 Zeichen decordiert
Version 1.4
*08.03.2025 -> Anpassungen sendHeaders für Clouflare Erkennung
Inspiriert durch https://github.com/oscarminus/steinapi/blob/main/steinapi.py

View File

@@ -3,12 +3,18 @@
Nenninger N-Tools.de
Version 1.2
*16.03.2024 -> Anpassung an Update 21
Version 1.3
*20.08.2024 -> UTF-8 Zeichen decordiert
Version 1.4
*08.03.2025 -> Anpassungen sendHeaders für Clouflare Erkennung
Inspiriert durch https://github.com/oscarminus/steinapi/blob/main/steinapi.py
*/
class steinAPPConnect{
private $VERSION = '1.2';
private $VERSION = '1.4';
private $MACHINENAME = 'default';
private $ServerURL = 'https://stein.app';
private $APIURL = '/api/api';
@@ -48,16 +54,17 @@ class steinAPPConnect{
"Keep-Alive: timeout=5, max=100",
"Connection: keep-alive"
);
$headers[] = "authority: stein.app";
$headers[] = "accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7";
$headers[] = "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36";
if($this->APIKey != ''){
$headers[] = "authority: stein.app";
$headers[] = "accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7";
$headers[] = "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
$headers[] = "accept: application/json, text/plain, */*";
$headers[] = "content-type: application/json";
$headers[] = "Pragma: no-cache";
$headers[] = "Cache-Control: no-cache, no-store";
$headers[] = "X-API-KEY: ".$this->APIKey;
$headers[] = "content-type: application/json";
$headers[] = "Pragma: no-cache";
$headers[] = "Cache-Control: no-cache, no-store";
$headers[] = "X-API-KEY: ".$this->APIKey;
}
curl_setopt($this->cURL, CURLOPT_URL, $_url);
@@ -100,7 +107,6 @@ class steinAPPConnect{
}
public function _get_UserName(){
//print_r($this->userinfo);
if(property_exists($this->userinfo,'name'))
return $this->userinfo->name;
return false;
@@ -112,14 +118,12 @@ class steinAPPConnect{
if($response !== false){
preg_match('/<*script[^>]*src *= *["\']?([^"\']*)/i', $response, $matches, PREG_OFFSET_CAPTURE);
//print_r($matches);
if(isset($matches[1][0])){
$response = $this->request($this->ServerURL.$matches[1][0],$data,false);
if($response !== false){
preg_match('/headers\.common\[\"X-API-KEY\"]=\"(\w+)\"/', $response, $matches, PREG_OFFSET_CAPTURE);
if(isset($matches[1][0])){
$this->APIKey = $matches[1][0];
//echo $this->APIKey;
return true;
}
}
@@ -171,4 +175,4 @@ class steinAPPConnect{
return false;
}
}
?>
?>