'Block'에 해당하는 글 2건

#!/bin/bash

for i in $( tail -n50 /usr/local/apache/logs/*log | grep '301 ' | awk '{print $1}' | sort | uniq -c | awk '$1 >30 {print $2}'); do
echo "$i blocked"
/root/block $i
done

sleep 30

for i in $( tail -n50 /usr/local/apache/logs/*log | grep '301 ' | awk '{print $1}' | sort | uniq -c | awk '$1 >30 {print $2}'); do
echo "$i blocked"
/root/block $i
done


for i in $(tail -n50 /usr/local/apache/logs/*log | grep 'htmGET' | awk '{print $2}' | grep -v 'Jan'); do

echo "$i blocked"

/root/block $i

done



cat block 

#!/usr/local/bin/php

<?

posix_setuid(0);

$ip = $argv[1];


//$id = sem_get(0x12341234, 1);

//sem_acquire($id);


$a = `iptables -L -n | grep $ip`;

if(!$a)`iptables -I INPUT -s $ip -j DROP`;


//sem_release($id);

?>


신고
크리에이티브 커먼즈 라이선스
Creative Commons License

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret


root@www ~ [0.00 0.00]> tune2fs -l /dev/xvda1
tune2fs 1.39 (29-May-2006)
Filesystem volume name:   /boot   
Last mounted on:          <not available>
Filesystem UUID:          5eff8143-5abe-432e-b5a4-1624fe82e823
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              26104
Block count:              104388
Reserved block count:     5219
Free blocks:              88221
Free inodes:              26067

First block:              1
Block size:               1024
Fragment size:            1024
Reserved GDT blocks:      256
Blocks per group:         8192
Fragments per group:      8192
Inodes per group:         2008
Inode blocks per group:   251
Filesystem created:       Fri Dec 31 09:55:10 2010
Last mount time:          Thu Jun 14 14:22:59 2012
Last write time:          Thu Jun 14 14:22:59 2012
Mount count:              4
Maximum mount count:      -1
Last checked:             Fri Dec 31 09:55:10 2010
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:            128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      c7d7c2bb-321d-47ba-9735-2de298c3e024
Journal backup:           inode blocks

저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret