GRAYBYTE WORDPRESS FILE MANAGER2556

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python38/lib/python3.8/site-packages/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python38/lib/python3.8/site-packages//sockshandler.py
#!/usr/bin/env python
"""
SocksiPy + urllib2 handler

version: 0.3
author: e<e@tr0ll.in>

This module provides a Handler which you can use with urllib2 to allow it to tunnel your connection through a socks.sockssocket socket, with out monkey patching the original socket...
"""
import ssl

try:
    import urllib2
    import httplib
except ImportError: # Python 3
    import urllib.request as urllib2
    import http.client as httplib

import socks # $ pip install PySocks

def merge_dict(a, b):
    d = a.copy()
    d.update(b)
    return d

class SocksiPyConnection(httplib.HTTPConnection):
    def __init__(self, proxytype, proxyaddr, proxyport=None, rdns=True, username=None, password=None, *args, **kwargs):
        self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username, password)
        httplib.HTTPConnection.__init__(self, *args, **kwargs)

    def connect(self):
        self.sock = socks.socksocket()
        self.sock.setproxy(*self.proxyargs)
        if type(self.timeout) in (int, float):
            self.sock.settimeout(self.timeout)
        self.sock.connect((self.host, self.port))

class SocksiPyConnectionS(httplib.HTTPSConnection):
    def __init__(self, proxytype, proxyaddr, proxyport=None, rdns=True, username=None, password=None, *args, **kwargs):
        self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username, password)
        httplib.HTTPSConnection.__init__(self, *args, **kwargs)

    def connect(self):
        sock = socks.socksocket()
        sock.setproxy(*self.proxyargs)
        if type(self.timeout) in (int, float):
            sock.settimeout(self.timeout)
        sock.connect((self.host, self.port))
        self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)

class SocksiPyHandler(urllib2.HTTPHandler, urllib2.HTTPSHandler):
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kw = kwargs
        urllib2.HTTPHandler.__init__(self)

    def http_open(self, req):
        def build(host, port=None, timeout=0, **kwargs):
            kw = merge_dict(self.kw, kwargs)
            conn = SocksiPyConnection(*self.args, host=host, port=port, timeout=timeout, **kw)
            return conn
        return self.do_open(build, req)

    def https_open(self, req):
        def build(host, port=None, timeout=0, **kwargs):
            kw = merge_dict(self.kw, kwargs)
            conn = SocksiPyConnectionS(*self.args, host=host, port=port, timeout=timeout, **kw)
            return conn
        return self.do_open(build, req)

if __name__ == "__main__":
    import sys
    try:
        port = int(sys.argv[1])
    except (ValueError, IndexError):
        port = 9050
    opener = urllib2.build_opener(SocksiPyHandler(socks.PROXY_TYPE_SOCKS5, "localhost", port))
    print("HTTP: " + opener.open("http://httpbin.org/ip").read().decode())
    print("HTTPS: " + opener.open("https://httpbin.org/ip").read().decode())

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
September 23 2024 11:26:06
root / linksafe
0755
__pycache__
--
April 04 2025 09:00:01
root / linksafe
0755
_distutils_hack
--
March 03 2024 22:48:31
root / root
0755
certifi
--
March 05 2024 23:48:11
root / linksafe
0755
certifi-2018.4.16-py3.8.egg-info
--
March 05 2024 23:48:11
root / linksafe
0755
pip
--
March 03 2024 22:49:50
root / linksafe
0755
pip-22.2.1.dist-info
--
March 03 2024 22:49:50
root / linksafe
0755
pkg_resources
--
March 03 2024 22:48:31
root / linksafe
0755
sentry_sdk
--
March 05 2024 23:48:13
root / linksafe
0755
sentry_sdk-0.7.10-py3.8.egg-info
--
March 05 2024 23:48:13
root / linksafe
0755
setuptools
--
March 03 2024 22:48:31
root / linksafe
0755
setuptools-58.3.0.dist-info
--
March 03 2024 22:48:31
root / linksafe
0755
six-1.12.0-py3.8.egg-info
--
March 05 2024 23:48:04
root / linksafe
0755
urllib3
--
August 13 2024 08:30:29
root / linksafe
0755
urllib3-1.26.6-py3.8.egg-info
--
August 13 2024 08:30:29
root / linksafe
0755
.sentry.conf
0.099 KB
April 04 2025 08:00:30
root / root
0600
NCSentry.py
1.487 KB
March 26 2025 11:05:09
root / root
0644
PySocks-1.5.7-py3.8.egg-info
0.314 KB
July 10 2020 11:16:53
root / linksafe
0644
distutils-precedence.pth
0.148 KB
November 13 2023 21:45:15
root / linksafe
0644
six.py
31.691 KB
December 10 2018 00:59:34
root / linksafe
0644
socks.py
29.25 KB
May 21 2016 21:54:42
root / linksafe
0644
sockshandler.py
2.845 KB
May 21 2016 21:54:42
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF