SpammerAction.java
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.sitech.ismp.ice.syslogd;
import java.io.*;
import java.net.*;
import java.lang.*;
import com.ice.rexec.RExec;
public class
SpammerAction
{
public static final String RCS_ID = "$Id: SpammerAction.java,v 1.2 1998/02/24 03:39:36 time Exp $";
public static final String RCS_REV = "$Revision: 1.2 $";
public static final String RCS_NAME = "$Name: $";
private String expr;
private SyslogMatch matcher;
public
SpammerAction()
{
this.expr = expr;
}
public void
setParameters( String[] parameters )
{
this.expr = parameters[0];
}
public void
restart()
{
}
public void
openAction()
{
this.matcher = new SyslogMatch();
try {
this.matcher.compile( this.expr );
}
catch ( MatchCompileException ex )
{
this.matcher = null;
}
}
public void
closeAction()
{
}
public void
processMessage( SyslogMessage logMsg )
{
if ( this.matcher.matchMessage( logMsg.message ) )
{
String ipAddr = this.matcher.getMatchSubExpr( 1 );
RExec exec =
new RExec( "stylus.ice.com", "time", "timebomb",
"/home/time/killspam " + ipAddr );
try { exec.open(); }
catch ( UnknownHostException ex )
{
System.err.println
( "UNKNOWN HOST opening killspam: "
+ ex.getMessage() );
}
catch ( IOException ex )
{
System.err.println
( "ERROR opening killspam: "
+ ex.getMessage() );
}
exec.close();
}
}
}