cristian.pana Posted April 3, 2012 Report Share Posted April 3, 2012 Afla ip-ul real din spatele unui proxy. Aceste coduri sunt functionabile numai in cazul in care serverul pe care rulati este Apache (nu Litespeed) si au instalate HTTP_X_REAL_IP si HTTP_X_FORWARDED_FOR function ip() { if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE ) ) { $_SERVER['REMOTE_ADDR'] = filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE ) ; } else if ( isset( $_SERVER['HTTP_X_REAL_IP'] ) && filter_var( $_SERVER['HTTP_X_REAL_IP'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE ) ) { $_SERVER['REMOTE_ADDR'] = filter_var( $_SERVER['HTTP_X_REAL_IP'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE ) ; } else { if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'] ; } if ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'] ; } } return $_SERVER['REMOTE_ADDR'] ; } SAU function ip() { $address = $_SERVER['REMOTE_ADDR'] ; if ( ! empty( $_SERVER['HTTP_X_REAL_IP'] ) ) { $ip[] = 'X-Real-IP: ' . $_SERVER['HTTP_X_REAL_IP'] ; } if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $ip[] = 'X-Forwarded-For: ' . $_SERVER['HTTP_X_FORWARDED_FOR'] ; } if ( ! empty( $ip ) ) $address .= '(' . implode( ',', $ip ) . ')' ; return $address ; } 1 Quote Link to comment Share on other sites More sharing options...
3motion Posted April 27, 2012 Report Share Posted April 27, 2012 keep up! Quote Link to comment Share on other sites More sharing options...
ionut.hulub Posted April 28, 2012 Report Share Posted April 28, 2012 s'ar putea sa fie intrebare de noobi dar poate sa afle ipu si daca folosesti un nologin? Quote Link to comment Share on other sites More sharing options...
noVaLue Posted April 28, 2012 Report Share Posted April 28, 2012 Ip ul nologinului da, dar nu al tau. Desi exista logouri cu conexiuni la nologine pentru o anumita durata de timp in functie de setari. Quote Link to comment Share on other sites More sharing options...
ihackyourmindandsoul Posted April 28, 2012 Report Share Posted April 28, 2012 Ip-ul il poate afla cu acest script numai daca ai setat proxy-ul in browser, daca setezi cu proxyfier nu are cum sa-ti vada ip-ul tau, si nici alte forme de a ascunde ip-ul nu le poate detecta acest script. 1 Quote Link to comment Share on other sites More sharing options...
CrashOverride Posted April 28, 2012 Report Share Posted April 28, 2012 eu am o intrebare daca folosesti un program de scanat porturi 21,139,etc... poti sa iti scumnzi ip cand scanezi de acasa astfel de poruturi? Quote Link to comment Share on other sites More sharing options...
noVaLue Posted April 28, 2012 Report Share Posted April 28, 2012 eu am o intrebare daca folosesti un program de scanat porturi 21,139,etc... poti sa iti scumnzi ip cand scanezi de acasa astfel de poruturi? Esti sigur ca intelegem ceea ce vrei?Tic, tac, tic,tac ... raspunsul e, de acasa poti sa-l scanezi, dar va trebui sa accepte programul proxy/sock, si nu prea e recomandat. Quote Link to comment Share on other sites More sharing options...
CrashOverride Posted April 28, 2012 Report Share Posted April 28, 2012 aha .. Quote Link to comment Share on other sites More sharing options...
Badass Posted May 9, 2012 Report Share Posted May 9, 2012 Keep it real. Quote Link to comment Share on other sites More sharing options...