Saturday, March 18, 2023

Overview of One-Way SSL and Two-Way SSL

  Useful SSL Tutorial link


An Overview of One-Way SSL and Two-Way SSL | TutorialsPedia

Commonly used openssl commands are as follows:

Commonly used openssl commands are as follows: 


Check a certificate

openssl x509 -in certificate_name -text -noout

Get all certificates from a server

openssl s_client -connect host:ssl_port -showcerts

Convert a DER format certificate to PEM format

openssl x509 -inform der -in path_to_DER_certificate -out path_to_PEM_certificate

Convert a .pfx file to a JKS store

keytool -importkeystore -srckeystore path_to_.pfx_file -srcstoretype pkcs12 -destkeystore path_to_the_jks_file -deststoretype JKS -srcstorepass pfx_passwd -deststorepass pfx_passwd

Convert a .jks file to PKCS12 format

keytool -importkeystore -srckeystore path_to_.jks_file -destkeystore full_path_to_.p12_file-srcstoretype JKS - deststoretype PKCS12 -deststorepass pkcs12_store_password

Extract a private key from a .pfx file

openssl pkcs12 -info -in path_to_.pfx_file -nodes -nocerts -out private_key_file_name

Extract a public certificate from a .pfx file

openssl pkcs12 -in path_to_.pfx_file -out path_to_certificate_file -nokeys

Simple Bash Script

 

Bash is a Unix command line interface for interacting with the operating system, available for Linux. Bash scripts help group commands to create a program. All instructions that run from the terminal work in Bash scripts as well.

Bash scripting is a crucial tool for system administrators and developers. Scripting helps automate repetitive tasks and interact with the OS through custom instruction combinations. The skill is simple to learn and requires only basic terminal commands to get started.

Please find the below sample script of backuping the txt file .

#!/bin/bash

Path=/opt/folder1/folder2

cp $path/folder3/test.txt test.txt_backup_original

Linux Directory Structure

 Useful Information of Linux Directory Structure.




root directory:


/bin – binary or executable programs.

/etc – system configuration files.

/home – home directory. It is the default current directory.

/opt – optional or third-party software.

/tmp – temporary space.

/usr – User related programs.

/var – log files.


System Configuration Files:


/etc/bashrc – It is used by bash shell that contains system defaults and aliases.

/etc/crontab – A shell script to run specified commands on a predefined time interval.

/etc/exports – It contains information on the file system available on the network.

/etc/fstab – Information of the Disk Drive and their mount point.

/etc/group – It is a text file to define Information of Security Group.

/etc/grub.conf – It is the grub bootloader configuration file.

/etc/init.d – Service startup Script.

/etc/lilo.conf – It contains lilo bootloader configuration file.

/etc/hosts – Information of IP and corresponding hostnames.

/etc/hosts.allow – It contains a list of hosts allowed accessing services on the local machine.

/etc/host.deny – List of hosts denied to access services on the local machine.

/etc/inittab – INIT process and their interaction at the various run level.

/etc/issue – Allows editing the pre-login message.

/etc/modules.conf – It contains the configuration files for the system modules.

/etc/motd – It contains the message of the day.

/etc/mtab – Currently mounted blocks information.

/etc/passwd – It contains username, password of the system, users in a shadow file.

/etc/printcap – It contains printer Information.

/etc/profile – Bash shell defaults.

/etc/profile.d –  It contains other scripts like application scripts, executed after login.

/etc/rc.d – It avoids script duplication.

/etc/rc.d/init.d – Run Level Initialisation Script.

/etc/resolv.conf – DNS being used by System.

/etc/security – It contains the name of terminals where root login is possible.

/etc/skel – Script that initiates new user home directory.

/etc/termcap – An ASCII file that defines the behavior of different types of the terminal.

/etc/X11 –  Directory tree contains all the conf files for the X-window System.


User Related Files:


/usr/bin – It contains most of the executable files.

/usr/bin/X11 – Symbolic link of /usr/bin.

/usr/include – It contains standard include files used by C program.

/usr/share – It contains architecture independent shareable text files.

/usr/lib – It contains object files and libraries.

