Example code of phpcurl spoofing IP address
- #! /Bin/awk-f
-
- # Before running
- BEGIN {
- FS = "";
- Count = 0;
- }
-
- # Running
- {
- Iparr [count ++] = $0;
- }
-
- # After Running
- END {
- Printf (" Printf ("$ iparr = array (\ n ");
- For (I = 0; I <count; I ++ ){
- Printf ("'% s' =>' % s', \ n", iparr [I], iparr [I]);
- }
- Printf ("); \ n ");
- }
II. use CURL
- /**
- * CURL spoofed IP address access
- * By bbs.it-home.org
- */
- Require_once dirname (_ FILE _). "/iplib. php ";
-
- $ Req_url = "test.com ";
-
- Foreach ($ iparr as $ forward => $ cip ){
-
- $ Ch = curl_init ();
-
- Curl_setopt ($ ch, CURLOPT_URL, $ req_url );
- Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array (
- "X-FORWARDED-FOR: $ forward ",
- "CLIENT-IP: $ cip"
- ));
- Curl_setopt ($ ch, CURLOPT_REFERER, 'http: // blog.csdn.net /');
- Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
-
- Curl_exec ($ ch );
-
- Curl_close ($ ch );
- }
Disadvantages: many servers generally use $ _ SERVER ['remote _ ADDR '] to obtain the client's real ip address, which is determined at the transport layer, cannot be modified through CURL. There is a good way to share this record. |