Harden bash_history and bash configuration files

 

Harden bash_history and bash configuration files by making them append-only:

chattr +a /home/user/.bash_history
chattr +a /home/user/.bash_profile
chattr +a /home/user/.bash_login
chattr +a /home/user/.profile
chattr +a /home/user/.bash_logout
chattr +a /home/user/.bashrc

Harden env variables by adding the following lines to /home/user/.bashrc:

shopt -s histappend
readonly PROMPT_COMMAND="history -a"
readonly HISTFILE
readonly HISTFILESIZE
readonly HISTSIZE
readonly HISTCMD
readonly HISTCONTROL
readonly HISTIGNORE

histappend tells bash to append the last $HISTSIZE lines to the $HISTFILE file when an interactive shell exits. PROMPT_COMMAND executes the given command prior to issuing each prompt. history -a appends the command typed just before the current one to $HISTFILE.

Disable access to other shells:

chmod 750 csh
chmod 750 tcsh
chmod 750 ksh

 

 

Tomcat as non root user

 

run 

setcap cap_net_bind_service+ep /path/to/bin/java

ex: setcap cap_net_bind_service+ep /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java



Reconnect Wazuh agent

 

  1. Add the manager's ip address in the configuration file /var/ossec/etc/ossec.conf <address>MANAGER_IP</address>
  2. Register the agent in the manager. The simplest method is /var/ossec/bin/agent-auth -m MANAGER_IP
  3. Restart the wazuh agent systemctl restart wazuh-agent

 

 

 

Enable ‘Minimize on Click’ on Ubuntu Quickly

Just open a Terminal window and copy/paste the following command:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

Hit enter for the change to take effect instantly.

If you don’t want to lose the ‘window’ picker (option 5 in the list above) run this command instead, which will introduce minimise on click but show the window picker if more than one window of a given app is open:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-previews'

To undo the change (i.e. revert back to the default settings for the Ubuntu Dock) copy/paste this command:

gsettings reset org.gnome.shell.extensions.dash-to-dock click-action

Gerenciar usuários por linha de comando no Windows

 Para criar usuários locais com net user, digite:
1
net user nome_usuario senha /add


Substitua nome_usuario e senha pelos dados desejados. Você também pode ir além e
digitar o nome completo e a descrição do usuário com:

1
net user nome_usuario senha /add /fullname:"Nome Completo" /comment:"Descrição do usuário"


Caso queira alterar a senha de um usuário local, simplesmente digite:

1
net user nome_usuario nova_senha


Ou se quiser editar o nome completo ou a descrição, digite:

1
net user nome_usuario /fullname:"Novo nome Completo" /comment:"Nova descrição do usuário"


Utilizando este método, você vai criar usuários “Padrão”, ou seja, sem privilégios
administrativos. Para dar privilégios de administrador para determinado usuário,
simplesmente digite:

1
net localgroup administradores nome_usuario /add
 

Caso tenha pensado melhor e acha que o usuário não merece ser um administrador,
digite:

1
net localgroup administradores nome_usuario /delete

 

 

Install MSIX with powershell

 Add-AppxPackage -Path "C:\Users\MyUserName\Downloads\affinity-designer-2.0.0.msix" -DependencyPath " https://aka.ms/Microsof...

Mais vistos