GRAYBYTE WORDPRESS FILE MANAGER8411

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/hc_python/lib/python3.12/site-packages/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/hc_python/lib/python3.12/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 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

def is_ip(s):
    try:
        if ':' in s:
            socket.inet_pton(socket.AF_INET6, s)
        elif '.' in s:
            socket.inet_aton(s)
        else:
            return False
    except:
        return False
    else:
        return True

socks4_no_rdns = set()

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):
        (proxytype, proxyaddr, proxyport, rdns, username, password) = self.proxyargs
        rdns = rdns and proxyaddr not in socks4_no_rdns
        while True:
            try:
                sock = socks.create_connection(
                    (self.host, self.port), self.timeout, None,
                    proxytype, proxyaddr, proxyport, rdns, username, password,
                    ((socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),))
                break
            except socks.SOCKS4Error as e:
                if rdns and "0x5b" in str(e) and not is_ip(self.host):
                    # Maybe a SOCKS4 server that doesn't support remote resolving
                    # Let's try again
                    rdns = False
                    socks4_no_rdns.add(proxyaddr)
                else:
                    raise
        self.sock = sock

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):
        SocksiPyConnection.connect(self)
        self.sock = self._context.wrap_socket(self.sock, server_hostname=self.host)
        if not self._context.check_hostname and self._check_hostname:
            try:
                ssl.match_hostname(self.sock.getpeercert(), self.host)
            except Exception:
                self.sock.shutdown(socket.SHUT_RDWR)
                self.sock.close()
                raise

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
..
--
April 04 2025 07:59:49
root / root
0755
Mako-1.3.9.dist-info
--
April 04 2025 08:00:26
root / root
0755
MarkupSafe-3.0.2.dist-info
--
April 04 2025 08:00:21
root / root
0755
MySQLdb
--
April 04 2025 08:00:21
root / root
0755
PySocks-1.7.1.dist-info
--
April 04 2025 08:00:20
root / root
0755
PyYAML-6.0.2.dist-info
--
April 04 2025 08:00:20
root / root
0755
__pycache__
--
April 04 2025 08:05:01
root / root
0755
_yaml
--
April 04 2025 08:00:20
root / root
0755
aenum
--
April 04 2025 08:00:20
root / root
0755
aenum-3.1.15.dist-info
--
April 04 2025 08:00:20
root / root
0755
alembic
--
April 04 2025 08:00:29
root / root
0755
alembic-1.15.1.dist-info
--
April 04 2025 08:00:29
root / root
0755
annotated_types
--
April 04 2025 08:00:22
root / root
0755
annotated_types-0.7.0.dist-info
--
April 04 2025 08:00:22
root / root
0755
certifi
--
April 04 2025 08:00:22
root / root
0755
certifi-2025.1.31.dist-info
--
April 04 2025 08:00:22
root / root
0755
cfgv-3.4.0.dist-info
--
April 04 2025 08:00:22
root / root
0755
charset_normalizer
--
April 04 2025 08:00:22
root / root
0755
charset_normalizer-3.4.1.dist-info
--
April 04 2025 08:00:22
root / root
0755
curl
--
April 04 2025 07:59:57
root / root
0755
dict2xml
--
April 04 2025 08:00:22
root / root
0755
dict2xml-1.7.6.dist-info
--
April 04 2025 08:00:22
root / root
0755
dicttoxml-1.7.16.dist-info
--
April 04 2025 08:00:22
root / root
0755
distlib
--
April 04 2025 08:00:20
root / root
0755
distlib-0.3.9.dist-info
--
April 04 2025 08:00:20
root / root
0755
distro
--
April 04 2025 08:00:22
root / root
0755
distro-1.9.0.dist-info
--
April 04 2025 08:00:22
root / root
0755
dns
--
April 04 2025 08:00:22
root / root
0755
dnspython-2.7.0.dist-info
--
April 04 2025 08:00:22
root / root
0755
filelock
--
April 04 2025 08:00:22
root / root
0755
filelock-3.18.0.dist-info
--
April 04 2025 08:00:22
root / root
0755
greenlet
--
May 23 2025 08:31:29
root / root
0755
greenlet-3.2.2.dist-info
--
May 23 2025 08:31:29
root / root
0755
identify
--
April 04 2025 08:00:22
root / root
0755
identify-2.6.9.dist-info
--
April 04 2025 08:00:22
root / root
0755
idna
--
April 04 2025 08:00:21
root / root
0755
idna-3.10.dist-info
--
April 04 2025 08:00:22
root / root
0755
importlib_metadata
--
May 23 2025 08:31:29
root / root
0755
importlib_metadata-8.7.0.dist-info
--
May 23 2025 08:31:29
root / root
0755
importlib_resources
--
April 04 2025 08:00:21
root / root
0755
importlib_resources-6.5.2.dist-info
--
April 04 2025 08:00:21
root / root
0755
inotify
--
April 04 2025 08:00:21
root / root
0755
inotify-0.2.10.dist-info
--
April 04 2025 08:00:21
root / root
0755
lxml
--
April 04 2025 08:00:21
root / root
0755
lxml-5.3.1.dist-info
--
April 04 2025 08:00:21
root / root
0755
mako
--
April 04 2025 08:00:26
root / root
0755
markupsafe
--
April 04 2025 08:00:21
root / root
0755
mysql
--
April 04 2025 08:00:19
root / root
0755
mysql-0.0.3.dist-info
--
April 04 2025 08:00:26
root / root
0755
mysql_connector-2.2.9.dist-info
--
April 04 2025 08:00:20
root / root
0755
mysqlclient-2.2.7.dist-info
--
April 04 2025 08:00:21
root / root
0755
mysqlx
--
April 04 2025 08:00:19
root / root
0755
nodeenv-1.9.1.dist-info
--
April 04 2025 08:00:21
root / root
0755
nose
--
April 04 2025 08:00:19
root / root
0755
nose-1.3.7.dist-info
--
April 04 2025 08:00:19
root / root
0755
packaging
--
May 23 2025 08:31:29
root / root
0755
packaging-25.0.dist-info
--
May 23 2025 08:31:29
root / root
0755
pip
--
May 23 2025 08:31:17
root / root
0755
pip-25.1.1.dist-info
--
May 23 2025 08:31:18
root / root
0755
platformdirs
--
April 04 2025 08:00:21
root / root
0755
platformdirs-4.3.7.dist-info
--
April 04 2025 08:00:21
root / root
0755
pre_commit
--
April 04 2025 08:00:28
root / root
0755
pre_commit-4.2.0.dist-info
--
April 04 2025 08:00:29
root / root
0755
prometheus_client
--
April 04 2025 08:00:21
root / root
0755
prometheus_client-0.21.1.dist-info
--
April 04 2025 08:00:21
root / root
0755
psutil
--
April 04 2025 08:00:21
root / root
0755
psutil-7.0.0.dist-info
--
April 04 2025 08:00:21
root / root
0755
pycurl-7.45.6.dist-info
--
April 04 2025 07:59:57
root / root
0755
pycurl.libs
--
April 04 2025 07:59:57
root / root
0755
pydantic
--
April 04 2025 08:00:28
root / root
0755
pydantic-2.8.2.dist-info
--
April 04 2025 08:00:28
root / root
0755
pydantic_core
--
April 04 2025 08:00:26
root / root
0755
pydantic_core-2.20.1.dist-info
--
April 04 2025 08:00:26
root / root
0755
pyone
--
April 04 2025 08:00:26
root / root
0755
pyone-6.10.3.dist-info
--
April 04 2025 08:00:28
root / root
0755
requests
--
April 04 2025 08:00:26
root / root
0755
requests-2.32.3.dist-info
--
April 04 2025 08:00:26
root / root
0755
sentry_sdk
--
May 23 2025 08:31:28
root / root
0755
sentry_sdk-2.29.1.dist-info
--
May 23 2025 08:31:28
root / root
0755
six-1.17.0.dist-info
--
April 04 2025 08:00:20
root / root
0755
sqlalchemy
--
April 04 2025 08:00:23
root / root
0755
sqlalchemy-2.0.39.dist-info
--
April 04 2025 08:00:25
root / root
0755
tblib
--
April 04 2025 08:00:20
root / root
0755
tblib-3.1.0.dist-info
--
April 04 2025 08:00:20
root / root
0755
typing_extensions-4.13.1.dist-info
--
April 04 2025 08:00:20
root / root
0755
urllib3
--
April 04 2025 08:00:20
root / root
0755
urllib3-2.3.0.dist-info
--
April 04 2025 08:00:20
root / root
0755
virtualenv
--
April 04 2025 08:00:22
root / root
0755
virtualenv-20.30.0.dist-info
--
April 04 2025 08:00:23
root / root
0755
wheel
--
April 04 2025 08:00:20
root / root
0755
wheel-0.45.1.dist-info
--
April 04 2025 08:00:20
root / root
0755
xmltodict-0.14.2.dist-info
--
April 04 2025 08:00:20
root / root
0755
yaml
--
April 04 2025 08:00:20
root / root
0755
zipp
--
April 04 2025 08:00:20
root / root
0755
zipp-3.21.0.dist-info
--
April 04 2025 08:00:20
root / root
0755
.sentry.conf
0.099 KB
April 04 2025 08:00:36
root / root
0600
NCSentry.py
1.496 KB
March 26 2025 11:05:09
root / root
0644
cfgv.py
11.934 KB
April 04 2025 08:00:22
root / root
0644
dicttoxml.py
14.646 KB
April 04 2025 08:00:22
root / root
0644
nodeenv.py
45.581 KB
April 04 2025 08:00:21
root / root
0644
pycurl.cpython-312-x86_64-linux-gnu.so
717.587 KB
April 04 2025 07:59:57
root / root
0755
six.py
33.89 KB
April 04 2025 08:00:20
root / root
0644
socks.py
30.357 KB
April 04 2025 08:00:20
root / root
0644
sockshandler.py
3.873 KB
April 04 2025 08:00:20
root / root
0644
typing_extensions.py
168.106 KB
April 04 2025 08:00:20
root / root
0644
xmltodict.py
18.047 KB
April 04 2025 08:00:20
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF