https://realpython.com/python-sockets/
cat /etc/os-release
lsb_release -a
hostnamectl
Ver Linux Kernel version:
uname -a
uname -r
Ver estado actual de los socket
netstat -an
tcpdump --list-interfaces
tcpdump -i eth0 -u port 9001
tcpdump -u port 9001
lsof -i -n
iptables -I INPUT -p tcp -m tcp --dport 5140 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 5140 -j ACCEPT
netstat -tulpn | less
netstat -plnt
tcpdump udp -i any port 162
Editar el crontab para q fuerce el actualizado del reloj.
nano /etc/crontab
*/1 * * * * root ntpdate pool.ntp.org
En desarrollo
mkdir /usr/share/ngrok
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
mv ngrok-stable-linux-amd64.zip /usr/share/ngrok
unzip /usr/share/ngrok/ngrok-stable-linux-amd64.zip
./usr/share/ngrok/ngrok -h
./usr/share/ngrok/ngrok autotoken <TOKEN>
create a bash run-grok.sh
file with
./usr/share/ngrok/ngrok http 8080
run in background
nohup sh run-grok.sh
./usr/share/ngrok/ngrok http <PORT>
curl http://localhost:4040/api/tunnels | json_reformat
Matar procesos por nombre.
pkill -f "multiprocess_monitor_firewall_ssh.py"
timedatectl status
timedatectl list-timezones
timedatectl set-timezone 'America/Lima'
- Configurar servidor ntp
yum install ntp
-Agregar ntp al arranque del sistema
chkconfig ntp on
-Iniciar servicio ntp
systemctl ntpd start
systemctl ntpd status
- Filtrar file logs usando grep
<log> | grep -v 'input.snmp'
Set-ExecutionPolicy Unrestricted
Get-ExecutionPolicy -List
yum install net-snmp-*
# Pretty visualization of json
head -1 data.json | jq
Link with documentation:
- https://riptutorial.com/es/openssl/topic/2695/empezando-con-openssl
- https://www.linux-party.com/57-seguridad/9667-generar-fichero-csr-en-linux.html
- https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/
yum install openssl openssl-devel
apt-get install openssl
Validate version of openssl
$ openssl --version
openssl req -newkey rsa:2048 -nodes -keyout /etc/owner_certifies/syslogselfsigned.key -x509 -days 365 -out /etc/owner_certifies/syslogselfsigned.crt -config /etc/pki/tls/openssl.cnf
Link: https://developers.facebook.com/docs/whatsapp/guides/https
curl -X POST \
https://your-webapp-hostname:your-webapp-port/v1/certificates/external \
-H 'Authorization: Bearer your-auth-token' \
-H 'Content-Type: text/plain' \
--data-binary @your-path-to-certificate.pem
For combine certifies use this command:
cat cert1.pem cert2.pem > bundle.pem
Uploading ...
curl -X POST \
https://your-webapp-hostname:your-webapp-port/v1/certificates/webhooks/ca \
-H 'Authorization: Bearer your-auth-token' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: text/plain' \
--data-binary @your-path-to-certificate.pem \
-k
cat server.crt server.key > server.pem
@author: Rush Frisby @version: 2237 @algorithm: AES 256.
Commands added:
encryptfile - encrypts the entire text in the current document
encryptstr - encrypts only the text that is selected in the current document
decryptfile - decrypts the entire text in the current document
decryptstr - decrypts only the text that is selected in the current document
- indent-rainbow
- show-offset
- Docker
In root type this commands:
sudo passwd root
Show user SID
> whoami /user
> netstat -ano
sudo apt install python3-pip
Validate correct instalation with:
sudo pip3 -version
Save dependences in a file
pip3 freeze > frozen-requirements.txt
Install requirements
pip3 install -r requirements.txt
Upgrade setuptools and pip
pip3 install --upgrade setuptools
pip3 install --upgrade pip
Configurate service
$export FLASK_APP=hello.py
$export FLASK_ENV=development
$flask run
python -m SimpleHTTPServer 8000
python -m http.serverj 8000