Forum Moderators: open
/cgi-bin/FormMail.pl
/cgi-bin/formmail.pl
/cgi-bin/FormMail.cgi
/cgi-bin/formmail.cgi
/formmail.php
- i haven't seen the third before, but somebody must have ported matts old code to php i guess. UA-strings differ as well as IP's, perhaps there are more than one, if not just one spoofing big time.
I do not believe these are browsers and there are some strange coincidences across UA's and IPs, watch for similarities in these three groups, and compare with odd whois findings:
1)
IPs: 67.118.215.31
UA: Mozilla/4.06 (Win95; I)
REFERRER: www.my-site.com (spoofed)
/cgi-bin/FormMail.pl
/cgi-bin/formmail.pl
/cgi-bin/FormMail.cgi
/cgi-bin/formmail.cgi
2)
IPs: 163.28.4.1, 159.148.95.15,
UA: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
REFERRER: www.my-site.com (spoofed)
/cgi-bin/FormMail.pl
3)
IPs: 200.41.4.3, 163.28.4.1
UA: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
REFERRER: www.my-site.com (spoofed)
/formmail.php
WHOIS INFO:
1) 67.118.215.31:
Pac Bell Internet Services PBI-NET-10 (NET-67-112-0-0-1)
67.112.0.0 - 67.127.255.255
PPPoX Pool rback9.scrm01 SBC067118212000020522 (NET-67-118-212-0-1)
67.118.212.0 - 67.118.215.255
2a) 163.28.4.1:
inetnum: 163.28.0.0 - 163.28.255.255
netname: TANET
descr: Taiwan Academic Network
descr: Ministry of Education computer Center
2b) 159.148.95.15:
inetnum: 159.148.0.0 - 159.148.255.255
netname: LATNET
descr: Internet Service Provider
descr: Riga, Latvia
3a) 200.41.4.3:
inetnum: 200.41.0/17
status: allocated
owner: ARIN - American Registry for Internet Numbers
ownerid: US-ARIN-LACNIC
responsible: ARIN ATTN: Registration Services Group
3b) 163.28.4.1:
inetnum: 163.28.0.0 - 163.28.255.255
netname: TANET
descr: Taiwan Academic Network
descr: Ministry of Education computer Center
Related:
Here's the spidertrap thread: [webmasterworld.com...]
- and the follow-up: [webmasterworld.com...]
Not related? Yes they are - replace the name "trap.pl" with "formmail.pl".
A rewrite condition in .htaccess like this one might be more efficient, as this could be just one very-very talented spoofer:
RewriteCond %{REQUEST_URI} (mail.?form¦form¦form.?mail¦mail¦mailto)\.(cgi¦exe¦pl¦asp¦php)$ [NC,OR]
Thanks to balam for this syntax (post 38 in ACTP.HBL part 2) [webmasterworld.com]
/claus
[achildscry.org...]
Anyway, more info on that site here: [derkeiler.com...]
/claus
<edit>typos</edit>
RewriteCond %{REQUEST_URI} (.?mail.?form¦form¦(GM)?form.?.?mail¦.?mail)(2¦to)?\.?(asp¦cgi¦exe¦php¦pl¦pm)?$ [NC,OR]
claus, I saw you added the .asp & .php suffixes, cool, and I've also added .pm (perl module). Haven't seen it, but someone will try it sooner or later...
After looking at the exploit page, I see it's worth it to make the whole file extension optional. Two ?s in the right place (in bold) fixes that.
Spammers are certainly getting more inventive with the filenames they test, so I've made the regexp more expansive. (For one thing, before it would only catch "mail"; now it also catches "email"...) If I'm not wrong, there are 120 (!) base filenames caught with this RewriteCond now.
Ha-ha-ha... Out, damn spot! :)
Can someone explain this?
i've been tracking these guys since they first hit my site... i've never had and likely never will have any kind of formmail script... you should be able to search and find my post... i included a link to a page that contains all the scans up to the first of this year... there is a definite pattern... i even invited rockstar to come by and take a peek but i guess he wasn't twigged enough or else can be very quiet... in fact, searching for rockstar may very well get you that link in these forums... above is only the second time i've written that name in here...
RewriteCond %{REQUEST_URI} (.?mail.?form¦form¦(GM)?form.?.?mail¦.?mail)(2¦to)?\.?(asp¦cgi¦exe¦php¦pl¦pm)?$ [NC,OR]
Would this affect legitimate use of formmail on our site?
We do use formmail a lot (realise it is not recommended etc) so would not want to stop legitimate users from using it.
I use modified versions (homebrew), but i still have the original script. The "Rewrite" will affect anyone requesting the file, also legitimate users. In stead you should restrict the use of formmail using the
@referers = "www.your-domain.com"
-array specified in the script to get a better security if you haven't already done so (it depends on the version you're running.) Also, if your mail forms sends mail to one address only, you could include this line in the formmail file:
$Config{'recipient'} = "mail\@your-domain.com" ;
That way the script will only send to one mail address, and it's no longer fit for mass mailings.
If you rename the formmail.pl file to "xhkahlkjfsh.pl" (just some random gibberish) you would still be able to catch those looking for exploits by using the Rewrite and even a spider trap with the name "formmail.pl", as they seem to go for the "(form)mail" name and a few extensions.
/claus
It's even recommended on matts own pages. What this does is to close some security holes and fix some bugs. You might benefit from downloading it and replacing the version you have, if it's not this version already.
/claus
218.8.102.8 - - [07/Aug/2003:14:35:31 -0400] "\x04\x01" 200 6796 "-" "-"
218.8.102.8 - - [07/Aug/2003:14:35:52 -0400] "\x05\x01" 200 6796 "-" "-"
218.8.102.8 - - [07/Aug/2003:14:35:53 -0400] "CONNECT 65.54.254.129:25 HTTP/1.1" 403 6822 "-" "-"
Stupid, perhaps. But gutsy nonetheless. :^)
218.8.102.8 traces to CNCGROUP Heilongjiang province network (surprise, surprise)
65.54.254.129 is mc1.law16.hotmail.com
*** Self-Banned ***
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/FormMail.pl HTTP/1.1" 403 3939 "-" "Mozilla/4.06 (Win95; I)"
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/Formmail.pl HTTP/1.1" 403 3939 "-" "Mozilla/4.06 (Win95; I)"
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/formmail.cgi HTTP/1.1" 403 3939 "-" "Mozilla/4.06 (Win95; I)"
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/formmail.pl HTTP/1.1" 200 698 "-" "Mozilla/4.06 (Win95; I)"
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/Formmail.cgi HTTP/1.1" 403 3939 "-" "Mozilla/4.06 (Win95; I)"
12.251.168.221 - - [18/Aug/2003:22:43:54 -0400] "POST /cgi-bin/FormMail.cgi HTTP/1.1" 403 3939 "-" "Mozilla/4.06 (Win95; I)"
This IP banned itself because I renamed Trap.pl to formmail.pl. All other attempts using variations of this spelling receive my custom 403 message, created via htaccess rewrite rules. I thought about adding the variations of the spelling, such as those in my log, but I realized that they always include the all lowercase formmail, so one trap is enough for now.
I use the NMS replacement for the MSA FormMail script, and I do not call it formmail; I use a non-descript title to hide it from phishers. Not only is the NMS script more secure, but it is fairly regularly updated by the London Perl Mongers, and has a wonderful feature labeled "%recipient_alias," which allows for substituting numbers for recipients, in the html form. This removes yet another spam harvesting vulnerability by cloaking your recipient(s). Instead of them being typed as email addresses in the form page, they are only accessible via the cgi script. I contacted the Mongers about the World readability of this script and was assured that it isn't doable, especially if you CHMOD the script to 711, as I do. 711 permits it to execute for the group and World, and only the owner can read and write to it. Thus, your aliases are safe.
I have written an article about this on request from my web host, after a shared-hosting account created a major server (spam relay) problem by installing an old, insecure version of MSA FormMail, which got hijacked. If anyone wants to see what I wrote, it is on my server at [wizcrafts.net ]
BTW: The NMS script is updated often and users should check the site and upgrade when there is a new release, unless you are a Perl programmer yourself and can patch the file manually.
In the past 3days I have received several dozens returned delivery failures for emails I never sent.
I wonder if this is as a result of the formail script, even though I've restriceted its use.
The .htaccess trap.pl solution will not work for me as of course .htaccess does not work on Wind0ze boxes.
Is there another way?
BTW i luv what they've done here...http://www.achildscry.org/hallofshame0a.html...i wonder how they can automate reports violations to isps.
216.229.194.253 - - [17/Sep/2003:13:23:42 -0400] "POST /cgi-bin/FormMail.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:42 -0400] "POST /cgi-bin/FormMail.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi-local/FormMail.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi/FormMail.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi/Form.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi-bin/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi-local/Form.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:43 -0400] "POST /cgi-local/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:44 -0400] "POST /cgi-local/FormMail.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [17/Sep/2003:13:23:58 -0400] "POST /cgi/FormMail.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:04 -0400] "POST /cgi-local/FormMail.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:04 -0400] "POST /cgi/FormMail.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:04 -0400] "POST /cgi/FormMail.cgi HTTP/1.1" 403 4025 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:05 -0400] "POST /cgi/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:05 -0400] "POST /cgi-bin/Form.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:05 -0400] "POST /cgi-local/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:05 -0400] "POST /cgi-local/Form.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:05 -0400] "POST /cgi/Form.pl HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
216.229.194.253 - - [18/Sep/2003:07:25:06 -0400] "POST /cgi-bin/Form.cgi HTTP/1.1" 403 4027 "-" "Mozilla/4.06 (Win95; I)"
Wiz
Pendanticist.
Re: achildscry.org.
I found achildscry.org's list quite awhile back and was intrigued by their reported methodology also. Maybe I'll drop them a line.
Then, yesterday I discovered this one:
http*//www.softwolves.pp.se/misc/formmail_hall_of_shame/
Then, just a minute ago, I Goggled FormMail hall of shame [google.com] and judging by the results...
Anyways, me thinks it's time to start one of my own. Maybe echo the underscores "formmail_hall_of_shame" as shown in softwolves site.
Perhaps it'll do some good and perhaps not.
One thing is for sure. Given that so many of us here at WebmasterWorld apparently follow suit in banning Formmail Queries that others have reported, it also seems plausible that letting the World know who the culprits are...might not be such a bad idea.
<added>
You gotta see this!
http//www.bensbargains.net/ktalk/1061947067,48627,.shtml
Do a page search for 216.229.194.253 and see what you think.
</added>
<added-2>
Once I found "216.229.194.253:80" in some of those Googled links I then G'd that number and what do you think I found?
http*//www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=%22216%2E229%2E194%2E253%3A80%22
</added-2>
Pendanticist.