Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
chisel — نفق TCP/UDP سريع عبر HTTP مع تشفير SSH، يدعم إعادة توجيه المنافذ العكسية، ووكيل SOCKS5، والمصادقة من العميل لاختراق الشبكة بأمان وتجاوز جدران الحماية. | Kitploit
أدوات/GitHubGitHub/jpillora/chisel
أدوات عامةبروكسيات الويب والاعتراضالتهرب من IDS/IPSتسريب البياناتأمن الشبكاتاختبار الاختراقالقيادة والسيطرةالأدوات والمكوناتالفريق الأحمرأداة الوصول عن بعدحصان طروادة للوصول عن بعد
16.4k1.6k230منذ 17 أيامتمت المراجعة من قبل Kitploit

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة
الأفضل في القيادة والسيطرة #17
الأفضل في تسريب البيانات #3
الأفضل في أدوات عامة #8
الأفضل في التهرب من IDS/IPS #9
الأفضل في أداة الوصول عن بعد #12
الأفضل في حصان طروادة للوصول عن بعد #13
الأفضل في الأدوات والمكونات #11
الأفضل في بروكسيات الويب والاعتراض #8
GitHubjpillora/chisel

chisel

نفق TCP/UDP سريع عبر HTTP مع تشفير SSH، يدعم إعادة توجيه المنافذ العكسية، ووكيل SOCKS5، والمصادقة من العميل لاختراق الشبكة بأمان وتجاوز جدران الحماية.

عرض المستودع
# Chisel

