Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Basic auth HTTP Powershell

1..255 | %{
$IP = "192.168.2.$_"
    If (Test-Connection -count 1 -comp $IP -quiet) {
        $user = 'admin'
        $pass = 'admin'
        $pair = "$($user):$($pass)"
        $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
        $basicAuthValue = "Basic $encodedCreds"
        $Headers = @{
            Authorization = $basicAuthValue
        }
        $URL = "http://"+$IP+"/servlet?key=Reboot"
        Invoke-WebRequest -Uri $URL -Headers $Headers
    }
}
Comment

PREVIOUS NEXT
Code Example
Shell :: linux logrotate recursive 
Shell :: wget raw to file 
Shell :: unix symbolic link 
Shell :: printf 
Shell :: png to jpg linux command line 
Shell :: bash find files containing string 
Shell :: To install the GNOME desktop environment 
Shell :: shell scripting 
Shell :: how to change home directory of git bash 
Shell :: umount device is busy 
Shell :: how to create ssh key for github 
Shell :: setup mongodb locally on centos 8 
Shell :: auto start application ubuntu 18.04 
Shell :: npm otp-generator 
Shell :: gitignore command 
Shell :: create github repository 
Shell :: bash timeout 
Shell :: how to change git default branch name 
Shell :: find mac address from ip powershell 
Shell :: 1password cli install 
Shell :: add platform toolchain to linux 
Shell :: Failed to download pear within preferred state "stable" 
Shell :: install onnxmltools 
Php :: how to make a php info 
Php :: wordpress get child theme uri 
Php :: if user logged in wordpress 
Php :: php rtrim comma 
Php :: laravel password confirmation 
Php :: wordpress is_archive 
Php :: how to calculate age in laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =