Programming Language/Shell6 kscan final #!/bin/bash if [ X$1 = Xscan ] #입력을 scan으로 받았다면... then ls -iR1 | grep -v ":" | awk '{print $1}' > inum.swp cat -s inum.swp | sed '/^[[:space:]]*$/d' > inum for PWD in $(cat inum) inode do find -inum $PWD -exec grep -li hack {} \; >> scanlist.swp find -inum $PWD -exec grep -li wsxhost {} \; >> scanlist.swp # find -inum $PWD -exec grep -li backdoor {} \; >> scanlist.swp # find -inum $PWD -exec gr.. 2009. 5. 12. whois스크립트. input 부분 #!/bin/bash nameserv=$(dig $1 | grep ns | tail -n 1 | awk '{print $5}') host -a $1 $nameserv output 부분 [root@alinos root]# hosts dreamwiz.com Trying "dreamwiz.com" Using domain server: Name: 61.111.245.3 Address: 61.111.245.3#53 Aliases: ;dreamwiz.com.INANY dreamwiz.com.900INSOAns0.dreamwiz.com. dnsmaster.dreamwiz.com. 2009070203 1200 300 604800 60 dreamwiz.com.900INTXT"v=spf1 ip4:61.11.. 2009. 4. 6. kscan 0.3 #!/bin/bash if [ X$1 = Xscan ] #입력을 scan으로 받았다면... then for A in $(pwd) #A변수에 pwd 현재 경로를 담는다. do for scan in $(cat /root/kih/db/scandb) #scan이라는 변수에 scandb내용을 하나씩 대입한다. do find "$A" -type f | xargs grep -li $scan >> scanlist.swp # scan db에서 읽어오는 파일들 하나하나에 find문이 현재경로를 # 대입하여 스캔한다. done sort -u scanlist.swp > scanlist # 중복된 문자열 제거 rm -f scanlist.swp # 스왑파일 삭제! done wc -l scanlist else if [ X$1 = .. 2009. 3. 6. kscan #!/bin/bash if [ X$1 = Xscan ] #입력을 scan으로 받았다면... then for A in $(pwd) #A변수에 pwd 현재 경로를 담는다. do find $A -type f | xargs grep -li $scan > scanlist #현재 경로를 받아 파일리스트들을 scanlist라는 파일에 목록으로 집어넌다. done else if [ X$1 = Xhtaccess ] #입력을 htaccess로 받았다면... then for B in $(pwd) #B라는 변수에 현재 경로를 담는다. do find $B -name .htaccess > htaccesslist #현재 경로를 받아 .htaccess파일들 위치를 htaccesslist에 집어넌다. done else if [ X$1.. 2009. 3. 3. lfi scan 본격. #!/bin/bash if [ X$1 = Xscan ] then find ./ -type f > scanlist else if [ X$1 = Xhtaccess ] then find ./ -name .htaccess > htaccesslist else if [ X$1 = Xiframe ] then find ./ -type f | xargs grep -li iframe > iframelist else if [ X$1 = Xhelp ] then echo "scan - scanlist" echo "htaccess - htaccesslist" echo "iframe - iframelist" fi fi fi fi 2009. 3. 3. awk 사용법! ls -l | grep d----- | awk '{print $9} 설명 : ls -l 이란 명령에서 퍼미션 000 인것을 찾고 거기서 9번째 행을 출력시킨다. 2008. 10. 14. 이전 1 다음