[![GoDoc](https://godoc.org/github.com/jpillora/chisel?status.svg)](https://godoc.org/github.com/jpillora/chisel) [![CI](https://github.com/jpillora/chisel/workflows/CI/badge.svg)](https://github.com/jpillora/chisel/actions?workflow=CI)

Chisel هو نفق TCP/UDP سريع، يُنقل عبر HTTP، ويُؤمَّن عبر SSH. ملف تنفيذي واحد يتضمن كلاً من العميل والخادم. مكتوب بلغة Go (golang). يُعد Chisel مفيدًا بشكل أساسي لعبور جدران الحماية، رغم أنه يمكن استخدامه أيضًا لتوفير نقطة نهاية آمنة داخل شبكتك.

![overview](https://assets.kitploit.com/production/public/readmes/1084/7f9bb728fdb834aad865b50d9798c4b62bb22f9fa37915bc4d5a5ca9c6f7aed0.png)

## جدول المحتويات

- [الميزات](#features)
- [التثبيت](#install)
- [العرض التوضيحي](#demo)
- [الاستخدام](#usage)
- [المساهمة](#contributing)
- [سجل التغييرات](#changelog)
- [الترخيص](#license)

## الميزات

- سهولة الاستخدام
- [أداء عالٍ](https://github.com/jpillora/chisel/blob/master/test/bench/perf.md)\*
- [اتصالات مشفرة](#security) باستخدام بروتوكول SSH (عبر `crypto/ssh`)
- [اتصالات موثّقة](#authentication)؛ اتصالات العميل الموثّقة عبر ملف إعدادات المستخدمين، واتصالات الخادم الموثّقة عبر مطابقة البصمة.
- إعادة اتصال العميل تلقائيًا مع [تراجع أُسّي](https://github.com/jpillora/backoff) (قابل للضبط عبر `--min/max-retry-interval`)؛ تنتهي مهلة نبضات keepalive، لذا تُكتشف الاتصالات الميتة بصمت (النوم/الاستيقاظ، انتهاء مهلة NAT، إعادة تشغيل الخادم) ويُعاد إنشاؤها
- يمكن للعملاء إنشاء عدة نقاط نهاية للنفق عبر اتصال TCP واحد
- يمكن للعملاء اختياريًا المرور عبر وكلاء SOCKS أو HTTP CONNECT
- إعادة توجيه المنافذ العكسي (تمر الاتصالات عبر الخادم وتخرج من العميل)
- يمكن للخادم اختياريًا أن يعمل أيضًا كـ [وكيل عكسي](http://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy)
- يسمح الخادم اختياريًا باتصالات [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) (انظر [الدليل أدناه](#socks5-guide))
- يسمح العملاء اختياريًا باتصالات [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) من إعادة توجيه منفذ عكسي
- اتصالات العميل عبر stdio التي تدعم `ssh -o ProxyCommand` مما يوفر SSH عبر HTTP

## التثبيت

### الملفات التنفيذية

[![Releases](https://img.shields.io/github/release/jpillora/chisel.svg)](https://github.com/jpillora/chisel/releases) [![Releases](https://img.shields.io/github/downloads/jpillora/chisel/total.svg)](https://github.com/jpillora/chisel/releases)

انظر [أحدث إصدار](https://github.com/jpillora/chisel/releases/latest) أو قم بتنزيله وتثبيته الآن باستخدام `curl https://i.jpillora.com/chisel! | bash`

تُبنى الملفات التنفيذية باستخدام أحدث إصدار من Go، والذي يحدد الحد الأدنى لإصدارات أنظمة التشغيل: Windows 10 / Server 2016، وmacOS 12، ونواة Linux 3.2، وFreeBSD 12.2. للأنظمة الأقدم (مثل Windows 7)، استخدم [الإصدار v1.8.1](https://github.com/jpillora/chisel/releases/tag/v1.8.1) أو أقدم.

### Docker

[![Docker Pulls](https://img.shields.io/docker/pulls/jpillora/chisel.svg)](https://hub.docker.com/r/jpillora/chisel/) [![Image Size](https://img.shields.io/docker/image-size/jpillora/chisel/latest)](https://hub.docker.com/r/jpillora/chisel/tags)

```sh
docker run --rm -it jpillora/chisel --help
```

الصور متعددة المعماريات ومنشورة على كل من Docker Hub (`jpillora/chisel`) وGitHub Container Registry (`ghcr.io/jpillora/chisel`).

### Fedora

يتم صيانة الحزمة بواسطة مجتمع Fedora. إذا واجهت مشكلات متعلقة باستخدام RPM، فيرجى استخدام [متتبع المشكلات](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&classification=Fedora&component=chisel&list_id=11614537&product=Fedora&product=Fedora%20EPEL) هذا.

```sh
sudo dnf -y install chisel
```

### المصدر

```sh
$ go install github.com/jpillora/chisel@latest
```

## عرض توضيحي

يمكنك تشغيل خادم العرض التوضيحي الخاص بك في دقائق (اختفى عرض Heroku التوضيحي القديم مع الطبقة المجانية من Heroku). يقوم [`example/fly.toml`](https://github.com/jpillora/chisel/blob/master/example/fly.toml) بنشر `chisel server` هذا إلى الحصة المجانية من [fly.io](https://fly.io):

```sh
$ chisel server --port $PORT --backend http://example.com
# listens on $PORT, proxies normal web requests to http://example.com
```

انشره باستخدام `fly launch --copy-config` من دليل `example/`، ثم أنشئ نفقًا إلى أي خدمة تعمل بجانب الخادم، على سبيل المثال:

```sh
$ chisel client https://<your-app>.fly.dev 3000
# connects to your chisel server,
# tunnels your localhost:3000 to the server's localhost:3000
```

عند زيارة عنوان URL الخاص بتطبيقك في متصفح، يتم الوصول إلى الوكيل الخلفي الافتراضي للخادم ويظهر نسخة من [example.com](http://example.com).

## الاستخدام

<!-- render these help texts by hand,
  or use https://github.com/jpillora/md-tmpl
    with $ md-tmpl -w README.md -->

<!--tmpl,code=plain:echo "$ chisel --help" && go run main.go --help | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->
``` plain 
$ chisel --help

  Usage: chisel [command] [--help]

  Version: X.Y.Z

  Commands:
    server - runs chisel in server mode
    client - runs chisel in client mode

  Read more:
    https://github.com/jpillora/chisel

```
<!--/tmpl-->


<!--tmpl,code=plain:echo "$ chisel server --help" && go run main.go server --help | cat | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->
``` plain 
$ chisel server --help

  Usage: chisel server [options]

  Options:

    --host, Defines the HTTP listening host – the network interface
    (defaults the environment variable HOST and falls back to 0.0.0.0).

    --port, -p, Defines the HTTP listening port (defaults to the environment
    variable PORT and falls back to port 8080).

    --key, (deprecated use --keygen and --keyfile instead)
    An optional string to seed the generation of a ECDSA public
    and private key pair. All communications will be secured using this
    key pair. Share the subsequent fingerprint with clients to enable detection
    of man-in-the-middle attacks (defaults to the CHISEL_KEY environment
    variable, otherwise a new key is generate each run).

    --keygen, A path to write a newly generated PEM-encoded SSH private key file.
    If users depend on your --key fingerprint, you may also include your --key to
    output your existing key. Use - (dash) to output the generated key to stdout.

    --keyfile, An optional path to a PEM-encoded SSH private key. When
    this flag is set, the --key option is ignored, and the provided private key
    is used to secure all communications. (defaults to the CHISEL_KEY_FILE
    environment variable). Since ECDSA keys are short, you may also set keyfile
    to the inline key string itself, exactly as printed by --keygen (a base64
    string with a "ck-" prefix); no extra base64 encoding is needed.

    --authfile, An optional path to a users.json file. This file should
    be an object with users defined like:
      {
        "<user:pass>": ["<addr-regex>","<addr-regex>"]
      }
    when <user> connects, their <pass> will be verified and then
    each of the remote addresses will be compared against the list
    of address regular expressions for a match. Patterns are NOT
    anchored by default: "10.0.0.1:80" also matches
    "210.0.0.1:8080", and "." matches any character. Anchor your
    patterns, e.g. "^10\.0\.0\.1:80$". The empty string ""
    matches every address. Addresses will
    always come in the form "<remote-host>:<remote-port>" for normal remotes,
    "R:<local-interface>:<local-port>" for reverse port forwarding
    remotes, and "socks" for SOCKS5 proxy access. Note that SOCKS5
    access previously bypassed this list; existing authfiles which
    should allow SOCKS5 must add an entry matching "socks" (the
    empty wildcard "" matches everything, including "socks"). This
    file will be automatically reloaded on change. Reloads apply
    to new connections and to new tunnels of connected clients;
    established tunnels are not interrupted.

    --auth, An optional string representing a single user with full
    access, in the form of <user:pass>. It is equivalent to creating an
    authfile with {"<user:pass>": [""]}. If unset, it will use the
    environment variable AUTH.

    --keepalive, An optional keepalive interval. Since the underlying
    transport is HTTP, in many instances we'll be traversing through
    proxies, often these proxies will close idle connections. You must
    specify a time with a unit, for example '5s' or '2m'. Defaults
    to '25s' (set to 0s to disable).

    --backend, Specifies another HTTP server to proxy requests to when
    chisel receives a normal HTTP request. Useful for hiding chisel in
    plain sight. --proxy is accepted as an alias for this flag.

    --socks5, Allow clients to access the internal SOCKS5 proxy. See
    chisel client --help for more information.

    --reverse, Allow clients to specify reverse port forwarding remotes
    in addition to normal remotes.

    --tls-key, Enables TLS and provides optional path to a PEM-encoded
    TLS private key. When this flag is set, you must also set --tls-cert,
    and you cannot set --tls-domain.

    --tls-cert, Enables TLS and provides optional path to a PEM-encoded
    TLS certificate. When this flag is set, you must also set --tls-key,
    and you cannot set --tls-domain.

    --tls-domain, Enables TLS and automatically acquires a TLS key and
    certificate using LetsEncrypt. Setting --tls-domain requires port 443.
    You may specify multiple --tls-domain flags to serve multiple domains.
    The resulting files are cached in the "$HOME/.cache/chisel" directory.
    You can modify this path by setting the CHISEL_LE_CACHE variable,
    or disable caching by setting this variable to "-". You can optionally
    provide a certificate notification email by setting CHISEL_LE_EMAIL.

    --tls-ca, a path to a PEM encoded CA certificate bundle or a directory
    holding multiple PEM encode CA certificate bundle files, which is used to 
    validate client connections. The provided CA certificates will be used 
    instead of the system roots. This is commonly used to implement mutual-TLS. 

    --pid Generate pid file in current working directory

    -v, Enable verbose logging

    --help, This help text

  Signals:
    The chisel process is listening for:
      a SIGINT or SIGTERM to begin a graceful shutdown
        (a second signal forces an immediate exit),
      a SIGUSR2 to print process stats, and
      a SIGHUP to short-circuit the client reconnect timer

  Version:
    X.Y.Z

  Read more:
    https://github.com/jpillora/chisel

```
<!--/tmpl-->


<!--tmpl,code=plain:echo "$ chisel client --help" && go run main.go client --help | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->
``` plain 
$ chisel client --help

  Usage: chisel client [options] <server> <remote> [remote] [remote] ...

  <server> is the URL to the chisel server.

  <remote>s are remote connections tunneled through the server, each of
  which come in the form:

    <local-host>:<local-port>:<remote-host>:<remote-port>/<protocol>

    ■ local-host defaults to 0.0.0.0 (all interfaces).
    ■ local-port defaults to remote-port.
    ■ remote-port is required*.
    ■ remote-host defaults to 127.0.0.1 (server localhost).
    ■ protocol defaults to tcp.

  which shares <remote-host>:<remote-port> from the server to the client
  as <local-host>:<local-port>, or:

    R:<local-interface>:<local-port>:<remote-host>:<remote-port>/<protocol>

  which does reverse port forwarding, sharing <remote-host>:<remote-port>
  from the client to the server's <local-interface>:<local-port>.

    example remotes

      3000
      example.com:3000
      3000:google.com:80
      192.168.0.5:3000:google.com:80
      socks
      5000:socks
      udpsocks
      5000:udpsocks
      R:2222:localhost:22
      R:socks
      R:5000:socks
      R:5000:udpsocks
      stdio:example.com:22
      1.1.1.1:53/udp

    When the chisel server has --socks5 enabled, remotes can
    specify "socks" or "udpsocks" in place of remote-host and
    remote-port. Both default to the local host and port
    127.0.0.1:1080. Connections to this remote will terminate
    at the server's internal SOCKS5 proxy. When the server also
    has --authfile set, SOCKS5 access requires an entry matching
    the token "socks" in the user's address list.

    When the chisel server has --reverse enabled, remotes can
    be prefixed with R to denote that they are reversed. That
    is, the server will listen and accept connections, and they
    will be proxied through the client which specified the remote.
    Reverse remotes specifying "R:socks" will listen on the server's
    default socks port (1080) and terminate the connection at the
    client's internal SOCKS5 proxy.

    The "socks" remote supports TCP CONNECT only. Use "udpsocks"
    for TCP CONNECT and UDP ASSOCIATE, including "R:udpsocks".
    It binds TCP and UDP on the same configured interface and port;
    the UDP relay never uses a randomly allocated listening port.
    UDP requires support on both Chisel peers. Destination names are
    resolved at the exit node. If UDP cannot bind, TCP remains available
    and UDP ASSOCIATE fails; no alternate port is used. Clients using
    a zero UDP source port allow one pending association per source IP
    until the first valid datagram pins it. BIND, UDP fragmentation,
    and udpsocks over stdio are not supported.

    When stdio is used as local-host, the tunnel will connect standard
    input/output of this program with the remote. This is useful when 
    combined with ssh ProxyCommand. You can use
      ssh -o ProxyCommand='chisel client chiselserver stdio:%h:%p' \
          [email protected]
    to connect to an SSH server through the tunnel.

  Options:

    --fingerprint, A *strongly recommended* fingerprint string
    to perform host-key validation against the server's public key.
    Fingerprint mismatches will close the connection.
    Fingerprints are generated by hashing the ECDSA public key using
    SHA256 and encoding the result in base64.
    Fingerprints must be 44 characters containing a trailing equals (=).
    Legacy MD5 colon fingerprints (deprecated) are still accepted,
    but only in their full 16-octet form; truncated prefixes are
    rejected.

    --auth, An optional username and password (client authentication)
    in the form: "<user>:<pass>". These credentials are compared to
    the credentials inside the server's --authfile. defaults to the
    AUTH environment variable.

    --keepalive, An optional keepalive interval. Since the underlying
    transport is HTTP, in many instances we'll be traversing through
    proxies, often these proxies will close idle connections. You must
    specify a time with a unit, for example '5s' or '2m'. Defaults
    to '25s' (set to 0s to disable).

    --max-retry-count, Maximum number of times to retry before exiting.
    Defaults to unlimited.

    --min-retry-interval, Minimum wait time before retrying after a
    disconnection. Defaults to 1 second.

    --max-retry-interval, Maximum wait time before retrying after a
    disconnection. Defaults to 5 minutes.

    --proxy, An optional HTTP CONNECT or SOCKS5 proxy which will be
    used to reach the chisel server. Authentication can be specified
    inside the URL. Credentials must be URL-encoded; for example a
    "#" in the password must be written as "%23".
    For example, http://admin:[email protected]:8081
            or: socks://admin:[email protected]:1080
    The socks://, socks5:// and socks5h:// schemes are equivalent:
    DNS is always resolved by the proxy.

    --header, Set a custom header in the form "HeaderName: HeaderContent".
    Can be used multiple times. (e.g --header "Foo: Bar" --header "Hello: World")

    --hostname, Optionally set the 'Host' header (defaults to the host
    found in the server url).

    --sni, Override the ServerName when using TLS (defaults to the 
    hostname).

    --tls-ca, An optional root certificate bundle used to verify the
    chisel server. Only valid when connecting to the server with
    "https" or "wss". By default, the operating system CAs will be used.

    --tls-skip-verify, Skip server TLS certificate verification of
    chain and host name (if TLS is used for transport connections to
    server). If set, client accepts any TLS certificate presented by
    the server and any host name in that certificate. This only affects
    transport https (wss) connection. Chisel server's public key
    may be still verified (see --fingerprint) after inner connection
    is established.

    --tls-key, a path to a PEM encoded private key used for client 
    authentication (mutual-TLS).

    --tls-cert, a path to a PEM encoded certificate matching the provided 
    private key. The certificate must have client authentication 
    enabled (mutual-TLS).

    --pid Generate pid file in current working directory

    -v, Enable verbose logging

    --help, This help text

  Signals:
    The chisel process is listening for:
      a SIGINT or SIGTERM to begin a graceful shutdown
        (a second signal forces an immediate exit),
      a SIGUSR2 to print process stats, and
      a SIGHUP to short-circuit the client reconnect timer

  Version:
    X.Y.Z

  Read more:
    https://github.com/jpillora/chisel

```
<!--/tmpl-->

### الأمان

يُفعَّل التشفير دائمًا. عند تشغيل خادم chisel، سيولّد زوج مفاتيح ECDSA عام/خاص في الذاكرة. ستُعرض بصمة المفتاح العام (SHA256 بترميز base64) عند بدء تشغيل الخادم. بدلًا من توليد مفتاح عشوائي، يمكن للخادم اختياريًا تحديد ملف مفتاح باستخدام خيار `--keyfile`. عند اتصال العملاء، سيعرضون أيضًا بصمة المفتاح العام للخادم. يمكن للعميل فرض بصمة معينة باستخدام خيار `--fingerprint`. لا تزال بصمات MD5 القديمة مقبولة ولكن يجب أن تكون بالصيغة الكاملة المكوّنة من 16 ثمانية مفصولة بنقطتين — تُرفض البادئات المقتطعة. راجع `--help` أعلاه لمزيد من المعلومات.

كما يحدّ الخادم من أحجام رسائل websocket الواردة قبل المصادقة (`CHISEL_WS_READ_LIMIT`، الافتراضي 512 KiB)، بحيث لا يمكن للأقران غير المصادَق عليهم استنزاف الذاكرة برسائل ضخمة. يقع الافتراضي بأريحية فوق الحد الأقصى لحزمة النقل البالغ 256 KiB في `x/crypto/ssh`، لذا لا تُرفض أي حزمة SSH صالحة أبدًا. فقط القيمة `0` تعطّل الحد؛ القيم السالبة ترجع إلى الافتراضي الآمن.

### المصادقة

باستخدام خيار `--authfile`، يمكن للخادم اختياريًا توفير ملف تهيئة `user.json` لإنشاء قائمة بالمستخدمين المقبولين. ثم يصادق العميل باستخدام خيار `--auth`. راجع [users.json](https://github.com/jpillora/chisel/blob/master/example/users.json) للحصول على مثال لملف تهيئة المصادقة. راجع `--help` أعلاه لمزيد من المعلومات.

ملاحظات حول سلوك authfile:

- تتم مراقبة الملف و**إعادة تحميله مباشرةً** — بما في ذلك عمليات الحفظ من المحرر عبر إعادة التسمية (vim) وتحديثات configmap في kubernetes. تُطبَّق عمليات إعادة التحميل على الاتصالات الجديدة وعلى الأنفاق الجديدة للعملاء المتصلين بالفعل؛ يفقد المستخدمون المحذوفون الوصول إلى الأنفاق الجديدة فورًا، رغم أن الأنفاق القائمة لا تنقطع.
- أنماط العناوين هي تعبيرات نمطية و**غير مثبَّتة** — ثبّتها باستخدام `^` و`$` (يحذّر الخادم من الأنماط غير المثبَّتة عند التحميل). السلسلة الفارغة `""` تطابق كل شيء.
- يُتحكَّم في الوصول إلى SOCKS5 عبر مدخل يطابق الرمز `socks`. **تغيير كاسر**: كان SOCKS5 سابقًا يتجاوز authfile بالكامل؛ يجب على الخوادم التي تشغّل `--socks5` مع `--authfile` منح `socks` للمستخدمين الذين ينبغي أن يحتفظوا بوصول الوكيل (تظل مدخلات البدل `""` تعمل).
- سلاسل المصادقة بدون نقطتين (`user:pass`) أصبحت الآن **خطأً قاتلًا عند بدء التشغيل** على كلٍّ من الخادم والعميل — كانت سابقًا تعطّل المصادقة بصمت.
- ينجو مستخدم `--auth` من عمليات إعادة تحميل authfile ويفوز عند تعارض الأسماء مع مستخدمي الملف.

داخليًا، يتم ذلك باستخدام طريقة مصادقة _Password_ التي يوفرها SSH. اعرف المزيد عن `crypto/ssh` هنا http://blog.gopheracademy.com/go-and-ssh/. تُسجَّل عمليات فتح/إغلاق الجلسات (مع المستخدم وعنوان المصدر والـ remotes) ومحاولات تسجيل الدخول الفاشلة عند مستوى info.

### دليل TLS

أبسط إعداد آمن هو `--tls-domain`، الذي يوفّر شهادة LetsEncrypt تلقائيًا (يتطلب المنفذ 443 وسجل DNS يشير إلى الخادم):

```sh
chisel server --port 443 --tls-domain chisel.example.com --auth user:pass
chisel client --auth user:pass https://chisel.example.com R:2222:localhost:22
```

لاستخدام الشهادة الخاصة بك (موقعة ذاتيًا أو من CA داخلي)، قم بإنشاء زوج مفتاح/شهادة ووجّه كلا الجانبين إلى الملفات الصحيحة:

```sh
chisel server --port 443 --tls-key key.pem --tls-cert cert.pem
chisel client --tls-ca ca.pem https://chisel.example.com 3000
```

بالنسبة لـ mutual TLS، مرّر أيضًا `--tls-ca` إلى الخادم و`--tls-cert`/`--tls-key` إلى كل عميل. لاحظ أن TLS يغلّف ناقل chisel من الخارج؛ لا تزال طبقة SSH الداخلية تشفّر وتوثّق، لذا يعمل التحقق عبر `--fingerprint` مع TLS أو بدونه.

### دليل SOCKS5 مع Docker

1. اطبع مفتاحًا خاصًا جديدًا إلى الطرفية

    ```sh
    chisel server --keygen -
    # or save it to disk --keygen /path/to/mykey
    ```

1. ابدأ خادم chisel الخاص بك

    ```sh
    jpillora/chisel server --keyfile '<ck-base64 string or file path>' -p 9312 --socks5
    ```

1. وصّل عميل chisel الخاص بك (باستخدام fingerprint الخادم)

    ```sh
    chisel client --fingerprint '<see server output>' <server-address>:9312 socks
    ```

1. وجّه عملاء SOCKS5 لديك (مثل نظام التشغيل/المتصفح) إلى:

    ```
    <client-address>:1080
    ```

1. الآن لديك اتصال SOCKS5 مشفّر وموثّق عبر HTTP

ملاحظة: إذا استخدم الخادم أيضًا `--authfile`، يحتاج المستخدمون إلى إدخال يطابق الرمز `socks` لاستخدام الوكيل (انظر [Authentication](#authentication)).

للاطلاع على أوامر الإعداد، والوضع العكسي، ومثال عميل UDP، راجع [دليل مستخدم SOCKS5 UDP](https://github.com/jpillora/chisel/blob/master/example/udpsocks.md).

تدعم remotes العادية من نوع `socks` بروتوكول TCP CONNECT فقط ولا تربط أي مقبس UDP. لتمكين كل من TCP CONNECT وUDP ASSOCIATE، استخدم `udpsocks` (أو `R:udpsocks` للوضع العكسي)، على سبيل المثال `1080:udpsocks`. كلا النوعين يستخدم افتراضيًا `127.0.0.1:1080` ويستخدمان نفس أذونات الوصول إلى SOCKS. يربط مستمع `udpsocks` بروتوكولي TCP وUDP على نفس الواجهة والمنفذ المُهيَّأين، ويشارك مقبس ترحيل UDP واحد عبر الارتباطات دون تخصيص منافذ استماع عشوائية. يُبقي عملاء UDP اتصال التحكم TCP الخاص بهم مفتوحًا ويرسلون datagrams مغلّفة بـ SOCKS إلى ذلك المنفذ. تُحلّ أسماء وجهات datagram عند عقدة الخروج، ويمرّ حركة UDP عبر نفق SSH المشفّر. قم بترقية كلا نظيري Chisel لدعم UDP؛ يبقى TCP SOCKS متوافقًا مع النظراء الأقدم.

عند كشف مستمع `udpsocks` عبر جدار حماية أو حاوية، اسمح بكل من TCP وUDP على المنفذ المُهيَّأ الخاص به. يُرجع UDP ASSOCIATE عنوان IP المحلي الذي يقبل اتصال TCP، والذي يجب أن يكون قابلًا للوصول من عميل SOCKS. بالنسبة لمستمعي Linux Docker، استخدم `--network host` مع remote `0.0.0.0:1080:udpsocks` لتجنّب الإعلان عن عنوان حاوية معزول. تحتاج تعيينات منافذ الحاوية إلى كل من `-p 1080:1080/tcp` و`-p 1080:1080/udp`، بالإضافة إلى قابلية الوصول إلى عنوان IP الخاص بالترحيل المُعلَن. إذا كان منفذ UDP مشغولًا، يسجّل Chisel أن UDP غير متاح، ويحتفظ بخدمة TCP، ويرفض UDP ASSOCIATE دون استخدام منفذ بديل؛ أعد تشغيل الوكيل بعد تحرير المنفذ.

يقبل الارتباط الحزم من عنوان IP الخاص بنظير TCP الخاص به. يحجز منفذ مصدر UDP المُعلَن تلك النقطة الطرفية؛ يُثبَّت منفذ المصدر الصفري بواسطة أول datagram صالح له. يُسمح بارتباط واحد غير مثبَّت فقط لكل عنوان IP، لذا يجب على العملاء الذين يتشاركون عنوان IP الإعلان عن منافذ مصدر UDP الخاصة بهم أو إرسال أول datagram قبل فتح ارتباط آخر. تُرفض حجوزات منافذ المصدر المكررة. يؤدي إغلاق اتصال التحكم أو فقدان SSH إلى إنهاء الارتباط؛ تتطلب إعادة الاتصال UDP ASSOCIATE جديدًا. BIND وتجزئة UDP و`stdio:udpsocks` غير مدعومة.

### SOCKS العكسي مع Authfile

للسماح لعميل معيّن بالعمل كعقدة خروج SOCKS، امنحه عنوان مستمع reverse-socks (`R:socks` يستمع على `127.0.0.1:1080` الخاص بالخادم):

```json
{
  "exituser:password": ["^R:127\\.0\\.0\\.1:1080$"]
}
```

```sh
chisel server --reverse --authfile users.json
chisel client --auth exituser:password <server-address> R:socks
# server-side consumers point SOCKS5 clients at 127.0.0.1:1080,
# and their traffic exits via the chisel client's network
```

استخدم `R:udpsocks` في أمر العميل لتمكين UDP ASSOCIATE أيضًا على نفس منفذ الخادم؛ وتبقى صلاحية authfile كما هي.

راجع أيضًا [مثال النفق العكسي](https://github.com/jpillora/chisel/blob/master/example/reverse-tunneling-authenticated.md) خطوة بخطوة.

### التشغيل خلف CDN (Cloudflare)

يعمل chisel عبر شبكات CDN التي تدعم WebSockets. بالنسبة إلى Cloudflare: فعّل WebSockets، ومرّر (orange-cloud) سجل DNS عبر البروكسي، واتصل بالعملاء باستخدام `https://`. تُنهي شبكة CDN اتصال TLS، لكن طبقة SSH الداخلية تعني أن التحقق عبر `--fingerprint` لا يزال يوثّق خادم chisel الخاص بك من الطرف إلى الطرف — فلا تستطيع شبكة CDN قراءة حركة المرور المنقولة عبر النفق أو تعديلها. أبقِ `--keepalive` على قيمته الافتراضية `25s` للبقاء ضمن مهل الخمول في CDN، ولاحظ أن البروكسيات التي تُزيل ترويسات `Upgrade` لا يمكنها نقل chisel إطلاقًا.

### الضبط عبر متغيرات البيئة

المقابض الأقل شيوعًا هي متغيرات بيئة، تُقرأ جميعها ببادئة `CHISEL_` (مثل `CHISEL_WS_TIMEOUT=10s`):

| المتغير        | الجانب        | الافتراضي            | الغرض                                            |
| --------------- | ----------- | ------------------ | -------------------------------------------------- |
| `WS_TIMEOUT`    | client      | `45s`              | مهلة مصافحة websocket                        |
| `SSH_TIMEOUT`   | client      | `30s`              | مهلة مصافحة ssh                              |
| `CONFIG_TIMEOUT`| server      | `10s`              | انتظار طلب إعدادات العميل               |
| `SSH_WAIT`      | both        | `35s`              | المدة التي تنتظرها الأنفاق الجديدة لاتصال نشط |
| `PING_TIMEOUT`  | both        | فاصل keepalive | مهلة رد ping الخاص بـ keepalive (لا توجد pings إذا كان `--keepalive 0`) |
| `DIAL_TIMEOUT`  | both        | `30s`              | مهلة اتصال هدف tcp، ومصافحة SOCKS، وSOCKS UDP DNS |
| `WS_READ_LIMIT` | both        | `524288`           | الحد الأقصى لبايتات رسالة websocket الواردة (0 = بلا حد؛ القيمة السالبة = الافتراضي) |
| `WS_BUFF_SIZE`  | both        | go default         | أحجام مخزن القراءة/الكتابة لـ websocket                  |
| `UDP_MAX_SIZE`  | both        | `9012`             | الحد الأقصى لبايتات حزمة udp (يشمل ترويسة SOCKS UDP) |
| `UDP_DEADLINE`  | both        | `15s`              | مهلة قراءة تدفق udp وانتهاء صلاحية return-peer؛ مهلة خمول وجهة SOCKS UDP |
| `UDP_MAX_CONNS` | both        | `100`              | الحد الأقصى لتدفقات udp أو return peers؛ ارتباطات SOCKS UDP لكل مستمع والوجهات لكل ارتباط |
| `SHUTDOWN_GRACE`| server      | `5s`               | وقت تصريف طلبات http عند الإيقاف                |

`HOST` و`PORT` و`AUTH` و`CHISEL_KEY`/`CHISEL_KEY_FILE` موثّقة في نصوص `--help` أعلاه.

---

[Read more](https://github.com/jpillora/chisel)
تنزيل الأداة