过期域名预定抢注

 找回密碼
 免费注册

發現一篇文章不錯存檔下Hiding Your Traffic Sources

[複製鏈接]
發表於 2011-6-12 02:28:24 | 顯示全部樓層 |閱讀模式
Controlling Your Referer, and Hiding Your Traffic Sources
! E6 a" [8 o( ?& D8 l! e
, \6 S7 q4 K1 cHow Do I Keep Affiliate Programs From Knowing My Traffic Source?) _9 N+ ?+ S6 D2 i, D) Z  c4 s
This question comes up a lot, so I thought I』d handle it now. While truly everyone has a good reason to hide their referrer(outranking their affiliate program for key terms, blackhat traffic, fear someone else will clone your site/copy your traffic source, or general paranoia). I』m going to approach this from a blackhat angle though.8 J: C5 A" i4 c
It』s no secret many affiliate programs do not like blackhat traffic. This is especially true for affiliate NETWORKS like commission junction. So how can we keep them from identifying our traffic source? We definitely do not want them to see our blackhat URL. But we also do not want them to see a user coming directly from the search engine. So how can we properly redirect someone, so we can control what the aff program sees as our referer? How can we make it survive a possible hand check?
( c9 x% G# v% s5 K: @8 CWhile this is a complicated topic(since it IS the browser』s choice on who to pass), I』ll do my best to test out some sample setups.3 f5 y' J0 m- A+ G9 {! q9 J. F
3 l3 L9 i6 J3 R: c+ T  B$ [
Note: If you don』t want to read the various tests, that』s fine. I bring it all together at the bottom.' q' l% d9 h+ `6 h
Note2: I』ve heard of a lot of blackhats using methods of redirect who say their results contradict the ones I got from this experiment. If any would care to chime in, I』d be more than interested./ b2 G  h! R3 X& J: }& K
+ o, R# H4 T! H: Q
The Basics: Our goal is to take our blackhat traffic, bounce it off a nice whitehat site, then from there send that to the affiliate program. This 2 way redirect, when implemented properly, can hide the traffic source decently. The trick is having the whitehat site know when to redirect, and when not to.
4 D% p9 U- _7 i" l7 C4 w2 K; ^
, @) J$ c9 Y  z+ F    * Our Test File Structure
( Q6 ?2 G3 k: S4 b2 r9 e          o myStartPage.php : This is taking the place of the Google search result page in our experiment. Passing this variable to the affiliate program tells them that the user was either redirected, or came straight from the search engine result page(hereafter referred to as a 「SERP」)6 S0 ^2 |, M9 E1 p: h
          o myBlackhatPage.php: The second stop in our redirection, this page is our scraped/cloaked/whatever』d site. Whatever site we』re actually using them to promote, but don』t want them to see.5 T% Z* p1 o  [- X) f- f/ E
          o myWhitehatPage.php: What we WANT the affiliate program to see as our referrer. This page[optimally] has 2 modes: whitehat quality content mode, and blackhat redirection mode. This page is not actually promoted at all, even whitehat. So we don』t care if it ranks. It may eventually get banned, but we don』t care.  k+ `( O$ X! E) o+ l
          o myAffiliate.php: The end page of our redirection algo. We』re hoping that this page will show myWhitehatPage.php as the referrer.; b* M2 \/ C9 L) E4 f/ X
5 t$ f. b' L5 Z" g
Non-Changing Variables0 B5 J7 M, o1 x
myBlackhatPage.php will ALWAYS be a 301/302 redirect to myWhitehatPage.php. Although we may want to alert the whitehat page to this fact later on, for right now we』re just researching what passes from page to page.
. M$ ]* s1 }/ j
$ Y. @9 {7 a, {( H    * Experiment 1: 302/301 Redirect6 _/ {% H2 r- c; J: m0 c
          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage>myAffiliate.7 r' j; `4 V' ^9 p- `9 J
          o Code of Whitehat page page consists of% E7 }& e6 G  f9 @% S. C
            header(「HTTP/1.1 302 Temporarily Moved」);
0 L. _9 D7 X0 i$ ?- A            header(「Location: http://localhost/referrerCheck/myAffiliate.php」);
9 j, U: u; \, m          o Result: Passed myStartPage.php: Failure
5 ~! _8 p7 G' s    * Experiment 2: Meta Refresh (6 Second Refresh)
1 y$ D: C9 r, j* C- F4 h+ W% \4 ]          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage(refresh)>myAffiliate.
* I1 W' V9 a. H: K0 X6 i8 @            Code of Whitehat page consists of$ v" Q$ x. x0 P: ^
            <meta http-equiv=」refresh」 content=」6;url=http://localhost/referrerCheck/myAffiliate.php」>
! M9 @5 y* x. e: I$ X          o Result: Passed a blank referrer: Semi-Pass
1 A& ~, S% y* Y! a# n! |$ r! u$ |    * Experiment 3: Meta Refresh (Immediate Refresh)
: W2 h7 C: J  u          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage(refresh)>myAffiliate.8 g$ h- A4 i; j; H
          o Code of Whiotehat page consists of
- z* I8 U) X+ b# L            <meta http-equiv=」refresh」 content=」6;url=http://localhost/referrerCheck/myAffiliate.php」>
% A7 L7 b; [; r5 E7 h          o Result: Passed a blank referrer: Semi-Pass
9 ~# x! i: U5 s6 J1 @( x" k, |    * Experiment 4: Javascript Redirect (Window.location)
, J- r$ J) b8 J$ X% m6 j          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage(JS redirect)>MyAffiliate
' y( d! Y' u8 E/ O& l  `  {' t) ?) y3 n          o Code of Whitehat Page consists of6 F0 G0 P# b3 f- h
            <script type=」text/javascript」>) r& l! X8 y. {4 s& [& z; n
            <!–
0 ^. _. n: K6 A0 B' {            window.location = 「http://localhost/referrerCheck/myAffiliate.php」* ]+ F: B+ [( K* O5 }- ~6 r
            //–>) J# A1 `( ]8 t; \/ H( O: x7 c: r
            </script>
/ x. p4 z& S& g          o Result: Passed blank referrer: Semi-Pass
! o4 S7 G1 b# K$ y    * Experiment 5: Frameset
1 F# c+ u. ~! C: c9 }5 o% ]          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage(Frameset)>MyAffiliate# S2 {! D" K( l$ k
          o Code of Whitehat page page consists of
+ |% s& n5 M$ v  y            <frameset><frame src=」http://localhost/referrerCheck/myAffiliate.php」></frameset>
2 @) [: I9 o2 w- m. g' O4 s$ F1 Z          o Result: Successfully Passes myWhitehat.php as the referring file!
: w9 p2 W7 ]6 M5 d5 N          o Note: This is less than optimal. Some affiliate programs are set to jump out of a frame, and also we don』t want the user overly aware of where they were bounced off of.* _  _+ n' [3 P$ K" ?
    * Experiment 6: IFrame
1 U3 s0 T+ @- Z6 W, y, y! Y. v          o Path for this is myStartPage>myBlackhatPage>myWhitehatPage(IFrame)>MyAffiliate
/ d$ h8 O9 \' Z$ d+ Q0 R4 l          o Code of Whitehat page page consists of/ i; y! b# x, g: d7 S0 S
            <frameset><frame src=」http://localhost/referrerCheck/myAffiliate.php」></frameset>
7 P, f2 B, j/ z" _3 U; s0 Z- D: q! T          o Result: Successfully Passes myWhitehat.php as the referring file!* d: a; Z9 r+ I" A/ P
          o Note: Suffers from the same problems as the previous (frameset) redirection method. Damn. However, with this, we can stop internet explorer only from breaking out of the iframe by adding security=restricted into the iframe tag, which [I believe] disallows the use of Javascript for iframes. But without firefox, this is not too useful.
+ }1 i* M! L& B" f; N: [- U1 B) }8 {* e; L7 v
Bringing it all Together8 s3 J* j- Q7 D; N* h( k; w6 J
Now, we have no perfect example here. One might exist, one might not. My research says no. But we』re going to do the best we can. Here』s a decent start point for you all. The desired affect here is to get as close as possible to a perfect redirect in terms of not getting caught. It is not the most practical approach.9 `5 ?% i( e; n" N' \
7 I0 M9 f  j5 J- Z! t2 L
    * Telling the Whitehat Site to Redirect, and Not Display it』s Content+ t( e2 @3 Y* z" Q; S5 p
         1. IFrame the whitehat site/page itself, from the blackhat site/page., b/ S' M, A) f$ M2 H$ t5 w
         2. On the whitehat page, check to see if their IP is in the database of people who have come in via the blackhat site previously. Or check to see if the cookie you [may] have dropped in step 4(yeah, confusing, I know) is still there. If they or the cookie is found execute a refresh to the affiliate program (if they』re already been here once, they will not pass a referrer. You』ll understand that better as you read on
! G6 r' j* V- Y! p( o3 P         3. On the whitehat page, have php search for the blackhat referrer:6 R) o& U& {* v0 U
            if(stristr($_SERVER['HTTP_REFERER'],」myBlackhatdomain.com」)!==FALSE) //we have a BH redirect
6 b; r  c# l1 d9 \            {
; B! x' c/ Y$ J- R            //Output the Javascript in Step 57 T! I  w' l8 c0 N2 i& y
            }
" o+ C; z( k) \( t3 a            else
1 i$ a' |! O  j: \0 g            {' r) a! A# ]2 o! t( h7 r
            //Output pretty whitehat content that will satisfy an affiliate program
1 D. t- A, l% d+ `            }
; f) t" s/ E: p         4. Insert the user』s IP address into a database OR drop a cookie. Either one of these we can use to identify them as a user that got here via a blackhat source in the future.
3 e/ Q; t( a/ a         5. Use Javascript(this may not work in Opera, but will in Internet Explorer/Firefox) to break out of said iFrame.
4 j% c. y4 w7 Z, x) d( A            <script type=」text/javascript」>  e  W. L" e, {; L( v
            if (top.location!= self.location) {
7 O8 \- A" y5 P( v* ]            window.location = 「http://www.mywhitehatdomain.com/myWhitehatPage.php+ I- W- u% m" b# r
            }# x7 p" B, S* v
            </script>
' L4 Q, l- f5 a$ h9 s! L9 }            Note: In case Javascript is turned off, you may want to throw a meta-refresh in there to pick up the slack. Give it a couple second delay to give the JS a chance to work. If the meta refresh is forced to execute though, we will still be iFramed in the blackhat URL. But the referrer should be the whitehat site. So in 99% of cases we』ll be ok.
( u! Z( a! D( S1 Y         6. Now, the command above SHOULD have made the page reload, with no referrer(since they were already in an iframe of http://www.mywhitehatdomain.com/myWhitehatPage.php, and Javascript redirects do not pass a referrer.) So, once again, as in step 2, we check to see if their IP is in the database, or the cookie is still present. If it is, that means….yup! We can now iframe the real affiliate offer, with the blackhat site nowhere in existance. Not in the URL bar, not in the referrer, nowhere! And the whole thing looks like it happened immediately to the user.% [7 |- q( e9 L1 _

, ~4 N2 n* z& Q7 y6 |XMCP, Why the Hell Does that Have To be So Complicated?& z! A3 e( B* B
" R! C3 g0 d- q8 ~1 A7 n
Because we now have a way to set a whitehat domain as the referrer. But even if the affiliate program comes to check the URL, nothing appears to be odd about it! They can』t find the iframe unless it was initially accessed via the blackhat site, which they have no way to find. So it appears to be a static link.
) K" ]' b* y* ]% m
& M4 m% U5 Z/ z$ O! Z0 `There might be a simpler way to achieve that, but hell if I can figure out how.
發表於 2011-6-12 04:19:52 | 顯示全部樓層
不懂javascript
回復 给力 爆菊

使用道具 舉報

發表於 2011-6-12 05:31:23 | 顯示全部樓層
不懂javascript
回復 给力 爆菊

使用道具 舉報

發表於 2011-6-12 08:52:45 | 顯示全部樓層
收藏一下。不錯的東東。
回復 给力 爆菊

使用道具 舉報

發表於 2011-6-12 12:24:17 | 顯示全部樓層
收藏一下
回復 给力 爆菊

使用道具 舉報

發表於 2011-6-13 00:41:56 | 顯示全部樓層
學習下 努力個
回復 给力 爆菊

使用道具 舉報

發表於 2011-6-13 17:04:17 | 顯示全部樓層
這是叫人擦屁股的文章
回復 给力 爆菊

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

过期高净值品牌域名预定抢注

4um點基跨境網編創業社區

GMT+8, 2024-11-24 03:41

By DZ X3.5

小黑屋

快速回復 返回頂部 返回列表