Posts

Showing posts from March, 2022

FINAL ROOT -LOGIN FAILURE -SUCCESSFUL ONE - SPIDERMAN

#!/bin/bash # Server Tested : compute90-cc : 8.25.218.59 10.170.16.186 : compute90-cc.packet8-pilot.net :ssobeta04-cc : capture_root_logging_failures.sh #####   --  Author of Script  - Sreejith Balakrishnan    #####       Purpose : 1. This script capture failed logins for root users whoever fails to connect successfully in their first 5 attempts  #####                 2. And only if those 5 failed attempts happens within 15 min timeline -- In such cases logs are generated #set -x ###----------------- ##### Declarations : ###----------------- #####   --  Put in the number of Failed Login Attempts you want to capture attempted_counts=5 #####   --  Time in seconds within which the count of login attempts(attempted_counts) to be captured seconds=900 ###------------------------ ##### End of Declations : ###------------------------ root_login(){ #rm -Rf /tmp/logins...

ROOT-OTHER CONDITIONS

###  time_check.sh convert_time_seconds() { #!/bin/bash rm -Rf /tmp/timechecker.log rm -Rf /tmp/time_of_logins.log rm -Rf /tmp/time_to_seconds.log cat /tmp/LOGIN_FAILED_ROOT.log | awk '{print $7}' >>  /tmp/time_of_logins.log cat /tmp/time_of_logins.log | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' > /tmp/time_to_seconds.log cat /tmp/time_to_seconds.log times_count=`cat /tmp/time_to_seconds.log  | wc -l` echo " " echo "-----------------------------------------------------------------" echo "Total Number of Failed login attempts by Root User : $times_count" echo "-----------------------------------------------------------------" echo " " } convert_time_seconds #### Second Script -----------Creating Variables equal to the count of inputs in seconds--------------------------------- ###  create_variables.sh create_variables() { #!/bin/bash  rm -Rf /tmp/variables.log in_seconds=`wc -l < /tmp/time_to_seconds.lo...

FIRST-SUCCESSFUL SCRIPT -- NEEDED EDITION -- FIRST SUCCESSFUL ONE

#!/bin/bash # Server Tested : compute90-cc : 8.25.218.59 10.170.16.186 : compute90-cc.packet8-pilot.net #####   --  Author of Script  - Sreejith Balakrishnan    #####       Purpose : 1. This script capture failed logins for root users whoever fails to connect successfully in their first 5 attempts  #####                 2. And only if those 5 failed attempts happens within 15 min timeline -- In such cases logs are generated #set -x ###----------------- ##### Declarations : ###----------------- #####   --  Put in the number of Failed Login Attempts you want to capture attempted_counts=5 #####   --  Time in minutes within which the count of login attempts to be captured seconds=900 ###------------------------ ##### End of Declations : ###------------------------ root_login(){ #rm -Rf /tmp/logins_1.log #rm -Rf /tmp/logins_2.log #rm -Rf /tmp/logins_11.log #rm -Rf...