Detection de proxy

Soyez le premier à donner votre avis sur cette source.

Snippet vu 12 446 fois - Téléchargée 27 fois

Contenu du snippet

Une source permettant la detection de proxy
source-->

Conclusion :


voila c tt

A voir également

Ajouter un commentaire

Commentaires

Messages postés
3
Date d'inscription
mercredi 2 avril 2008
Statut
Membre
Dernière intervention
4 avril 2012

s'il vous plais
aiiiiiiiiiiiiiiiiiider moi
je veut correcter ce scripte tcl
c'est une simulation d'un reseau avec ns-2.33
et voila le scripte


set simtime 3600
set call_time_min 90
#sec
set call_time_max 120
#sec
set N 1
set sip_rate [expr (577 * 8 * $N)]
set interarrivo [expr (1.0 / $N)]
set sip_packet_size_ 577

set voice_packet_size_ 160
set voice_burst_time 1.0
set voice_idle_time 1.3
set voice_rate 64000
set tidle 1
set ttotal 2.3
set tmedio [expr (${tidle} / ${ttotal})]
set call_time [lindex $argv 1]

set from 1
set to 2

set ns [new Simulator]
$ns use-scheduler Heap

Trace set show_sctphdr_ 1
Trace set show_tcphdr_ 0

puts "Start simulation with $N Call/sec"

# initializations
remove-packet-header NV LDP MPLS rtProtoLS Ping RAP AODV SR TORA IMEP Encap HttpInval MFTP SRMEXT
#set nf [open /dev/null w]
set nt [open out_sctp_I.tr w]

$defaultRNG seed 0

#topology
# nodes
set LO1 [$ns node]
set LO2 [$ns node]
set TO1 [$ns node]
set TO2 [$ns node]

#node of SIP proxy server
set PR1 [$ns node]
set PR2 [$ns node]

set n_voice_($to) [$ns node]
set n_null_($to) [$ns node]

set n_voice_($from) [$ns node]
set n_null_($from) [$ns node]

#node of voicetest
set n_test_1 [$ns node]
set n_test_2 [$ns node]

#link
$ns duplex-link $TO1 $TO2 155Mb 5ms DropTail

$ns duplex-link $LO1 $TO1 155Mb 5ms DropTail
$ns duplex-link $TO2 $LO2 155Mb 5ms DropTail

$ns duplex-link $LO1 $n_voice_(1) 155Mb 20ms DropTail
$ns duplex-link $LO1 $n_null_(1) 155Mb 20ms DropTail

$ns duplex-link $LO2 $n_voice_(2) 155Mb 20ms DropTail
$ns duplex-link $LO2 $n_null_(2) 155Mb 20ms DropTail

$ns duplex-link $n_voice_(1) $n_test_1 155Mb 0ms DropTail
$ns duplex-link $n_null_(2) $n_test_2 155Mb 0ms DropTail

#-------------------------------------------------------------------
#agent test for voice sources
set udp_test [new Agent/UDP]
$udp_test set class_ 2
$ns attach-agent $n_test_1 $udp_test
$ns trace-queue $n_test_1 $n_voice_(1) $nt

#agentTestSink
set udp_test_sink [new Agent/Null]
$ns attach-agent $n_test_2 $udp_test_sink
$ns trace-queue $n_null_(2) $n_test_2 $nt

#proxy
#proxy
set sctp_1 [new Agent/SCTP]
$ns attach-agent $PR1 $sctp_1
$sctp_1 set fid_ 0
$sctp_1 set numOutStreams_ 1
$sctp_1 set useMaxBurst_ 0
$sctp_1 set debugMask_ -1 ;##0x00303000 # u can use -1 to turn oneverything
$sctp_1 set debugFileIndex_ 1
$sctp_1 set mtu_ 650
$sctp_1 set dataChunkSize_ 577
$sctp_1 set initialRwnd_ 131072
$sctp_1 set useDelayedSacks_ 1
$sctp_1 set initialCwndMultiplier_ 1
$ns trace-queue $LO1 $PR1 $nt

