본문 바로가기

bash6

728x90
Bourne Again Shell (Bash) 임의코드 실행 취약점 보안 업데이트 개요리눅스 계열 등 운영체제에서 사용중인 GNU Bash에서 발생하는 임의코드 실행 취약점 (CVE-2014-6271) 보안 업데이트를 우회하여 악용할 수 있는 취약점 발생 (CVE-2014-7169)공격자는 해당 취약점이 존재하는 시스템을 대상으로 원격에서 악의적인 시스템 명령을 실행시킬 수 있으므로 해결방안에 따라 보안 업데이트 적용 권고 해당 시스템영향 받는 시스템GNU Bash를 사용하는 시스템 해결방안해당 취약점에 대한 보안업데이트가 공개된 OS를 운영하고 있을 경우, 참고사이트의 내용을 참조하여 보안업데이트 수행CentOS [1]Debian [2]Redhat [3]Ubuntu [4] 용어 정리Shell : 사용자가 입력한 문장을 해석하여 시스템 기능을 수행하는 명령어 해석기 기타 문의사항한국인.. 2014. 9. 26.
Bash Vulnerability Code Injection Attack bash_ld_preload.c#include #include #include static void __attribute__ ((constructor)) strip_env(void); extern char **environ; static void strip_env() { char *p,*c; int i = 0; for (p = environ[i]; p!=NULL;i++ ) { c = strstr(p,"=() {"); if (c != NULL) { *(c+2) = '\0'; } p = environ[i]; } } Compile it:gcc bash_ld_preload.c -fPIC -shared -Wl,-soname,bash_ld_preload.so.1 -o bash_ld_preload.so Copy ba.. 2014. 9. 25.
Bash Script: How read file line by line (best and worst way) Input: $ cat sample.txt This is sample file This is normal text file Source: $ cat readfile.sh #!/bin/bash i=1; FILE=sample.txt # Wrong way to read the file. # This may cause problem, check the value of 'i' at the end of the loopecho "###############################" cat $FILE | while read line; do echo "Line # $i: $line" ((i++)) done echo "Total number of lines in file: $i" # The worst way to r.. 2014. 9. 19.
Bash: Pass Shell Variables To awk How do I pass shell variables to awk command or script under UNIX like operating systems? The -v option can be used to pass shell variables to awk command. Consider the following simple example, root="/webroot" echo | awk -v r=$root '{ print "shell root value - " r}' In this example search file using awk as follows: #!/bin/bash # Usage : Search word using awk for given file. # Syntax: ./script ".. 2012. 7. 18.
Bash Shell Shortcuts (쉘 단축키) Bash, which is the default shell in Linux contains a whole lot of key bindings which makes it really easy to use . The most commonly used shortcuts are listed below : ____________CTRL Key Bound_____________ Ctrl + a - Jump to the start of the line Ctrl + b - Move back a char Ctrl + c - Terminate the command Ctrl + d - Delete from under the cursor Ctrl + e - Jump to the end of the line Ctrl + f -.. 2011. 2. 18.
728x90