From 4695d52c22e441e60ef474ddb9a96385e17c8c45 Mon Sep 17 00:00:00 2001 From: "random-toto@localhost" Date: Tue, 28 Jun 2016 18:18:55 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20fichier=20bashrc=20compl=C3=A9mentaire?= =?UTF-8?q?=20et=20iptables=20pour=20interdire=20samba?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpp/makefile | 25 +++++++++++++++++-------- shell/bashrc_append | 35 +++++++++++++++++++++++++++++++++++ shell/forbid_samba.sh | 6 ++++++ 3 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 shell/bashrc_append diff --git a/cpp/makefile b/cpp/makefile index cb67205..94f184c 100644 --- a/cpp/makefile +++ b/cpp/makefile @@ -1,25 +1,34 @@ -# var. C/C++ +# var CC = gcc -#CC = g++ -CFLAGS = -Wall -std=c11 -g -#CFLAGS = -Wall -O0 -g -std=c++1y -Werror=uninitialized -Werror=conversion +CFLAGS = -Wall -std=c11 -g -fno-stack-protector -z execstack +CANARY = -Wall -std=c11 -g -fstack-protector --param ssp-buffer-size=64 +AFLAGS = -S -Wall -std=c11 -g RM = /bin/rm # src, .o, .out SRC = ${wildcard *.c} -HEAD = ${SRC:.c=.h} +ASM = ${SRC:.c=.s} OBJ = ${SRC:.c=.o} ELF = ${SRC:.c=.out} -# target +# targets +all: ${ELF} + : +asm: ${ASM} + : + +# rules ${ELF}: ${OBJ} ${CC} ${OBJ} -o ${ELF} + # object %.o: %.c ${CC} -c ${CFLAGS} $< -o $@ +%.s: %.c + ${CC} ${AFLAGS} $< -o $@ + # cleanall clean: - ${RM} -f ${ELF} ${OBJ} - + ${RM} -f ${ELF} ${OBJ} ${ASM} diff --git a/shell/bashrc_append b/shell/bashrc_append new file mode 100644 index 0000000..9406bdd --- /dev/null +++ b/shell/bashrc_append @@ -0,0 +1,35 @@ +alias l='ls -lhp --color=always --time-style=long-iso' +alias ll='ls -lrthp --color=always --time-style=long-iso' +alias lll='ls -lArthp --color=always --time-style=long-iso' +alias rm='rm -iv' +alias cp='cp -iv' +alias mv='mv -iv' +alias du='du -h --si' +alias df='df -h --si' +alias scp='scp -v' +alias less='less -R' +alias v='vim -R' +alias p='python3' +alias ..='cd ..' +alias ...='cd ../..' +alias c='cc -Wall -g -O0 -std=c11' +alias g='g++ -Wall -g -O0 -std=c++1y -Werror=conversion -Werror=uninitialized' + +HISTCONTROL=ignoreboth + +TTY=$(tty | grep -o tty) + if [ -z $TTY ]; then + man() { + env LESS_TERMCAP_mb=$'\E[01;31m' \ + LESS_TERMCAP_md=$'\E[01;38;5;74m' \ + LESS_TERMCAP_me=$'\E[0m' \ + LESS_TERMCAP_se=$'\E[0m' \ + LESS_TERMCAP_so=$'\E[38;5;246m' \ + LESS_TERMCAP_ue=$'\E[0m' \ + LESS_TERMCAP_us=$'\E[04;38;5;146m' \ + man "$@" + } +fi + +PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[00m\]\[\033[01;34m\]@\[\033[00m\]\[\033[01;31m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' + diff --git a/shell/forbid_samba.sh b/shell/forbid_samba.sh index b672685..563f0ce 100644 --- a/shell/forbid_samba.sh +++ b/shell/forbid_samba.sh @@ -13,3 +13,9 @@ iptables -A INPUT -p tcp --destination-port 445 -j REJECT iptables -A INPUT -p tcp --destination-port 137 -j REJECT iptables -A INPUT -p tcp --destination-port 138 -j REJECT +ip6tables -A INPUT -p tcp --destination-port 135 -j REJECT +ip6tables -A INPUT -p tcp --destination-port 139 -j REJECT +ip6tables -A INPUT -p tcp --destination-port 445 -j REJECT +ip6tables -A INPUT -p tcp --destination-port 137 -j REJECT +ip6tables -A INPUT -p tcp --destination-port 138 -j REJECT +