set sctp_2 [new Agent/SCTP]
$ns attach-agent $PR2 $sctp_2
$sctp_2 set fid_ 0
$sctp_2 set numOutStreams_ 1
$sctp_2 set useMaxBurst_ 0
$sctp_2 set debugMask_ -1 ;##0x00303000 # u can use -1 to turn on everything
$sctp_2 set debugFileIndex_ 1
$sctp_2 set mtu_ 650
$sctp_2 set dataChunkSize_ 577
$sctp_2 set initialRwnd_ 131072
$sctp_2 set useDelayedSacks_ 1
$sctp_2 set initialCwndMultiplier_ 1
$ns trace-queue $LO2 $PR2 $nt


$ns connect $sctp_1 $sctp_2
$ns connect $udp_test $udp_test_sink

#-------------------------------------------------------------------
#applications: 2 Proxy servers
set sip_1 [new Application/Traffic/SipSctp]
$sip_1 set packetSize_ ${sip_packet_size}
$sip_1 set burst_time_ 0
$sip_1 set idle_time_ $interarrivo
$sip_1 set rate_ 2.5Mb
$sip_1 set print_ 0
$sip_1 set minSS7delay_ 0.025
$sip_1 set maxSS7delay_ 0.05
$sip_1 set end_call_mmanagment_ 1
$sip_1 set call_min ${call_time_min}
$sip_1 set call_max ${call_time_max}
$sip_1 set from_ $from
$sip_1 set to_ $to
$sip_1 set numStreams_ 1
$sip_1 set numUnreliable_ 1
$sip_1 set reliability_ 0
$sip_1 attach-agent $sctp_1

set sip_2 [new Application/Traffic/SipSctp]
$sip_2 set packetSize_ ${sip_packet_size}
$sip_2 set burst_time_ 0
$sip_2 set idle_time_ $interarrivo
$sip_2 set rate_ 2.5Mb
$sip_2 set print_ 0
$sip_2 set minSS7delay_ 0.025
$sip_2 set maxSS7delay_ 0.05
$sip_2 set end_call_mmanagment_ 1
$sip_2 set call_min ${call_time_min}
$sip_2 set call_max ${call_time_max}
$sip_2 set call_ ${call_time}
$sip_2 set from_ $to
$sip_2 set to_ $from
$sip_2 set numStreams_ 1
$sip_2 set numUnreliable_ 1
$sip_2 set reliability_ 0
$sip_2 attach-agent $sctp_2

#Test voice source
set voice_test [new Application/Traffic/Exponential]
$voice_test set packetSize_ $voice_packet_size ;#132
$voice_test set burst_time_ $voice_burst_time ;#1000ms
$voice_test set idle_time_ $voice_idle_time ;#1300ms
$voice_test set rate_ $voice_rate ;#16k
$voice_test attach-agent $udp_test

#---------------------------------------------------------
source sctp_utils.tcl

# finish procedure
proc finish {} {
global ns nt nf
$ns flush-trace
close $nf
close $nt

#exec nam out_sip.nam &

exit 0
}

#---------------------------------------------------------
#scheduler
set fintime [expr $simtime + $call_time]

$ns at 0.0 "$sip_1 start"
$ns at 0.0 "$sip_2 start"

puts "start_sip"

$ns at 0.0 "$voice_test start"
$ns at $fintime "$voice_test stop"

$ns at $simtime "$sip_1 stop"
$ns at $simtime "$sip_2 stop"

$ns at $fintime "finish"

$ns run



et merci d'avance
Messages postés
427
Date d'inscription
dimanche 6 juillet 2008
Statut
Membre
Dernière intervention
4 mai 2009

ya meme pas de source, a revoir a mon avis ;)
Messages postés
373
Date d'inscription
samedi 1 juin 2002
Statut
Membre
Dernière intervention
17 juin 2013

Il est ou le source ???

kerneltony95 je suis très intéréssé par ton code, mais comment l'utilise-t-on ?

Merci pour les réponses.

