Benutzer-Werkzeuge

Webseiten-Werkzeuge


start

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
start [2025/12/06 09:49]
jango
start [2026/02/19 22:31] (aktuell)
jango
Zeile 1: Zeile 1:
 <code> <code>
-#include "kernel.h+param( 
-#include "utils.h+  [string]$Url = "https://mail.deinedomain.tld/owa/", 
-#include "char.h+  [string]$Username = "DOMAIN\user", 
-#include "keyboard.h"+  [string]$Password = "secret", 
 +  [switch]$IgnoreCertErrors 
 +)
  
-// Keyboard I/O +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
-#define KBD_DATA   0x60 +if ($IgnoreCertErrors) { [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } }
-#define KBD_STATUS 0x64+
  
-// Cursor ports +function New-BasicAuthValue([string]$User,[string]$Pass)
-#define VGA_CRTC_INDEX 0x3D4 +  $pair "{0}:{1}" -f $User,$Pass 
-#define VGA_CRTC_DATA  0x3D5 +  "Basic + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))
- +
-#define VGA_W 80 +
-#define VGA_H (BUFSIZE / VGA_W) +
- +
-uint32 vga_index; +
-static uint32 next_line_index = 1; +
-uint8 g_fore_color = WHITEg_back_color = BLUE; +
- +
-char str[128{0}; +
-int  strc = 0+
- +
-uint8 inb(uint16 port) +
-+
-  uint8 ret; +
-  asm volatile("inb %1, %0" : "=a"(ret) "d"(port))+
-  return ret;+
 } }
  
-void outb(uint16 port, uint8 data) +$req = [System.Net.HttpWebRequest]::Create($Url) 
-+$req.Method = "GET
-  asm volatile("outb %0, %1" : : "a"(data)"d"(port)); +$req.AllowAutoRedirect = $false 
-} +$req.Headers.Add("Authorization", (New-BasicAuthValue $Username $Password)) 
-static inline void outb(uint16 port, uint8 val) +$req.UserAgent = "OWA-BasicTest/PS5.1"
-+
-    asm volatile ("outb %0, %1:: "a"(val)"Nd"(port)); +
-}+
  
-static inline uint8 kbd_has_data(void+try { $resp = $req.GetResponse() } 
-{ +catch [System.Net.WebException] $resp = $_.Exception.Response }
-  return (inb(KBD_STATUS) & 0x01); +
-}+
  
