[759] in winnt
Scripts from the December meeting for security (permission) analysis.
daemon@ATHENA.MIT.EDU (Bryant C. Vernon)
Thu Dec 20 13:58:59 2001
From: "Bryant C. Vernon" <bcvernon@MIT.EDU>
To: <winpartners@mit.edu>
Date: Thu, 20 Dec 2001 13:54:21 -0500
Message-ID: <002a01c18987$bc60df20$50021212@mit.edu>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_002B_01C1895D.D38AD720"
This is a multi-part message in MIME format.
------=_NextPart_000_002B_01C1895D.D38AD720
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi Guys and Gals,
Here are the two scripts you will need to analyze your workstations for
changes in permissions (and more even). The first script is the script
you schedule using the AT command. The second script is the perl script
that parses the logfile created by the secedit command and outputs any
mismatches it finds into its own log file. Alternatively, you can have
it emailed to you using blat or sendmail, etc.
I will continue sending more code as I get requests for help.
Bryant
Main Script:
REM Make variables to allow others to use this script easily
set myserver=swrt
set myshare=users
set myfolder=bcvernon
set mysecuritytemplate=bcvernon-sec-template.inf
set myperlshare=perl
set mylogparser=secparser.pl
REM type secedit /? To see its syntax
secedit /analyze /db c:\temp\temp.sdb /d cfg \\%
<file:///\\%25myserver%25\%25myshare%25\%25myfolder%25\%25mysecuritytemp
late%25> myserver%\%myshare%\%myfolder%\%mysecuritytemplate% /log
C:\temp\temp.log
REM run the perl script
\\%myserver%\%myperlshare%\bin\perl.exe
<file:///\\%25myserver%25\%25myperlshare%25\bin\perl.exe> \\%
<file:///\\%25myserver%25\%25myshare%25\%25myfolder%25\%25mylogparser%25
> myserver%\%myshare%\%myfolder%\%mylogparser%
-----------------------------------------------------------
#Perl Script:
#! C:\perl\bin\perl.exe
#Open the logfile generated by the secedit command
open (LOGFILE, "c:\\temp\\temp.log") || die "Could not open the file:
$!";
#Open a file for overwrite output
open (PARSEDLOG, ">c:\\temp\\parsed-log.txt") || die "Could not open the
file: $!";
#Use a while loop to go through the logfile line by line.
while (<LOGFILE>) {
#The $_ will contain the current line of LOGFILE as its value
#The $_ is a special variable. Please read up on it!
#We are doing pattern matching here (=~).
#m// does a match pattern search. Notice that we are not doing
#a search on just mismatch. Why not? Well, the output of the secedit
#command is encoded in an odd way, so we have to take that into
#consideration. The [^az] means that we are looking for any
#non-alpha characters between the alpha characters
#please read up on brackets if you don't understand their use.
#note that [^] means the inverse of the set you specify. The * means
#zero or more of the preceeding. The \d in [^az\d] means to ignore
#the lines that say x Mismatches found. We are only interested in
#the actual mismatches, not how many there are. The \d means digits
(i.e. numbers)
if ($_ =~
m/^[^az\d]*M[^az]*i[^az]*s[^az]*m[^az]*a[^az]*t[^az]*c[^az]*h/i)
{
#To get rid of extra crap that's part of the log (non-visible
characters, etc.)
#we chop off everything after the end period, including the period.
#if you are not used to substitutions, please read up on them -- s///;
#Also read up on the special variables--$1, $2, etc.
$_ =~ s/^(.*)\..*$/$1/;
#finally, we print the result to the new parsed log.
print PARSEDLOG "$_\n";
}
}
#close the files when you are done with them.
close LOGFILE;
close PARSEDLOG;
Bryant C. Vernon
Product Release Coordinator
MIT Software Release Team
bcvernon@mit.edu
(617) 253-5103
------=_NextPart_000_002B_01C1895D.D38AD720
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C1895D.D325FAD0">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-compose;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */=20
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>
<div class=3DSection1>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>Hi
Guys and Gals,<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>Here
are the two scripts you will need to analyze your workstations for =
changes in
permissions (and more even). The first script is the script you schedule =
using
the AT command. The second script is the <span =
class=3DSpellE>perl</span> script
that parses the <span class=3DSpellE>logfile</span> created by the <span
class=3DSpellE>secedit</span> command and outputs any mismatches it =
finds into
its own log file. Alternatively, you can have it emailed to you using =
blat or <span
class=3DSpellE>sendmail</span>, etc.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>I
will continue sending more code as I get requests for =
help.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>Bryant<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>Main
Script:<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>REM
Make variables to allow others to use this script =
easily<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>myserver</span>=3D<span =
class=3DSpellE>swrt</span><o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>myshare</span>=3Dusers<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>myfolder</span>=3D<span =
class=3DSpellE>bcvernon</span><o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>mysecuritytemplate</span>=3D<span =
class=3DSpellE>bcvernon-sec-template.inf</span><o:p></o:p></span></font><=
/p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>myperlshare</span>=3D<span =
class=3DSpellE>perl</span><o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>set</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'> <span
class=3DSpellE>mylogparser</span>=3Dsecparser.pl<o:p></o:p></span></font>=
</p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>REM
type <span class=3DSpellE>secedit</span> /? To see its =
syntax<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DSpellE><span class=3DGramE><font size=3D2 face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>secedit</span></font></span></span><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
/analyze /db c:\temp\temp.sdb /d <span class=3DSpellE>cfg</span> <a
href=3D"file:///\\%25myserver%25\%25myshare%25\%25myfolder%25\%25mysecuri=
tytemplate%25">\\%<span
class=3DSpellE>myserver%\%myshare%\%myfolder%\%mysecuritytemplate</span>%=
</a>
/log C:\temp\temp.log<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>REM
<span class=3DGramE>run</span> the <span class=3DSpellE>perl</span> =
script<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><a
href=3D"file:///\\%25myserver%25\%25myperlshare%25\bin\perl.exe">\\%myser=
ver%\%myperlshare%\bin\perl.exe</a>
<a =
href=3D"file:///\\%25myserver%25\%25myshare%25\%25myfolder%25\%25mylogpar=
ser%25">\\%<span
class=3DSpellE>myserver%\%myshare%\%myfolder%\%mylogparser</span>%</a><o:=
p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>-----------------------------------------------------------<o:p></o=
:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DSpellE>Perl</span> Script:<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#!
C:\perl\bin\perl.exe<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#Open
the <span class=3DSpellE>logfile</span> generated by the <span =
class=3DSpellE>secedit</span>
command<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>open</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
(LOGFILE, "c:\\temp\\temp.log") || die "Could not open =
the file:
$!";<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#Open
a file for overwrite output <o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>open</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
(PARSEDLOG, ">c:\\temp\\parsed-log.txt") || die "Could =
not
open the file: $!";<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#Use
a while loop to go through the <span class=3DSpellE>logfile</span> line =
by line.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>while</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
(<LOGFILE>) {<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>The</span> $_ will contain the current line of LOGFILE as =
its value
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>The</span> $_ is a special variable. Please read up on it! =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>We</span> are doing pattern matching here (=3D~). =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#m//
does a match pattern search. Notice that we are not doing =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>#a search on just =
mismatch.</span></font></span><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
Why not? Well, the output of the <span class=3DSpellE>secedit</span> =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#command
is encoded in an odd way, so we have to take that into =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>#consideration.</span></font></span><font =
size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
The [^<span class=3DSpellE><span class=3DGramE>az</span></span>] means =
that we are
looking for any <o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#non-alpha
characters between the alpha characters<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#please
read up on brackets if you don’t understand their =
use.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#note
that [^] means the inverse of the set you specify. The * =
means<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>#zero or more of the <span =
class=3DSpellE>preceeding</span>.</span></font></span><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
The \d in [^<span class=3DSpellE>az</span>\d] means to =
ignore<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#the
lines that say x Mismatches found. We are only interested in =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#the
actual mismatches, not how many there are. The \d means digits (i.e. =
numbers)<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><span
style=3D'mso-tab-count:1'> </span>if ($_ =
=3D~ m/^[^<span
class=3DSpellE>az</span>\d]*M[^<span class=3DSpellE>az</span>]*<span =
class=3DSpellE>i</span>[^<span
class=3DSpellE>az</span>]*s[^<span class=3DSpellE>az</span>]*m[^<span =
class=3DSpellE>az</span>]*a[^<span
class=3DSpellE>az</span>]*t[^<span class=3DSpellE>az</span>]*<span =
class=3DSpellE>c</span>[^<span
class=3DSpellE>az</span>]*h/<span class=3DSpellE>i</span>) =
<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><span
style=3D'mso-tab-count:1'> =
</span>{<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>To</span> get rid of extra crap that's part of the log =
(non-visible
characters, etc.)<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#we
chop off everything after the end period, including the =
period.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#if
you are not used to substitutions, please read up on them -- =
s///;<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>Also</span> read up on the special variables--$1, $2, =
etc.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><span
style=3D'mso-tab-count:1'> </span>$_ =3D~ =
s/<span
class=3DGramE>^(</span>.*)\..*$/$1/;<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#finally,
we print the result to the new parsed log.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><span
style=3D'mso-tab-count:1'> </span><span
class=3DGramE>print</span> PARSEDLOG =
"$_\n";<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'><span
style=3D'mso-tab-count:1'> =
</span>}<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>}<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><font
size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>#<span
class=3DGramE>close</span> the files when you are done with =
them.<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>close</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
LOGFILE;<o:p></o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-layout-grid-align:none;text-autospace:none'><span
class=3DGramE><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>close</span></font></span><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier New"'>
PARSEDLOG;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>Bryant C. Vernon<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>Product Release =
Coordinator<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D3 color=3Dmaroon face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:maroon;mso-no-proof:yes'>MIT =
</span></font><span
style=3D'mso-no-proof:yes'>Software Release Team<o:p></o:p></span></p>
<p class=3DMsoAutoSig><font size=3D3 color=3Dmaroon face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:maroon;mso-no-proof:yes'>bcvernon</span><=
/font><span
style=3D'mso-no-proof:yes'>@mit.edu<o:p></o:p></span></p>
<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>(617) 253-5103<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
------=_NextPart_000_002B_01C1895D.D38AD720--