/usr/sbin – It contains commands for Super User, for System Administration.


Virtual and Pseudo Process Related Files:


/proc/cpuinfo – CPU Information

/proc/filesystems – It keeps the useful info about the processes that are running currently.

/proc/interrupts – it keeps the information about the number of interrupts per IRQ.

/proc/ioports – Contains all the Input and Output addresses used by devices on the server.

/proc/meminfo –  It reports the memory usage information.

/proc/modules – Currently using kernel module.

/proc/mount – Mounted File-system Information.

/proc/stat –  It displays the detailed statistics of the current system.

/proc/swaps –  It contains swap file information.


Version Information File:


/version – It displays the Linux version information.


Log Files:


/var/log/lastlog – It stores user last login info.

/var/log/messages – It has all the global system messages.

/var/log/wtmp – It keeps a history of login and logout information.

Useful HTTP Status Codes

 What are Useful HTTP Status Codes?

  • 1xx – Informational Response (These status codes are all about the information received by the server when a request is made).
  • 2xx – Success (This status code depicts that the request made has been fulfilled by the server and the expected response has been achieved).
  • 3xx – Redirection (The requested URL is redirected elsewhere).
  • 4xx – Client Errors (This indicates that the page is not found).
  • 5xx – Server Errors (A request made by the client but the server fails to complete the request). 

100 Continue 

101 Switching Protocol 

102 Processing (WebDAV) 

103 Early Hints 


200 OK 

201 Created 

202 Accepted 

203 Non-Authoritative Information 

204 No Content 

205 Reset Content 

206 Partial Content 

207 Multi-Status (WebDAV) 

208 Already Reported (WebDAV)

226 IM Used (HTTP Delta encoding) 


300 Multiple Choice

301 Moved Permanently 

302 Found

303 See Other

304 Not Modified 

305 Use Proxy 

306 Unused 

307 Temporary Redirect 

308 Permanent Redirect 


400 Bad Request 

401 Unauthorized 

402 Payment Required 

403 Forbidden 

404 Not Found 

405 Method Not Allowed

406 Not Acceptable 

407 Proxy Authentication Required

408 Request Timeout

409 Conflict 

410 Gone

411 Length Required 

412 Precondition Failed 

413 Payload Too Large 

414 URI Too Long 

415 Unsupported Media Type 

416 Range Not Satisfiable 

417 Expectation Failed 

418 I’m a teapot

421 Misdirected Request

425 Too Early 

426 Upgrade Required 

428 Precondition Required

429 Too Many Requests 

431 Request Header Fields Too Large

451 Unavailable For Legal Reasons 


500 Internal Server Error 

501 Not Implemented 

502 Bad Gateway

503 Service Unavailable 

504 Gateway Timeout 

505 HTTP Version Not Supported 

506 Variant Also Negotiates 

507 Insufficient Storage (WebDAV)

508 Loop Detected (WebDAV) 

510 Not Extended 

511 Network Authentication Required

Useful WEB Error Codes

 How to find the WEB Error Codes?

Please find the below Codes.

1. 400 : Bad Request

2. 401: Unauthorized Error

3. 402: Payment Error

4. 403: Forbidden Error

5. 404: Not Found

6. 405: Method not allowed

7. 406 : Not acceptable

8. 407 :Proxy authentication required

9. 408: Request Timeout

10. 409 : Conflict

11. 410: Gone

12. 411: Length Required

13. 412: Precondition Failed

14. 413: Payload Too Large

15. 414: URL Too Long

11. 500 : Internal Server Error

12. 501 : Not Implemented

13. 502 :Service Temporarily Overload

14. 503: Service Unavailable

Useful Keytool Commands


The Most Common Java Keytool Keystore Commands

Generate a Java keystore and key pair

keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks  -keysize 2048

Generate a certificate signing request (CSR) for an existing Java keystore

keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr

Import a root or intermediate CA certificate to an existing Java keystore

keytool -import -trustcacerts -alias root -file Thawte.crt -keystore keystore.jks

Import a signed primary certificate to an existing Java keystore

keytool -import -trustcacerts -alias mydomain -file mydomain.crt -keystore keystore.jks

