Path: blob/master/sslstrip-work-2019/sslstrip/StrippingProxy.py
1306 views
# Copyright (c) 2004-2009 Moxie Marlinspike1#2# This program is free software; you can redistribute it and/or3# modify it under the terms of the GNU General Public License as4# published by the Free Software Foundation; either version 3 of the5# License, or (at your option) any later version.6#7# This program is distributed in the hope that it will be useful, but8# WITHOUT ANY WARRANTY; without even the implied warranty of9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU10# General Public License for more details.11#12# You should have received a copy of the GNU General Public License13# along with this program; if not, write to the Free Software14# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-130715# USA16#1718from twisted.web.http import HTTPChannel19from ClientRequest import ClientRequest2021class StrippingProxy(HTTPChannel):22'''sslstrip is, at heart, a transparent proxy server that does some unusual things.23This is the basic proxy server class, where we get callbacks for GET and POST methods.24We then proxy these out using HTTP or HTTPS depending on what information we have about25the (connection, client_address) tuple in our cache.26'''2728requestFactory = ClientRequest293031