jueves, 17 de agosto de 2017

La fortaleza de una contraseña - mitos y leyendas

Pues parece ser que la creación de contraseñas a la vieja usanza "no menos de 8 caracteres, caracteres especiales mezclados con mayúsculas and so on " no es lo mejor que podemos hacer.

La simple elección de cuatro palabras elegidas con aleatoriedad ofrece muchisima mas resistencia a un ataque por fuerza bruta. 



Y para los que como yo no tienen claro lo que significa 'entropy'  --> lack of order or predictability; gradual decline into disorder

Culex.

miércoles, 16 de agosto de 2017

Instalación remota - PSEXEC II

Finalmente aquí están unos cuantos scripts que usan PSEXEC para realizar instalaciones desatendidas de forma remota y alguna otra cosilla.

Esta es la lista:

Installing Acrobat Reader
Installing Chrome
Installing Firefox
Installing FlashPlayer
Installing Java
Uninstalling software (UninstallString)
Running vbs script
Checking computer architecture,
Checking HF installed,
Checking computers online,
Checking IE version,

Este es el repositorio en github

Enjoy!

Culex.


jueves, 10 de agosto de 2017

Instalación remota Windows Update - PSEXEC

Como lo prometido es deuda, hoy voy a explicar como instalar actualizaciones de windows de forma remota.

El proceso es similar a la instalación de otros ejecutables pero vamos a tener que usar wusa.exe (windows-update-standalone-installer).

Previamente tenemos que copiar el ejecutable en el equipo que queremos parchear, se crea un directorio, se copia y finalmente se deja todo limpito, vamos como si no ha pasado nada :-)

Para evitar problemas con la copia usamos robocopy  (a mi nunca me ha fallado).

Aquí vemos un ejemplo para parchear el sistema contra Wannacry




Al igual que con el resto de ejecutables se generan dos archivos log para controlar la correcta instalación.

Adjunto el código (just in case)

Enjoy

Culex





miércoles, 2 de agosto de 2017

PSEXEC, Software remote installation

Getting bored of not having spare time for applying security updates at work, I thought about how to do it easier and faster and here you are the result.

Everyone knows there are some software which release security updates very often, so I made up some scripts for updating it in an unattended, silent and remote way.

They are the following; Adobe Reader, Chrome, Firefox, Flash Player y java.

And also windows updates, but that is a different story.

The command line tool we’re going to use is  PSEXEC.EXE  

PSEXEC is part of Microsoft Sysinternal  and it allows you to run processes in a remote machine.

Its syntax is as follow: psexec [\\computer[,computer2[,...] | @file\]\]\[-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

Like actions will speak louder than words here you are some detailed explanations.

Most times we’re going to use the same psexec arguments and we only need to surfing the Internet in order to look for  how to install the software in a silent way from a command line terminal.

E.g. the next command would install  flashPlayer on  pc1 computer.

psexec \\pc1 -c -s -u dominio\username -p password \\path\flashplayer.exe -install -force

-c, copy the exe file from the path \\path\flashplayer.exe  to pc1
-s, run the process with system privileges
-u y -p, allow us set the username & password which we’ll user to log on to the remote machine. (obviously an admin account)

And flashplayer.exe -install -force, are the arguments to install FlashPlayer.





So far so good but, what’d happen  if we would need to set up the software on 100 machines.

Obviously, this way will be a little boring, so we’re going to improve our batch and we’ll set the 100 computers on one shot J

The process is quite simple; a loop will read the computer names from a file (computers.txt) executing the installation command line for each one. In addition to this, we set a couple of logs file to keep everything under control and voila! … a useful script that allows us to save an important amount of time.

Concerning the log files, the first one gives us the exit code of the process (log.txt) and the second one, the detail of what have happened just in case we have to do some debugging (detail_%MYDATE: =%.log).

Here you are an script example for Acrobat Reader,


And a running example with Java


Obviously, they are  better and faster   ways to do the same but this one doesn't  work so bad.

One last thing, it is advised to open the terminal we’ll use for run the script with an admin user.

And finally, we can use PSEXEC for install almost everything, running commands and so on.

Here you are the code 

Enjoy J
Culex.


martes, 1 de agosto de 2017

Blog Evolution :-)

Este post es solo para comentar que vamos a empezar a publicar algunos de los temas con más 'enjundia' traducidos al Ingles.

Ampliamos horizontes..

Culex.