-static inline uint8 kbd_read_data(void+if ($resp{ 
-+  "HTTP: {0}" -f ([int]$resp.StatusCode) 
-  return inb(KBD_DATA);+  "Location: {0}" -f $resp.Headers["Location"
 +  "WWW-Authenticate: {0}" -f ($resp.Headers.GetValues("WWW-Authenticate") -join " | ") 
 +  $resp.Close()
 } }
 +</code>
  
-// ---- tiny I/O wait (optional but useful) ---- +<code> 
-static inline void io_wait(void) +param
-{ +  [string]$Url = "https://mail.deinedomain.tld/owa/", 
-  // klassischer "I/O wait" port +  [switch]$IgnoreCertErrors 
-  //asm volatile ("outb %0%1" : : "a"(0), "Nd"(0x80)); +)
-  //asm volatile ("outb %0, $0x80" :: "a"((uint8)0)); +
-  outb(0x80, (uint8)0); +
-}+
  
-// --- repeat filter state --- +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
-static uint8 key_down[128] = {0}+if ($IgnoreCertErrors) { [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } }
-static uint8 e0_prefix = 0;+
  
-// returns 1 if a NEW key press (make) should be processed, else 0 +$req [System.Net.HttpWebRequest]::Create($Url
-int get_keycode_once(uint8 *out_scancode) +$req.Method "GET" 
-+$req.AllowAutoRedirect $false
-  if (!kbd_has_data()) return 0; +
- +
-  uint8 sc kbd_read_data(); +
- +
-  // Extended prefix +
-  if (sc == 0xE0) { e0_prefix = 1; return 0; } +
- +
-  // If we currently don't support E0 keysdiscard next byte cleanly +
-  if (e0_prefix{ e0_prefix = 0; return 0; } +
- +
-  // Break (release) +
-  if (sc & 0x80) { +
-    uint8 make sc & 0x7F; +
-    if (make < 128) key_down[make] 0; +
-    return 0; +
-  } +
- +
-  // Make (press) - suppress repeats +
-  if (sc < 128) { +
-    if (key_down[sc]) return 0; // typematic repeat ignore +
-    key_down[sc] = 1; +
-  }+
  
-  *out_scancode sc; +try { 
-  return 1;+  $resp $req.GetResponse() 
 +} catch [System.Net.WebException] { 
 +  $resp = $_.Exception.Response
 } }
  
-static inline void vga_set_cursor(uint16 pos) +if ($resp) { 
-+  "HTTP: {0}" -f ([int]$resp.StatusCode
-  outb(VGA_CRTC_INDEX, 0x0F); +  "WWW-Authenticate:" 
-  outb(VGA_CRTC_DATA,  (uint8)(pos & 0xFF)); +  $resp.Headers.GetValues("WWW-Authenticate"
-  outb(VGA_CRTC_INDEX, 0x0E); +  $resp.Close() 
-  outb(VGA_CRTC_DATA,  (uint8)((pos >> 8) & 0xFF));+} else { 
 +  "No response (TLS/DNS/Network issue)."
 } }
 +</code>
  
-uint16 vga_entry(unsigned char ch, uint8 fore_color, uint8 back_color) +<code> 
-{ +PS C:\Users\Manuel Zarat> C:\Users\Manuel Zarat\Desktop\eas.ps1 
-  uint16 ax = 0; +Target: https://eas.akm.at/Microsoft-Server-ActiveSync 
-  uint8 attr = (back_color << 4) | (fore_color & 0x0F); +User:   D2000\\jango.zarat 
-  ax = ((uint16)attr << 8) | (uint16)ch; +Count:  20  Delay: 100ms  Timeout: 10s
-  return ax; +
-}+
  
-void clear_vga_buffer(uint16 **buffer, uint8 fore_color, uint8 back_color+[13:46:23.900] #   1 -> HTTP 401 (1156 ms
-{ +[13:46:25.197] #   2 -> HTTP 401 (1187 ms) 
-  for (uint32 i = 0; i < BUFSIZE; i+++[13:46:26.485] #   3 -> HTTP 401 (1181 ms) 
-    (*buffer)[i= vga_entry(' ', fore_color, back_color);+[13:46:27.753] #   4 -> HTTP 401 (1159 ms) 
 +[13:46:29.014] #   5 -> HTTP 401 (1147 ms) 
 +[13:46:30.271] #   6 -> HTTP 401 (1151 ms) 
 +[13:46:31.550] #   7 -> HTTP 401 (1161 ms) 
 +[13:46:32.821] #   8 -> HTTP 401 (1167 ms) 
 +[13:46:34.072] #   9 -> HTTP 401 (1141 ms) 
 +[13:46:35.328] #  10 -> HTTP 401 (1153 ms
 +[13:46:36.606] #  11 -> HTTP 401 (1168 ms) 
 +[13:46:37.876#  12 -> HTTP 401 (1175 ms) 
 +[13:46:39.153] #  13 -> HTTP 401 (1151 ms) 
 +[13:46:40.395] #  14 -> HTTP 401 (1146 ms) 
 +[13:46:41.684] #  15 -> HTTP 401 (1188 ms) 
 +[13:46:42.964] #  16 -> HTTP 401 (1167 ms) 
 +[13:46:44.219] #  17 -> HTTP 401 (1162 ms) 
 +[13:46:45.651] #  18 -> HTTP 401 (1306 ms) 
 +[13:46:46.909] #  19 -> HTTP 401 (1156 ms) 
 +[13:46:48.180] #  20 -> HTTP 401 (1166 ms)
  
-  next_line_index = 1; +PS C:\Users\Manuel Zarat> 
-  vga_index = 0; +</code> 
-  vga_set_cursor((uint16)vga_index); +Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, unstrukturiert oder vielleicht sogar falsch bzw. irreführend**.
-}+
  
-void init_vga(uint8 fore_color, uint8 back_color) +Du kannst Artikel gerne [[todo|ergänzen oder verbessern]]. Gerne mit so vielen Links wie nötig. Bitte keine Werbelinks und nur selbst verfasste oder lizenzfreie Texte! Copyright beachten! 
-+
-  vga_buffer = (uint16*)VGA_ADDRESS; +
-  clear_vga_buffer(&vga_buffer, fore_color, back_color); +
-  g_fore_color = fore_color; +
-  g_back_color = back_color; +
-}+
  
-// ---- SCROLL statt komplettes Löschen ---- 
-static void vga_scroll_if_needed(void) 
-{ 
-  if (vga_index < BUFSIZE) return; 
  
-  // scroll um 1 Zeile nach oben +=====Fehlende Verlinkungen=====
-  for (uint32 i 0; i < (VGA_H - 1) * VGA_W; i++) +
-    vga_buffer[i] vga_buffer[i + VGA_W];+
  
-  // letzte Zeile leeren +Eine Liste von Seiten die noch erstellt werden müssen.
-  for (uint32 i = (VGA_H - 1) * VGA_W; i < VGA_H * VGA_W; i++) +
-    vga_buffer[i] = vga_entry(' ', g_fore_color, g_back_color);+
  
-  vga_index = (VGA_H - 1) * VGA_W; +~~ORPHANSWANTED:wanted~~
-}+
  
-void print_new_line(void) 
-{ 
-  // auf Zeilenanfang springen 
-  vga_index += VGA_W - (vga_index % VGA_W); 
-  vga_scroll_if_needed(); 
-  vga_set_cursor((uint16)vga_index); 
  
-  // next_line_index ist jetzt eigentlich optional, aber falls du ihn weiter nutzt: 
-  next_line_index = (vga_index / VGA_W) + 1; 
-} 
  
-void print_char(char ch+<code powershell> 
-{ +<# 
-  if (ch == '\n') { print_new_line(); return; } +PowerShell 5.1 – EAS Basic-Auth Test (sendet IMMER weiter, auch bei 429
- +  
-  vga_buffer[vga_index] = vga_entry(chg_fore_colorg_back_color); +Optional: 
-  vga_index++; +- -IgnoreCertErrors (nur Test!) 
- +- -LogHeaders um X-EAS-FAIL / X-Blocked-By etc. zu sehen, falls du die in HAProxy setzt. 
-  vga_scroll_if_needed(); +#> 
-  vga_set_cursor((uint16)vga_index);+  
 +param( 
 +  [string]$Url "https://eas.akm.at/Microsoft-Server-ActiveSync", 
 +  [string]$Username "D2000\\jango.zarat", 
 +  [string]$Password = "Lunikoff0310!", 
 +  [int]$Count 20, 
 +  [int]$DelayMs = 100
 +  [int]$TimeoutSec = 10, 
 +  [switch]$IgnoreCertErrors, 
 +  [switch]$LogHeaders 
 +
 +  
 +# TLS 1.2 erzwingen 
 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
 +  
 +# Optional: Zertifikatsfehler ignorieren (nur Tests
 +if ($IgnoreCertErrors
 +  [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
 } }
- +  
-void print_string(char *s+function New-BasicAuthValue { 
-+  param([string]$User, [string]$Pass
-  for (uint32 i 0; s[i]; i++) +  $pair = "{0}:{1}" -f $User, $Pass 
-    print_char(s[i]);+  $b64  = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair)
 +  return "Basic $b64"
 } }
- +  
-// ---- FIXwait_for_io Underflow bug ---- +$auth = New-BasicAuthValue -User $Username -Pass $Password 
-void wait_for_io(uint32 timer_count+  
-+Write-Host ("Target{0}" -f $Url) 
-  while (timer_count--) { +Write-Host ("User:   {0}" -f $Username) 
-    asm volatile("nop");+Write-Host ("Count:  {0}  Delay: {1}ms  Timeout: {2}s" -f $Count, $DelayMs, $TimeoutSec) 
 +Write-Host "" 
 +  
 +for ($i=1; $i -le $Count; $i++{ 
 +  $sw = [Diagnostics.Stopwatch]::StartNew() 
 +  $code = -1 
 +  $err  = $null 
 +  $h = @{
 +  
 +  try { 
 +    $req = [System.Net.HttpWebRequest]::Create($Url) 
 +    $req.Method = "GET" 
 +    $req.AllowAutoRedirect = $false 
 +    $req.Timeout = $TimeoutSec * 1000 
 +    $req.ReadWriteTimeout = $TimeoutSec * 1000 
 +    $req.UserAgent = "EAS-Test/PS5.1" 
 +    $req.Headers.Add("Authorization", $auth
 +    $req.Headers.Add("MS-ASProtocolVersion", "14.1") 
 +  
 +    $resp = $req.GetResponse() 
 +    $code = [int]$resp.StatusCode 
 +    if ($LogHeaders) { 
 +      foreach ($k in $resp.Headers.AllKeys) { $h[$k] = $resp.Headers[$k] } 
 +    } 
 +    $resp.Close()
   }   }
-+  catch [System.Net.WebException] { 
- +    if ($_.Exception.Response) { 
-void sleep(uint32 timer_count) +      $resp = $_.Exception.Response 
-+      $code [int]$resp.StatusCode 
-  wait_for_io(timer_count); +      if ($LogHeaders) { 
-+        foreach ($k in $resp.Headers.AllKeys) { $h[$k] = $resp.Headers[$k] }
- +
-// ---- kleiner case-insensitive Vergleich ---- +
-static int streq_ci(const char *a, const char *b) +
-+
-  while (*a && *b) { +
-    char ca = *a, cb = *b; +
-    if (ca >= 'a' && ca <= 'z') ca -= 32; +
-    if (cb >= 'a' && cb <= 'z') cb -= 32; +
-    if (ca != cb) return 0; +
-    a++; b++; +
-  } +
-  return (*a == 0 && *b == 0); +
-+
- +
-static void reset_input_line(void) +
-+
-  strc = 0; +
-  str[0= 0; +
-+
- +
-static void append_char(char ch) +
-{ +
-  if (strc >= (int)sizeof(str) - 1) return; // bounds check +
-  str[strc++] = ch; +
-  str[strc] = 0; +
-  print_char(ch); +
-+
- +
-void loop(void) +
-+
-  uint8 keycode; +
- +
-  while (1) { +
- +
-    if (!get_keycode_once(&keycode)) { +
-      // CPU nicht verheizen: schlafen. +
-      // Achtung: hlt braucht Interrupts; falls die bei dir noch nicht an sind, +
-      // kannst du statt hlt ein kleines wait_for_io() nutzen+
-      asm volatile("hlt"); +
-      continue; +
-    } +
- +
-    if (keycode == KEY_ENTER) { +
-      print_new_line(); +
- +
-      // Command ausführen +
-      if (strc > 0) { +
-        if (streq_ci(str, "HELP")) { +
-          print_string("Available commands:"); +
-          print_new_line(); +
-          print_string("    help - Prints this help"); +
-          print_new_line(); +
-        } +
-        // hier später weitere Commands...+
       }       }
- +      $resp.Close() 
-      // neues Prompt +    } else { 
-      print_string("> "); +      $err = $_.Exception.Message
-      reset_input_line(); +
-      continue;+
     }     }
- +  } 
-    if (keycode == KEY_BACKSPACE{ +  catch { 
-      // nur löschen, wenn wir nach dem Prompt sind und auch was im Buffer ist +    $err = $_.Exception.Message 
-      if (strc > && vga_index 0) { +  } 
-        // optional: Schutzdass du nicht ins Prompt reinlöschst +  
-        uint32 prompt_start = (vga_index / VGA_W* VGA_W + 2; // "" = 2 chars +  $sw.Stop(
-        if (vga_index > prompt_start) { +  $ts (Get-Date).ToString("HH:mm:ss.fff"
-          vga_index--; +  
-          strc--+  if ($code -eq -1) { 
-          str[strc] = 0; +    Write-Host ("[{0}] #{1,4} -HTTP -1 ({2} msERROR={3}" -f $ts$i, $sw.ElapsedMilliseconds, $err) 
-          vga_buffer[vga_index] vga_entry(' ', g_fore_color, g_back_color); +  } else { 
-          vga_set_cursor((uint16)vga_index); +    if ($LogHeaders
-        +      $xFail = $h["X-EAS-FAIL"
-      } +      $xBlk  $h["X-Blocked-By"] 
-      continue;+      $extra = @() 
 +      if ($xFail) { $extra += ("X-EAS-FAIL={0}" -f $xFail) } 
 +      if ($xBlk)  { $extra += ("X-Blocked-By={0}" -f $xBlk) } 
 +      $suffix "" 
 +      if ($extra.Count -gt 0{ $suffix = "  " + ($extra -join "  ") } 
 +      Write-Host ("[{0}] #{1,4} -> HTTP {2} ({3} ms){4}" -f $ts, $i, $code, $sw.ElapsedMilliseconds, $suffix
 +    else { 
 +      Write-Host ("[{0}] #{1,4} -> HTTP {2} ({3} ms)" -f $ts, $i, $code, $sw.ElapsedMilliseconds)
     }     }
- 
-    if (keycode == KEY_SPACE) { 
-      append_char(' '); 
-      continue; 
-    } 
- 
-    char ch = get_ascii_char(keycode); 
- 
-    // Erlaubte Zeichen: A-Z, 0-9, '.', ' ' 
-    if (ch == '.' || ch == ' ' || 
-        (ch >= 'A' && ch <= 'Z') || 
-        (ch >= '0' && ch <= '9')) { 
-      append_char(ch); 
-    } 
- 
-    // kein riesiger busy-sleep mehr nötig 
-    io_wait(); 
   }   }
-+  
- +  # WICHTIG: NICHT abbrechen bei 429 – weiter senden 
-void kernel_entry(void) +  Start-Sleep -Milliseconds $DelayMs
-{ +
-  init_vga(WHITE, BLUE); +
-  print_string("Kernel-OS v1.0"); +
-  print_new_line(); +
-  print_string("(C) Manuel Zarat"); +
-  print_new_line(); +
-  print_string("Type \"HELP\" for help"); +
-  print_new_line(); +
-  print_string("> "); +
-  reset_input_line(); +
-  loop();+
 } }
 </code> </code>
- 
-Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, unstrukturiert oder vielleicht sogar falsch bzw. irreführend**. 
- 
-Du kannst Artikel gerne [[todo|ergänzen oder verbessern]]. Gerne mit so vielen Links wie nötig. Bitte keine Werbelinks und nur selbst verfasste oder lizenzfreie Texte! Copyright beachten!  
- 
- 
-=====Fehlende Verlinkungen===== 
- 
-Eine Liste von Seiten die noch erstellt werden müssen. 
- 
-~~ORPHANSWANTED:wanted~~ 
- 
- 
start.1765010961.txt.gz · Zuletzt geändert: 2025/12/06 09:49 von jango