Browse Source

Modification format log

GotExx 1 year ago
parent
commit
8b68a1c1c7
5 changed files with 10 additions and 67 deletions
  1. 0
    28
      calcul-empreintes-hids.sh~
  2. 6
    3
      history.txt
  3. 3
    3
      new-check-empreintes.sh
  4. 0
    32
      new-check-empreintes.sh~
  5. 1
    1
      new-checkedfile.checksum

+ 0
- 28
calcul-empreintes-hids.sh~ View File

@@ -1,28 +0,0 @@
1
-#!/bin/bash
2
-
3
-#######################
4
-##                   ##
5
-##   HIDS By GotExx  ##
6
-##                   ##
7
-#######################
8
-RED='\033[0;31m'
9
-GREEN='\033[0;32m'
10
-NC='\033[0m'
11
-current_datetime=$(date +%D-%T)
12
-path=/home/hugo/sites/wordpress
13
-text_file=$1
14
-if [ -d $path ];then
15
-	for line in $(cat $text_file);
16
-	do 
17
-		if [ -f $path/$line ];then
18
-			sha1sum $path/$line > ./checkedfile.checksum
19
-		elif [ -d $path/$line ];then
20
-			echo "$path/$line n'est pas un fichier valide"
21
-		else
22
-			echo "erreur NC"
23
-		fi
24
-	done
25
-	echo -e "${GREEN}Empreintes calculées.${NC}"
26
-else
27
-	echo -e "${RED}Chemin inconnu${NC}"
28
-fi

+ 6
- 3
history.txt View File

@@ -1,3 +1,6 @@
1
-01/24/18-15:36:02 True
2
-01/24/18-15:36:04 True
3
-01/24/18-15:36:08 True
1
+1 01/25/18-14:25:37;
2
+0 01/25/18-14:25:40;
3
+1 01/25/18-14:25:42;
4
+1 01/25/18-14:28:08;
5
+1 01/25/18-15:30:34;
6
+0 01/25/18-15:31:10;

+ 3
- 3
new-check-empreintes.sh View File

@@ -24,9 +24,9 @@ empreinte_file=`sha1sum $check_file`
24 24
 empreinte_new_file=`sha1sum $new_check_file`
25 25
 
26 26
 if [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` != `echo "$empreinte_new_file" | awk -F' ' {'print $1'}`  ];then
27
-	echo "$current_time : Attention les empreintes sont différentes !" >> history.txt
27
+	echo "0 $current_time;" >> history.txt
28 28
 elif [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` == `echo "$empreinte_new_file" | awk -F' ' {'print $1'}` ];then
29
-	echo "$current_time True" >> history.txt
29
+	echo "1 $current_time;" >> history.txt
30 30
 else
31
-	echo "$current_time False" >> history.txt
31
+	echo "2 $current_time;" >> history.txt
32 32
 fi

+ 0
- 32
new-check-empreintes.sh~ View File

@@ -1,32 +0,0 @@
1
-#!/bin/bash
2
-
3
-#######################
4
-##                   ##
5
-##   HIDS By GotExx  ##
6
-##                   ##
7
-#######################
8
-
9
-NC='\033[0m'
10
-path=/home/hugo/sites/wordpress
11
-check_file="checkedfile.checksum"
12
-new_check_file="new-checkedfile.checksum"
13
-text_file=$1
14
-
15
-rm -f $new_check_file
16
-
17
-for line in $(cat $text_file);
18
-do
19
-	current_time=$(date +%D-%T)
20
-	sha1sum $path/$line  >> ./$new_check_file
21
-done
22
-
23
-empreinte_file=`sha1sum $check_file`
24
-empreinte_new_file=`sha1sum $new_check_file`
25
-
26
-if [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` != `echo "$empreinte_new_file" | awk -F' ' {'print $1'}`  ];then
27
-	echo "$current_time : Attention les empreintes sont différentes !" >> history.txt
28
-elif [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` == `echo "$empreinte_new_file" | awk -F' ' {'print $1'}` ];then
29
-	echo "$current_time = True" >> history.txt
30
-else
31
-	echo "$current_time = False" >> history.txt
32
-fi

+ 1
- 1
new-checkedfile.checksum View File

@@ -1 +1 @@
1
-e7d0d3165abc87c1f60be176db6f57f9dcfcce89  /home/hugo/sites/wordpress/wp-config.php
1
+af710c11b436f37a455c6841810091141ce2f079  /home/hugo/sites/wordpress/wp-config.php

Loading…
Cancel
Save