Add files via upload
This commit is contained in:
		
							parent
							
								
									a1c066cda6
								
							
						
					
					
						commit
						e90bd20702
					
				
					 1 changed files with 37 additions and 20 deletions
				
			
		
							
								
								
									
										57
									
								
								posh.txt
									
										
									
									
									
								
							
							
						
						
									
										57
									
								
								posh.txt
									
										
									
									
									
								
							|  | @ -716,6 +716,9 @@ $mac_coll | ||||||
| Get-ARP -search 192.168.3.100 | Get-ARP -search 192.168.3.100 | ||||||
| Get-ARP -search 192.168.3.100 -proxy dc-01 | Get-ARP -search 192.168.3.100 -proxy dc-01 | ||||||
| 
 | 
 | ||||||
|  | ### shutdown | ||||||
|  | shutdown /r /o # безопасный режим | ||||||
|  | 
 | ||||||
| ### LocalGroup | ### LocalGroup | ||||||
| Get-LocalUser # список пользователей | Get-LocalUser # список пользователей | ||||||
| Get-LocalGroup # список групп | Get-LocalGroup # список групп | ||||||
|  | @ -1997,12 +2000,6 @@ $inputbox.Submit() | ||||||
| $selenium.Close() | $selenium.Close() | ||||||
| $selenium.Quit() | $selenium.Quit() | ||||||
| 
 | 
 | ||||||
| ### Convert Screenshot Base64 to Image |  | ||||||
| 
 |  | ||||||
| $Base64img = (($selenium.FindElements([OpenQA.Selenium.By]::CssSelector('#root > div > div.passp-page > div.passp-flex-wrapper > div > div > div.passp-auth-content > div.Header > div > a')))).GetScreenshot() |  | ||||||
| $Image = [Drawing.Bitmap]::FromStream([IO.MemoryStream][Convert]::FromBase64String($Base64img)) |  | ||||||
| $Image.Save("$home\Desktop\YaLogo.jpg") |  | ||||||
| 
 |  | ||||||
| # IE | # IE | ||||||
| 
 | 
 | ||||||
| $ie.document.IHTMLDocument3_getElementsByTagName("input")  | select name # получить имена всех Input Box | $ie.document.IHTMLDocument3_getElementsByTagName("input")  | select name # получить имена всех Input Box | ||||||
|  | @ -2524,25 +2521,45 @@ Start-TCPServer -Port 5201 | ||||||
| Test-NetConnection -ComputerName 127.0.0.1 -Port 5201 | Test-NetConnection -ComputerName 127.0.0.1 -Port 5201 | ||||||
| 
 | 
 | ||||||
| ### WakeOnLan | ### WakeOnLan | ||||||
|  | Broadcast package consisting of 6 byte filled "0xFF" and then 96 byte where the mac address is repeated 16 times | ||||||
| 
 | 
 | ||||||
| function Send-WOL { | function Send-WOL { | ||||||
| [CmdletBinding()]param( | param ( | ||||||
| [Parameter(Mandatory = $True, Position = 1)] | [Parameter(Mandatory = $True)]$Mac, | ||||||
| [string]$mac, | $IP, | ||||||
| [string]$ip = "255.255.255.255",  | [int]$Port = 9 | ||||||
| [int]$port = 9 |  | ||||||
| ) | ) | ||||||
| $address = [Net.IPAddress]::Parse($ip) | $Mac = $Mac.replace(":", "-") | ||||||
| $mac = $mac.replace("-", ":") | if (!$IP) {$IP = [System.Net.IPAddress]::Broadcast} | ||||||
| $target = $mac.split(':') | %{ [byte]('0x' + $_) } | $SynchronizationChain = [byte[]](,0xFF * 6) | ||||||
| $packet = [byte[]](,0xFF * 6) + ($target * 16) | $ByteMac = $Mac.Split("-") | %{[byte]("0x" + $_)} | ||||||
| $UDPclient = new-Object System.Net.Sockets.UdpClient | $Package = $SynchronizationChain + ($ByteMac * 16) | ||||||
| $UDPclient.Connect($address, $port) | $UdpClient = New-Object System.Net.Sockets.UdpClient | ||||||
| [void]$UDPclient.Send($packet, $packet.Length)  | $UdpClient.Connect($IP, $port) | ||||||
|  | $UdpClient.Send($Package, $Package.Length) | ||||||
|  | $UdpClient.Close() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Send-WOL -mac D8:BB:C1:70:A3:4E | Send-WOL -Mac "D8-BB-C1-70-A3-4E" | ||||||
| Send-WOL -mac D8:BB:C1:70:A3:4E -ip 192.168.3.100 | Send-WOL -Mac "D8-BB-C1-70-A3-4E" -IP 192.168.3.100 | ||||||
|  | 
 | ||||||
|  | ### Encoding | ||||||
|  | $ByteText = [System.Text.Encoding]::UTF8.GetBytes("password") | ||||||
|  | $Text = [System.Text.Encoding]::UTF8.GetString($ByteText) | ||||||
|  | 
 | ||||||
|  | ### Base64 | ||||||
|  | 
 | ||||||
|  | $text = "password" | ||||||
|  | $byte = [System.Text.Encoding]::Unicode.GetBytes($text) | ||||||
|  | $base64 = [System.Convert]::ToBase64String($byte) | ||||||
|  | $decode_base64 = [System.Convert]::FromBase64String($base64) | ||||||
|  | $decode_string = [System.Text.Encoding]::Unicode.GetString($decode_base64) | ||||||
|  | 
 | ||||||
|  | $path_image = "$home\Documents\1200x800.jpg" | ||||||
|  | $BBase64 = [System.Convert]::ToBase64String((Get-Content $path_image -Encoding Byte)) | ||||||
|  | Add-Type -assembly System.Drawing | ||||||
|  | $Image = [System.Drawing.Bitmap]::FromStream([IO.MemoryStream][Convert]::FromBase64String($BBase64)) | ||||||
|  | $Image.Save("$home\Desktop\1200x800.jpg") | ||||||
| 
 | 
 | ||||||
| ### HTTP Listener | ### HTTP Listener | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue