Skip to main content

Posts

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.  

How to create a Fake AP(Access Point / Wifi network)

Creating a Fake Access Point The imporatance of creating a fake access point is that, we allowing an open AP, the clients will visit in-order to have free internet connection and as this is an open AP, there won't be any encryption and we can easily sniff through the details they have been using in the internet. The tool using for this purpose is mana-toolkit, which will start up with 3 options 1) start-noupstream // Start an AP with no internet conneciton 2) start-nat-simple // Start an AP with regular internet connection in the upstream interface. 3) start-nat-full // Starts an AP with internet connection, but it also starts sslstrip/ sslsplit and firelamp and attempts to bypass HSTS. start-nap-simple configuration file : /etc/mana-toolkit/hostapd-mana.conf Script to start the mana tool # bash /usr/share/mana-toolkit/run-mana/start-nat-simple.sh

Creating a patch file

The diff command is used for creating a patch file. For this you will have an Original file, Modified file and finally we will create a Patch file with these 2 files. Diff command to create a patch file. # diff -u original.txt updated.txt > patch.txt Here -u represents the unified file. Now applying the patch by the below command. # patch original.txt < patch.txt This will replace the original file with the modifications. For Undo / Reverse the applied patch. # patch -R original.txt < patch.txt This will undo all the patches first applied.