Forum Moderators: phranque
86.109.163.26 - - [08/Oct/2007:22:45:54 -0500] "POST /https://www.paypal.com/cgi-bin/webscr HTTP/1.1" 302 299 "http://www.domain-name.com/book.html" "Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686)"
All of these come from Europe and Asia and from a variety of IP's. The most frequent is bbtec.net
I renamed the page with the PayPal button, changed the button graphic to a .gif hosted locally instead of on PayPal and made the new page no cache, no follow and no index. With htaccess I've tried blocking ips and ip ranges with <Files *> and with <Limit GET POST>, but that doesn't work. The user agents on these requests change frequently so I can't filter those. Yesterday I tried to block POST requests for PayPal from any page that's not the new book page, but that failed too.
# Deny PayPal scammers from old book page
rewritecond %{REQUEST_URI} ^https://www.paypal\.com/cgi-bin.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.domain-name\.com/newbook\.html [NC]
RewriteRule .* - [F]
If I'm reading the log correctly, the PayPal page is the REQUEST_URI and the old book page, book.html, is the referrer (or referer). These aren't reversed for a POST request are they?
Has anyone else run into this and do I even need to worry about it?
Thanks.
# Deny PayPal scammers from old book page
RewriteCond %{REQUEST_URI} ^/https://www\.paypal\.com/cgi-bin [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain-name\.com/newbook\.html
RewriteRule .* - [F]
# Deny PayPal scammers from old book page
RewriteCond %{HTTP_REFERER} !^http://www.domain-name\.com/newbook\.html
RewriteRule ^https://www\.paypal\.com/cgi-bin - [NC,F]
https?://(www\.)?paypal\.com/cgi-bin
Jim
Jim
If the "wider" pattern code doesn't work, try this more-general solution, replacing "example.com" with your domain:
# BLOCK attempts to use our server as a proxy, but allow absolute URIs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /?http:// [NC]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /?http://([^.]+\.)*example\.com/ [NC]
RewriteRule .* - [F]
[edited by: jdMorgan at 12:38 pm (utc) on Oct. 10, 2007]
Reading [w3.org...] makes me think that the 302 code is the server equivalent of saying, "Yes, there's someone here by that name, but he's not coming to the phone."
I'd prefer to not give phishers anything... except maybe a virus, but I don't think htaccess can do that <grin>.
I've left the code you gave me active and I've added
# Block PayPal Phishers
RewriteCond %{THE_REQUEST} ^POST\ /https://www\.paypal\.com/cgi-bin/webscr\ HTTP/1\.1
RewriteRule .* - [F]
Thanks again for all your help.
# BLOCK attempts to use our server as a proxy, but allow absolute URIs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /?htt[b]ps?:[/b]// [NC]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /?htt[b]ps?:[/b]//([^.]+\.)*example\.com/ [NC]
RewriteRule .* - [F]
Jim
[edited by: jdMorgan at 1:39 pm (utc) on Oct. 11, 2007]
I'm getting 302 plus another number, 299, that I think is the file size.
This site runs a classifieds cgi script, too. Because of Chinese spammers, I don't allow direct access to that script. Visitors have to be referred (refered) by another page on the site. In the logs I see the attempts at direct access to the script page as 302s as well. Sometimes I get 10 or 12 of these in a row, indicating that the security is working and the bots hit their limit and leave.
I may be overreacting to the PayPal requests - perhaps I should just add a don't log code, [L] I think, and forget about them.
Still no luck getting rid of these. In fact, they're getting more frequent. I may have found a clue though.
I temporarily blocked all POST requests. With the block in place I could not submit html forms to a cgi script, but I could still use the PayPal button. This made me think the POST is handled by PayPal's servers, not mine. Using the LiveHTTP plugin for Firefox confirms this. It lists the host as www.paypal.com
What I can't figure out is why my server is logging these if they're events on the Paypal server and how to prevent my server from responding to anything but a legitimate request. What my server seems to be broadcasting is that there is a PayPal connection, but is temporarily unavailable. I'd much prefer that it respond that it's gone, it is no more, it has ceased to be, it is an ex-parrot.
This may be something that has to be plugged on Paypal's end, but so far they're not responsive.
Have you asked your host to look into this? They may be able to do something at the config level (or with a firewall) so that these requests will join the choir invisible and begin pushing up daisies... ;)
Jim
I made two changes to the htaccess code so I'm not sure which made the difference. The first RewriteRule was changed to G from F and L was added to both.
# Block PayPal Phishers
RewriteCond %{THE_REQUEST} ^POST\ /https://www\.paypal\.com/cgi-bin/webscr\ HTTP/1\.1
RewriteRule .* - [G,L]
# BLOCK attempts to use our server as a proxy, but allow absolute URIs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /?https:// [NC]
RewriteCond %{THE_REQUEST}!^[A-Z]{3,9}\ /?https://([^.]+\.)*www.example\.com/ [NC]
RewriteRule .* - [F,L]
Thanks again, Jim, for all your help. Hopefully this will help others, too.
# Block PayPal Phishers
RewriteCond %{THE_REQUEST} ^POST\ /https?://www\.paypal\.com/cgi-bin/webscr\ HTTP/1\.1
RewriteRule .* - [G,L] # BLOCK attempts to use our server as a proxy, but allow absolute URIs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /?https?:// [NC]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /?https?://([^.]+\.)*example\.com/ [NC]
RewriteRule .* - [F,L] [edited by: jdMorgan at 8:13 pm (utc) on Oct. 13, 2007]
[edit reason] formatting [/edit]
We had 36 of these Paypal POST requests. 25 of them came from the same IP 77.91.227.181 but with 12 different UA's!
That IP belongs to WEBALTA / Internet Search Company (77.91.227.128 - 77.91.227.255) which is purportedly a Russian search engine. Why would a legitimate search engine disguise its user agent and only go after a PayPal link? I've added that specific IP to my 'deny from' list.
Of the remaining 9 POST requests, 4 were given 410 - It's Gone codes instead of 302's.
We'll see what my host comes up with.