cipher16
Messages postés3Date d'inscriptiondimanche 28 novembre 2004StatutMembreDernière intervention16 avril 2006
-
7 juin 2005 à 16:33
cipher16
Messages postés3Date d'inscriptiondimanche 28 novembre 2004StatutMembreDernière intervention16 avril 2006
-
15 juin 2005 à 13:14
Bonjour ... je viens de commencer à coder en python ... et il semblerai
qu'il me manque une librairie ayant un rapport avec internet ... J'ai
cherché sur google, mais le seul site qui semble posséder ce que je
cherche "is down" :( pouvez vous me renseigner?)
C'est pour ce script là ... Je l'ai trouvé dans un magazine sur la prog
en python (c'est sensé spoofé l'ip contre l'option x_forwarded_for et
d'autre option intéréssante :) pour se protéger ...)
from twisted.internet import reactor, protocol
from twisted.protocols import http
from twisted.web.proxy import Proxy
from string import strip
from re import compile as regexpcompile
class HeaderEditor(Proxy):
ForcedHeaders = {}
FilteredHeadersPatterns = {}
def canPassHeader(self, line):
headername, value = map(strip, line.split(":",1))
if self.ForcedHeaders.has_key(headername):
return 0
try:
regexp = self.FilteredHeadersPatterns[headername]
if regexp is None:return 0
return not regexp.match(value)
except KeyError:
return 1
def headerReceived(self, line):
print "P<-C:", line
if self.canPassHeader(line):
self.passHeader(line)
def allHeadersReceived(self):
for headername, value in self.ForcedHeaders.items():
cipher16
Messages postés3Date d'inscriptiondimanche 28 novembre 2004StatutMembreDernière intervention16 avril 2006 15 juin 2005 à 13:14
sauf que moi j'ai tapé twisted.internet !! Le seul site qui le
proposait semblait être "unreachable", donc je me suis tourné vers le
forum, mais maintenant, c'est bon, sa fonctionne!!