[#38470] ruby-dev summary 21403-21530 (draft) — Minero Aoki <aamine@...>

青木です。

25 messages 2003/10/07
[#38475] Re: ruby-dev summary 21403-21530 (draft) — maili31s@... (SugHimsi==SUGIHARA Hiroshi) 2003/10/07

すぎむし。

[#38480] Re: ruby-dev summary 21403-21530 (draft) — Minero Aoki <aamine@...> 2003/10/08

青木です。

[#38481] marshal_dump (was Re: ) — m_seki@... 2003/10/08

[#38484] Re: marshal_dump (was Re: ) — matz@... (Yukihiro Matsumoto) 2003/10/09

まつもと ゆきひろです

[#38486] Re: marshal_dump (was Re: ) — Masatoshi Seki <m_seki@...> 2003/10/09

咳といいます

[#38489] exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to>

<http://www.unixuser.org/~ysjj/diary/?200310a&to=200310082#200310082>

29 messages 2003/10/09
[#38490] Re: exit status on exit! — Koji Arai <JCA02266@...> 2003/10/09

新井です。

[#38503] Re: exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to> 2003/10/10

In Message-Id: <20031010.082218.74733862.JCA02266@nifty.ne.jp>

[#38505] Re: exit status on exit! — Koji Arai <JCA02266@...> 2003/10/10

新井です。

[#38507] Re: exit status on exit! — matz@... (Yukihiro Matsumoto) 2003/10/11

まつもと ゆきひろです

[#38514] Re: exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to> 2003/10/11

In Message-Id: <1065883639.405037.23137.nullmailer@picachu.netlab.jp>

[#38515] Re: exit status on exit! — WATANABE Hirofumi <eban@...> 2003/10/11

わたなべです。

[ruby-list:38662] 空行で別れたデータから特定の文字を含むデータを削除したい

From:
Date: 2003-10-25 20:32:38 UTC
List: ruby-list #38662
竹島と申します。
初めてのMLです。
rubyの皆様には簡単なことと存じますが、以下で困ってます。

/var/log/snort/alertには
[**] [1:483:2] ICMP PING CyberKit 2.2 Windows [**]
[Classification: Misc activity] [Priority: 3]
10/09-23:09:51.737032 220.48.56.4 -> 220.49.236.90
ICMP TTL:120 TOS:0x0 ID:39502 IpLen:20 DgmLen:92
Type:8  Code:0  ID:512   Seq:61898  ECHO
[Xref => http://www.whitehats.com/info/IDS154]

[**] [1:1852:3] WEB-MISC robots.txt access [**] 
[Classification: access to a potentially vulnerable web application] [Priority: 2]
10/09-23:09:57.360008 66.196.65.34:37667 -> 220.49.236.90:80
TCP TTL:50 TOS:0x0 ID:2844 IpLen:20 DgmLen:234 DF
***AP*** Seq: 0x502F53B5  Ack: 0x118537AD  Win: 0x16D0  TcpLen: 32
TCP Options (3) => NOP NOP TS: 1112910037 850038182
[Xref => http://cgi.nessus.org/plugins/dump.php3?id=10302]

[**] [1:483:2] ICMP PING CyberKit 2.2 Windows [**]
[Classification: Misc activity] [Priority: 3]
10/09-23:11:22.945219 24.112.254.62 -> 220.49.236.90
ICMP TTL:107 TOS:0x0 ID:23958 IpLen:20 DgmLen:92  
Type:8  Code:0  ID:27126   Seq:9694  ECHO
[Xref => http://www.whitehats.com/info/IDS154]
以下略というふうに [Xref => http://www.whitehats.com/info/IDS154] 関係が猛烈にたくさん来ます。

そこで 例えば上の場合
[**] [1:1852:3] WEB-MISC robots.txt access [**] 
[Classification: access to a potentially vulnerable web application] [Priority: 2]
10/09-23:09:57.360008 66.196.65.34:37667 -> 220.49.236.90:80
TCP TTL:50 TOS:0x0 ID:2844 IpLen:20 DgmLen:234 DF
***AP*** Seq: 0x502F53B5  Ack: 0x118537AD  Win: 0x16D0  TcpLen: 32
TCP Options (3) => NOP NOP TS: 1112910037 850038182
[Xref => http://cgi.nessus.org/plugins/dump.php3?id=10302]
のみを残したいと思い、klugに相談したら K先生から

#!/usr/local/bin/python
import re
e = [   'BAD-TRAFFIC loopback traffic',
        'ICMP PING CyberKit 2.2 Windows',
        'MS-SQL',
        'WEB-CGI count.cgi access',
        'WEB-FRONTPAGE /_vti_bin/ access',
        'WEB-IIS',    
        'WEB-MISC robots.txt access',
        'SCAN Proxy (8080) attempt',
        'SCAN SOCKS Proxy attempt',
        'SCAN Squid Proxy attempt',
        'SCAN UPnP service discover attempt',
  ]
p = re.compile('|'.join(e))
s = open('/var/log/snort/alert').read()
r = s.split('\n\n')
for x in r:
    if  p.search(x):
        pass
    else:
        print x + '\n'

という pythonのスクリプトを戴きました(他にもBAD-TRAFFIC loopback traffic等を含む行を削除)。
ruby勉強ぶそくで 私には同等の機能をもつrubyスクリプトが書けません。
図々しいお願いとは存じますが、 何卒宜しくお願い申し上げます。

In This Thread

Prev Next