Generate a keystore and self-signed certificate (see How to Create a Self Signed Certificate using Java Keytoolfor more info)

keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048

Java Keytool Commands for Checking

If you need to check the information within a certificate, or Java keystore, use these commands.


Check a stand-alone certificate

keytool -printcert -v -file mydomain.crt

Check which certificates are in a Java keystore

keytool -list -v -keystore keystore.jks

Check a particular keystore entry using an alias

keytool -list -v -keystore keystore.jks -alias mydomain

Other Java Keytool Commands

Delete a certificate from a Java Keytool keystore

keytool -delete -alias mydomain -keystore keystore.jks

Change a Java keystore password

keytool -storepasswd -new new_storepass -keystore keystore.jks

Export a certificate from a keystore

keytool -export -alias mydomain -file mydomain.crt -keystore keystore.jks

Java Keytool Commands for Creating and Importing


Generate a Java keystore and key pair

keytool -genkey -alias <aliasname> -keystore keystore.jks

Generate a certificate signing request (CSR) for an existing Java keystore

keytool -certreq -alias <aliasname> -keystore keystore.jks -file domain.csr

Import a root or intermediate CA certificate to an existing Java keystore

keytool -import -alias <root/intermediate> -file domain.crt -keystore keystore.jks

Import a signed primary certificate to an existing Java keystore

keytool -import -alias <appcert> -file mydomain.crt -keystore keystore.jks


Java Keytool Commands for Checking

If you need to check the information within a certificate, or Java keystore, use these commands.


Check a stand-alone certificate

keytool -printcert -v -file domain.crt

Check which certificates are in a Java keystore

keytool -list -v -keystore keystore.jks

Check a particular keystore entry using an alias

keytool -list -v -keystore keystore.jks -alias <alias-name>


Other Java Keytool Commands

Delete a certificate from a Java Keytool keystore

keytool -delete -alias mydomain -keystore keystore.jks

Change a Java keystore password

keytool -storepasswd -new new_storepass -keystore keystore.jks

Export a certificate from a keystore

keytool -export -alias mydomain -file mydomain.crt -keystore keystore.jks

TLS version checker

How to check TLS version in Linux

 

We can use the following command to check if which TLS version google.com supports.


#openssl s_client -connect www.google.com:443 -tls1

#openssl s_client -connect www.google.com:443 -tls1_1

#openssl s_client -connect www.google.com:443 -tls1_2

#openssl s_client -connect www.google.com:443 -tls1_3


-tls1 for TLSv1

-tls1_1 for TLSv1.1

-tls1_2 for TLSv1.2

 


We can also use nmap command to check the TLS version in Linux. nmap –script ssl-enum-ciphers -p 443 www.google.com

JSP - Overview

JavaServer Pages (JSP) is a technology for developing Webpages that supports dynamic content. 

Please refer below link for indetail information.


http://www.tutorialspoint.com/jsp/jsp_overview.htm

Java - Object and Classes

 Java is an Object-Oriented Language. As a language that has the Object-Oriented feature.

Please refer below link,  we will look into the concepts - Classes and Objects.


http://www.tutorialspoint.com/java/java_object_classes.htm

Friday, March 17, 2023

Designs of Application Workflow

 How many types of application workflow designs?

Please find the below sample designs of application workflow.











Useful tools for server administration

 what are the useful tools for server administration.


1.Putty -- useful tool for prompt servers, We can get the server terminal with hostname and IP address via TCP port 22.

-- useful tool for administration in prompt servers.

2.Winscp - Useful tool for prompt servers,We can get the server terminal with hostname and IP address via TCP/SSH port 22.

  -- useful tool for Files/Folders uploading/downloading

3.Fiddler - Useful tool for performs HTTP debugging by recording the traffic between the web and your machine 

4.RDP/MSTSC - useful tool for GUI server,We can get the windows server terminal with hostname and IP address.

5.SSH (Secure Shell) - SSH is short for "Secure Shell". SSH can be defined as a protocol that is used for securely connecting to a remote system or server. It is secure because it can transfer the information in encrypted format among the client and the host.

It also transfers inputs through the client to a host. This command executes at the 22th port of the TCP/IP.

ssh user_name@hist(IP/Domain_name)  

6. FTP- Useful tool for FTP command is still useful when you work remotely on a server over an SSH session

a)Establishing an FTP connection

ftp domain.com

ftp 192.168.0.1

ftp user@ftpdomain.com

b)Working with Directories

ftp> ls

ftp> cd directory

c)Downloading files with FTP

get file

mget *.xls

d)Uploading Files with FTP

put file

put /path/file

mput *.xls

e)Closing the FTP connection

bye

exit

quit


Types of Operating System Servers

 How many types of operating systems servers?


1. Command Prompt

2. GUI (Graphical Interface Servers)


Command Prompt Servers are like terminal/session servers which we can do administration in single terminal.

Known as Linux, AIX, Sun Solaris, Unix

GUI Servers are like Windows Servers which we can do administration as user interface.

Known as Windows Servers





Application Layer in OSI model

 The Open Systems Interconnection model (OSI model) is a conceptual model, originally conceived as the 7 layer onion skin architecture by Jack Holdsworth of ICL,[citation needed] that 'provides a common basis for the coordination of [ISO] standards development for the purpose of systems interconnection'. In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.




Useful Commands for App Uniform Resource Locator (URL) using command prompt

What are the useful Commands for App Uniform Resource Locator (URL) using command prompt? 


curl command prompt


curl https://App Domain

curl http://App Domain:Port

curl http://App Domain:Port/Static file

curl -u {username}:{password} [URL]

curl -Is http://www.yourURL.com | head -1

wget command prompt

wget [options] [url]

wget https://App Domain

wget --no-check-certificate  https://App Domain

additional command prompt

telnet www.yourURL.com 80

ping -c 5 www.google.com


Useful Commands for App Uniform Resource Locator (URL) using web browser

 What are the useful Commands for App Uniform Resource Locator (URL) using web browser?


1. https://FQDN

2.https://FQDN/Context-Root

3.https://FQDN/Context-Root/Static-page

4.http://FQDN:Port/Context-Root

5.http://Webserver Hostname/IP:Port/Context-Root/Static-page

6.http://Webserver Hostname/IP:Port/Context-Root

7.http://Webserver Hostname/IP:Port/Context-Root/Static-page

8.http://Appserver Hostname/IP:Port/Context-Root/Static-page

9.http://Appserver Hostname/IP:Port/Context-Root

10.http://Appserver Hostname/IP:Port/Context-Root/Static-page


Useful commands in Unix

 What are the useful commands in Unix ?


1.df -g

2.df -k

3. df -m

4.top

5.topas

6.ps -ef|grep java

7.ps -ef|grep httpd

8.ps -ef|grep admin

9.lsof -i:<port>

10.netstat -anop|grep <port>

11.grep -i -r <keyword> <Directory>

12.nslookup

13.ping

14.cat <file name> | more

15.more <File name>

16.tail -100f <file name>

17.tail -f <file name> 

18.curl -v <Destination>:<port>

19.ipconfig -a

20.ifconfig -a

21.locate

22.find . -name <keyword>

23.find / -name <keyword>

24.uname -a

25.netstat -anop|grep <process-id>


Sunday, March 12, 2023

Business Application Components

 What are the components required for business applications?


1.Web Browser

2.Internet/Intranet 

3.Loadblancer

4.. Firewall

5.Webserver

6. Plugin

7.App Server

8.Database

Application Tier List

 How to make a tier list for application workflow?


1. Load balancer.

2. Web Tier : It contains the HTTP Webserver and Plugin.

3. App Tier: It contains the App servers and Installed with Application Code/Articats/EAR/WAR.

4. DB Tier: It contains the Database.


How to check Productivity of Team members

 The following method is a simple analysis for managing team of their productivity check.


1. Open Excel

2. Keep column as Employee, Tasks assigned, Task finished, Final Percentage

3.Enter the data as above and update Max Tasks assigned is same for all employee and Task finish as per employee on end of the report/month.

4.In Final percentage, calculate as below.



Example as below and update