Skip to main content

Posts

Password reset too simplistic/systematic issue

Some time when we try to reset the password of our user in linux it will show as simple and systematic as below: BAD PASSWORD: it is too simplistic/systematic no matter how hard password you give it will show the same. Solution: ######### Check if your password is Ok with the below command, jino@ndz~$ echo 'D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l' | cracklib-check D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l: it is too simplistic/systematic Now Create a password with the below command : jino@ndz~$ echo $(tr -dc '[:graph:]' 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K; You can see that this password will be ok with the cracklib-check. jino@ndz~$ echo '7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;' | cracklib-check                 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;: OK Thats all, Thanks.

HSTS disabling in Browsers.

HSTS stands for HTTP Strict Transport Security, Today I came up in a situation to renew the ssl certificate in netgate pfsense firewall. When taking the url in the browser am getting an error SEC_ERROR_EXPIRED_CERTIFICATE and my browser will not show the unsafe link to the site. And I can only renew the certificate after getting the web url and login to the pfsense firewall. Like a dedlock situation. How I solved this issue is to disable the HSTS checking in the chrome browser. Just take the url chrome://net-internals/#hsts in your chrome browser and give your ssl expired domain in the " Delete domain security policies" section and click on "Delete". That is all, now you will get the "proceed with the unsafe" link and can login and install the new ssl certificate for  your pfsense firewall. Cheers.

Snort as NIDS. Installation and configuration Step by Step.

Install Required Dependencies ############################# apt-get update -y apt-get upgrade -y apt-get install openssh-server ethtool build-essential libpcap-dev libpcre3-dev libdumbnet-dev bison flex zlib1g-dev liblzma-dev openssl libssl-dev wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz tar -zxvf daq-2.0.6.tar.gz cd cd daq-2.0.6 ./configure && make && make install Install Snort from Source: ########################## wget https://www.snort.org/downloads/snort/snort-2.9.11.1.tar.gz tar -xvzf snort-2.9.11.1.tar.gz cd snort-2.9.11.1 ./configure --enable-sourcefire && make && make install ldconfig ln -s /usr/local/bin/snort /usr/sbin/snort snort -V Configure Snort ############### mkdir /etc/snort mkdir /etc/snort/preproc_rules mkdir /etc/snort/rules mkdir /var/log/snort mkdir /usr/local/lib/snort_dynamicrules touch /etc/snort/rules/white_list.rules touch /etc/snort/rules/black_list.rules touch ...

Working of GPG key encryption.

If someone wants you to send a confidential file. ######################################## 1)   Generate  gpg keys from your local machine and provide them your public key. 2)   Then they will encrypt that file with your public key provided by you via mail or chat. 3)   Now after encryption they will send that encrypted file to you. 4)   Now you can decrypt the file with the private key resides in your local machine. Useful commands. ############### Generate gpg key # gpg --gen-key Export a public key  #  gpg --armor --export ramesh > ramesh-pub-asc.gpg Import a public key #  gpg --import FileName If you want to send a file ##################### 1)   Ask his/her the public key. 2)   Import the public key. 3)   encrypt the file 4)   Send them the file. That is all , Thanks,

Install Free SSL for a domian using certbot (Ubuntu 16.04 / Apache / Nginx )

FOR APACHE $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install python-certbot-apache First given a command like this : sudo certbot --apache -d cloud.xyz.com If this gave an error like below: Performing the following challenges: Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. Then give the below command and it works. # certbot --authenticator standalone --installer apache --pre-hook "apachectl -k stop" --post-hook "apachectl -k start" Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer apache No names were found in your configuration files. Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c' to cancel): cloud.xyz.com Running pre-hook command: apachectl -k stop Obtaining ...

Logical Volume Manager

LVM Commands ########### >> First we need to create Physical Volume. PV is chunks of 4MBs >> Then create Volume Group using this PV. >> THen create Logical Volume. Creating PV: [root@localhost ~]# pvcreate /dev/vdb5 /dev/vdc1 /dev/vdb6 /dev/vdc2   Physical volume "/dev/vdb5" successfully created.   Physical volume "/dev/vdc1" successfully created.   Physical volume "/dev/vdb6" successfully created.   Physical volume "/dev/vdc2" successfully created. pvdisplay   --- NEW Physical volume ---   PV Name               /dev/vdc1   VG Name                 PV Size               2.00 GiB   Allocatable           NO   PE Size        ...