@+ JLN
Messages postés
152
Date d'inscription
dimanche 22 janvier 2006
Statut
Membre
Dernière intervention
26 mars 2007

voici un pti code qui traque la veritable ip du visiteur qu il soit cacher ou non deriere un proxy, il donne aussi les infos du proxy !!!


// Return infos sur IP

function ProxyGetCode(&$In,$Code)
{
$Out=$In['REMOTE_ADDR'].'_'.$In['HTTP_VIA'].'_';

$Test=ereg('([0-9]{1,3}\.){3,3}[0-9]{1,3}',$In[$Code],$OutArray) ;
if ($Test&&(count($OutArray)>=1))
{$Out=gethostbyaddr($OutArray[0]);}
else
{$Out.=$In[$Code];}

return $Out;
}

// Return les infos sur IP d'user via Proxy

function ProxyGetUser($In)
{
if (isset($In['HTTP_X_FORWARDED_FOR'])) {$Out=ProxyGetCode($In,'HTTP_X_FORWARDED_FOR');}
elseif(isset($In['HTTP_X_FORWARDED'])) {$Out=ProxyGetCode($In,'HTTP_X_FORWARDED');}
elseif(isset($In['HTTP_FORWARDED_FOR'])) {$Out=ProxyGetCode($In,'HTTP_FORWARDED_FOR');}
elseif(isset($In['HTTP_FORWARDED'])) {$Out=ProxyGetCode($In,'HTTP_FORWARDED');}
elseif(isset($In['HTTP_VIA'])) {$Out=$In['HTTP_VIA'].'_' . $In['HTTP_X_COMING_FROM'].'_' . $In['HTTP_COMING_FROM'];}
elseif((isset($In['HTTP_X_COMING_FROM'])||isset($In['HTTP_COMING_FROM']))){$Out=$In['$REMOTE_ADDR'].'_' . $In['HTTP_X_COMING_FROM'].'_' . $In['HTTP_COMING_FROM'];}
else {$Out=gethostbyaddr($In['REMOTE_ADDR']);}

return $Out;
}

// Return les infos de Proxy
function ProxyGetInfo()
{
$Out=Array();

if (isset($_SERVER['HTTP_VIA'])) $Out['HTTP_VIA'] =$_SERVER['HTTP_VIA'];
if (isset($_SERVER['HTTP_X_COMING_FROM'])) $Out['HTTP_X_COMING_FROM'] =$_SERVER['HTTP_X_COMING_FROM'];
if (isset($_SERVER['HTTP_X_FORWARDED'])) $Out['HTTP_X_FORWARDED'] =$_SERVER['HTTP_X_FORWARDED'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))$Out['HTTP_X_FORWARDED_FOR']=$_SERVER['HTTP_X_FORWARDED_FOR'];
if (isset($_SERVER['HTTP_FORWARDED'])) $Out['HTTP_FORWARDED'] =$_SERVER['HTTP_FORWARDED'];
if (isset($_SERVER['HTTP_COMING_FROM'])) $Out['HTTP_COMING_FROM'] =$_SERVER['HTTP_COMING_FROM'];
if (isset($_SERVER['HTTP_FORWARDED_FOR'])) $Out['HTTP_FORWARDED_FOR'] =$_SERVER['HTTP_FORWARDED_FOR'];

if (count($Out)>0)
{$Out['Proxy']=TRUE;}
else
{$Out['Proxy']=FALSE;}
$Out['REMOTE_ADDR']=$_SERVER['REMOTE_ADDR'];
$Out['VId']=ProxyGetUser($Out);

Return $Out;
Messages postés
63
Date d'inscription
mardi 24 juin 2003
Statut
Membre
Dernière intervention
25 août 2015

D'après ce site :

http://frederic.bouchery.free.fr/?2004/09/12/17-Ip-Ip-Ip-Houra

On peut en déduire que cela fonctionne :

<?
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) OR !empty($_SERVER['HTTP_VIA']))
{
echo 'Proxy détecté';
}
else
{
echo 'Aucun proxy détecté';
}
?>
Afficher les 7 commentaires

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.