Skip to main content

Posts

ELK Stack (ElasticSearch / Logstash / Kibana ) Configuration

ELK Stack Installation Step By Step Guide ########################### Make sure Java is installed ################# Consider 1.2.3.4 as our ELK Stack server. > cd /opt/ > wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz" > tar -xzf jdk-8u141-linux-x64.tar.gz > cd jdk1.8.0_141/ > alternatives --install /usr/bin/java java /opt/jdk1.8.0_141/bin/java 2 > alternatives --config java > alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_141/bin/jar 2 > alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_141/bin/javac 2 > alternatives --set jar /opt/jdk1.8.0_141/bin/jar > alternatives --set javac /opt/jdk1.8.0_141/bin/javac Install Elasticsearch 5.5.1 (Port 9200) ######################## Before installing E...

Restrict all except some ips using TCP wrappers

Files using for this : /etc/hosts.allow /etc/hosts.deny /etc/sshd.hosts 1) First add the ips that need to be whitelisted in the /etc/hosts.allow. for that you need to add the ips to the file /etc/sshd.hosts file. 2) Add the below entry to the file /etc/hosts.allow. sshd: /etc/sshd.hosts 3) Finally add the below entry to the file /etc/hosts.deny sshd: ALL This will deny ssh from all the locations except the ips given in the sshd.hosts file. So if you want to whitelist anymore ips just add that to the file sshd.hosts.

Install Self Signed Certificate for a domain for 10 years

Things that you need to install the certificate: Key CSR (Certificate Signing Request) Certificate Here we can create these files  with the openssl command. This can be done from any where. It is not necessary that we need to do this commands in the server itself where the domains hosted. I usually do this in my locale machine. My example domain is myxyz.com Creating the Key ############ # openssl genrsa -out myxyz-key.pem 2048 Note: Here if we want to create a more secure key then replace 2048 with 4096 Here we can give any name for the key file, but the only thing is that the extension should be .pem Creating the CSR ############ # openssl req -new -sha256 -key myxyz-key .pem -out myxyz.csr Note: Here we need to give the key filename after the -key option. This command will create a CSR file named myxyz . csr This command will ask for few options and you can see what I have given for a test case.  ==================================== ...

Python Operator Precedence(From Highest to Lowest)

OWASP TOP 10 Application Security Risks - 2013

 The primary aim of the OWASP Top 10 is to educate developers, designers, architects, managers, and organizations about the consequences of the most important web application security weaknesses. The Top 10 provides basic techniques to protect against these high risk problem areas – and also provides guidance on where to go from here. Injection Cross Site Scripting (XSS) Cross Site Request Forgery (CSRF) Exposure of Sensitive Data Security Misconfiguration Using Components with Known Vulnerabilities Unvalidated Redirects and Forwards Broken Authentication and Session Management Insecure Direct Object References Missing Function Level Access Control 1) Injection Injection flaws, such as SQL, OS, and LDAP injection occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization. 2) Cross Site Scripting (XSS) ...

cPanel update fail with Needed RPMs not installed

Some time when we try to update the cpanel, the script will end with the following error: [2017-02-28 06:57:31 +0000]   No package redhat-rpm-config available. [2017-02-28 06:57:31 +0000] E Error: Nothing to do [2017-02-28 06:57:31 +0000] E (XID pzehwg) The system failed to execute yum with the arguments “-y -c /etc/yum.conf install redhat-rpm-config” be cause of an error: The “/usr/bin/yum” command (process 11852) reported error number 1 when it ended. : Error: Nothing to do [2017-02-28 06:57:31 +0000]   checkyum version 22.3 [2017-02-28 06:57:32 +0000] E Sysup: Needed system RPMs were not installed: redhat-rpm-config [2017-02-28 06:57:32 +0000] ***** FATAL: Cannot proceed. Needed system RPMs were not installed. [2017-02-28 06:57:32 +0000]   The Administrator will be notified to review this output when this script completes Solution ###### Just run the below command and proceed with the update. # yum clean all # /scripts/upcp

Screen Management

You need to use the following key combination to scroll up and look at your data under GNU screen. First press: CTRL-A + [ This will activate copy mode in GNU/screen. Now, you can scroll up/down and look at your data. Use the following keys: CTRL-u and CTRL-d scroll the display up/down by the specified amount of lines while preserving the cursor position. (Default: half screen-full). CTRL-b and C-f scroll the display up/down a full screen. For searching use the following vi like syntax: /SearchWord – Vi-like search forward. ?SearchWord – Vi-like search backward.