• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Ejercicios de PowerShell: crear un usuario utilizando el protocolo UDP

Contenidos

  • 1 Server (se tiene que ejecutar como administrador y se ejecuta mediante IEX)
  • 2 Client

Server (se tiene que ejecutar como administrador y se ejecuta mediante IEX)

PowerShell
1
2
3
4
5
6
7
##Server
$port=2020
$endpoint = new-object System.Net.IPEndPoint ([IPAddress]::Any,$port)
$udpclient=new-Object System.Net.Sockets.UdpClient $port
$content=$udpclient.Receive([ref]$endpoint)
[Text.Encoding]::ASCII.GetString($content) | iex
$udpclient.Close()

Client

PowerShell
1
2
3
4
5
6
7
##Client
$port=2020
$endpoint = new-object System.Net.IPEndPoint ([IPAddress]::Loopback,$port)
$udpclient=new-Object System.Net.Sockets.UdpClient
$b=[Text.Encoding]::ASCII.GetBytes('New-LocalUser usuario2 -Password (ConvertTo-SecureString "[email protected]@€dsf" -asplaintext -force)')
$bytesSent=$udpclient.Send($b,$b.length,$endpoint)
$udpclient.Close()
Publicado el día 13 de marzo de 2020

CATEGORÍAS

PowerShell

ETIQUETAS

.NET, ASCII.GetBytes, AsPlainText, client, ConvertTo-SecureString, Ejercicios de PowerShell, IPAddress, Jesús Niño, Jesús Niño Camazón, Length, New-LocalUser, New-Object, password, Protocolo, SecureString, Server, Sockets, System.Net.IPEndPoint, System.Net.Sockets.UdpClient, Text.Encoding, UDP

MÁS

  • Cómo depurar scripts en ISE de Windows PowerShell
  • Enviar un nombre de usuario a un servidor con UDP y si es correcto, el servidor responde al cliente con el contenido de una página web que el cliente abre con Google Chrome
  • Ejercicios de seguridad: práctica sobre virus
  • Enviar un mensaje a un servidor con UDP y que el servidor responda con "Hola cliente" independientemente del nombre del usuario
  • Enviar credenciales (Get- Credential) mediante el protocolo UDP entre un cliente y un servidor
  • 11. Gestión del Directorio Activo (nivel intermedio)