본문 바로가기

Linux

CentOS 7 관리 - APM : Apache, PHP, MariaDB 설치 설치 전 준비의존성 라이브러리를 설치합니다 libpng* 의 경우 설치시 충돌이 발생하여... --skip-broken 옵션을 지정하여 설치 # yum -y install gcc gcc-c++ libtermcap-devel gdbm-devel zlib* libxml* freetype* libjpeg* gd-* # yum -y install libpng* --skip-broken Apache, PHP, MariaDB 설치yum 으로 Apach 설치 # yum -y install httpd Apach 설정 # vi /etc/httpd/conf/httpd.conf #User apache /*User nobody 변경 */ #Group apache /*Group nobody 변경 */ User nobody Gr.. 더보기
다중문자 검색 (awk, grep, egrep), awk 문자열 일치 및 포함 # songsong 문자열과 일치하는 경우 cat lewis*.txt | awk -F '|' '{if($4 == "songsong") { print $0}}' # songsong 문자열을 포함하는 경우cat lewis*.txt | awk -F '|' '{if($4 ~ "songsong") { print $0}}' # 다중 문자 검색 (grep)cat file.txt | grep "A\|B"cat file.txt | grep -P "A|B" # 다중 문자 검색 (egrep)cat file.txt | egrep '(A|B)' # 다중 문자 검색 (awk)cat my_file.txt | awk '/A|B/' 더보기
find로 검색된 파일 내에서 특정 문자열 한번에 찾기 어제 오늘 생성된 파일중에서 특정 IP에서 발생한 로그를 빠르게 확인하려면? ex.) 현재 디렉토리에서 하루전 수정된 파일 유형을 찾아 111.111.111.111 IP를 검색하라~ # find ./ -type f -mtime -1 -print -exec grep -H "111.111.111.111" {} \; 더보기
리눅스 cpu core, memory, 제품명 확인 :: 장비 모델명 확인[root@thor036 deploy]# dmidecode -s system-product-namePowerEdge R610 :: 전체코어 갯수[root@localhost leopit]# grep -c processor /proc/cpuinfo24 :: cpu당 물리코어[root@localhost leopit]# grep 'cpu cores' /proc/cpuinfo | tail -1cpu cores: 6 :: CPU 모델[root@localhost leopit]# cat /proc/cpuinfo | grep "model name"model name: Intel(R) Xeon(R) CPU E5645 @ 2.40GHzmodel name: Intel(R) Xeon(R) CPU E5645.. 더보기
nslookup, dig 사용하기 [root@s92 etc]# nslookup > www.ttl.co.kr Server: 211.63.64.11 우리꺼 네임서버 Address: 211.63.64.11#53 (포트)Non-authoritative answer: Name: www.ttl.co.kr Address: 203.236.17.23> set querytype=ns > www.ttl.co.kr Server: 211.63.64.11 Address: 211.63.64.11#53Non-authoritative answer: ttl.co.kr nameserver = gate.sktelecom.com. ttl.co.kr nameserver = gate2.sktelecom.com.Authoritative answers can be found fro.. 더보기
umask란? 1. umask란? 솔라리스에서는 여러 가지 환경 설정 파일을 제공하는데, 이것은 사용자를 더욱 자유롭고 융통성 있게 만들어 준다. 이런 파일들은 보통 홈디렉토리안에 위치하고 있으며, '.'으로 시작 하는 파일들을 말한다. 'ls -a' 명령으로 파일의 존재를 확인할 수 있으며, 파일의 이름은 "Resource Configuration"이라는 의미의 "rc"라는 스펠링으로 끝나는 경우가 많다. Umask는 처음 파일이나 디렉토리를 만들면 파일이나 디렉토리에 대한 기본적인 권한(permission)이 자동설정 되는데, 이러한 것은 시스템파일의 umask에 의하여 결정이 된다. umask는 .profile, .cshrc, .bashrc, .login과 같은 사용자 프로파일에서 설정한다. 2. umask의 사.. 더보기
Linux 사용자 계정 관련커맨드 : useradd, usermod, /etc/passwd, /etc/shadow, /etc/default/useradd /etc/default/useradd (사용자를 추가할때 기본설정환경을 부여해주는 파일) # useradd defaults file GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel GROUP 100 : 기본적으로 사용자/그룹 같게 생성. HOME=/home : 홈디렉토리 INACTIVE=-1 : 사용자생성시 패스워드생성하지않았을때 Lock를 걸어준다는 기본설정옵션(변경시 0,1로 변경) EXPIRE : 패스워드 만료시간(공백은 기본설정 기본 : 99999) SHELL=/bin/bash : 기본 쉘.. 더보기
[Linux] Web Hacking (Linux Server Security) 1. Web Application Vulnerability - 최초의 웹 페이지는 정적(static)이었다. 즉, 모든 사람들이 누군가에 의해 만들어진 똑 같은 페이지만을 볼 수가 있었다. 대표적인 웹 언어로 분량이 많지 않고 부담이 적은 HTML이 있다. HTML(Hyper Text Markup Language)은 단순하고 직설적이며 어려운 개념이 거의 포함되어 있지 않다. - 현재의 웹 페이지들은 상호작용을 하며 동적 데이터를 갱신하고 복잡한 그래픽 화면에 필요한 동작들을 한다. 대표적인 예로 JSP, ASP, PHP등이 있다. 이러한 웹 페이지를 동적(dynamic) 웹 페이지라고 한다. 동적 웹 페이지는 사용자가 입력한 값에 따라서 서버에서 사용자에게 보여주는 페이지가 달라진다. - OWASP(O.. 더보기
잘 알려진 백도어에서 사용하는 포트 NamePortCYN113Net Taxi142Backage334BAL666Back constrution666Undetected777Vampire1020internal revise1064subseven1074subseven 1.91243subseven 1.01243Frenzy1257Remote Hack1480TMC presents1999SheepGoat2003dagger2589Wartojan4201CrAcKDoWn4444Net Metropolitan5031backage 3.0.15333wincrash5742y3k rat 1.65802y3k rat5802Y3k rat5880Deep throat6000Matrix7778ReVeNgEr7891Netministrator Client9000incommand9400i.. 더보기
이메일 오픈릴레이 테스트 오픈릴레이 테스트 명령 프롬프트 창에서 telnet x.x.x.x 25 번으로 접속을 하면 220 test3.xxxnet.co.kr ESMTP Sendmail 8.12.8/8.12.8; Tue, 7 Sep 2004 19:09:4 7 +0900 위의 메세지가 뜬다면 다음 명령 실행을 한다. helo mail from: test@test.com rcpt to: administrator@xxxnet.co.kr 205 2.1.0 administrator@xxxnet.co.kr rcpt to: admin@xxx.com unable to relay 위의 메세지가 나오면 오픈릴레이가 아니라는 것입니다. 더보기