Code Monkey home page Code Monkey logo

hiddify-reality-scanner's Introduction

Lang_farsi  فارسی          


Hiddify Logo

Hiddify Reality Scanner

This is a TLS scanner that helps you scan across different networks and find the best Reality SNI for you based on a list of SNIs. For more information about development, you can read through our Contribution Guidelines .

⚙️ Installation

The installation of this scanner has 2 parts. The first part is a server-side application and the 2nd part is client-side.

🛠️ Server-side Installation

  • First you need to install our custom Xray core on the server using the following command:
# remove old xray
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove

#only if you have hiddify manager and hiddify panel
systemctl stop hiddify-xray

# install hiddify custom xray
bash -c "$(curl -L https://github.com/hiddify/Xray-core-custom/raw/main/install-release.sh)" @ install

#only if you have hiddify manager and hiddify panel
systemctl start hiddify-xray
  • Now you should create a config with empty nameserver in your panel or add the following config:
curl -o server_config.json https://raw.githubusercontent.com/hiddify/Hiddify_Reality_Scanner/main/server_config.json

echo "---------------IPV6---------"
echo "vless://hiddify@$(curl -6 ip.sb):11443/?fp=chrome&security=reality&pbk=Z84J2IelR9ch3k8VtlVhhs5ycBUlXA7wHBWcBrjqnAw&sid=6ba85179e30d4fc2&sni=www.google.com&type=tcp&flow=xtls-rprx-vision&encryption=none#Hiddify"

echo "---------------IPV4---------"
echo "vless://hiddify@$(curl -4 ip.sb):11443/?fp=chrome&security=reality&pbk=Z84J2IelR9ch3k8VtlVhhs5ycBUlXA7wHBWcBrjqnAw&sid=6ba85179e30d4fc2&sni=www.google.com&type=tcp&flow=xtls-rprx-vision&encryption=none#Hiddify"

  • Then you need to run the config via Xray like the command below. This will create a temporary Xray server for you :
xray run -c server_config.json
  • You can use your Reality config like the the following link:
vless://hiddify@SERVER_IP:11443/?fp=chrome&security=reality&pbk=Z84J2IelR9ch3k8VtlVhhs5ycBUlXA7wHBWcBrjqnAw&sid=6ba85179e30d4fc2&sni=www.yahoo.com&type=tcp&flow=xtls-rprx-vision&encryption=none#Hiddify

🛠️ Client-side Installation

For client-side, you just need to use Pypi and run the following command:

pip install -U hiddify_reality_scanner

🚀 Basic Usage

In order to run the scanner you need to insall python first, then use one of the following commands on your client:

python -m hiddify_reality_scanner "vless_link"
#or
hiddify_reality_scanner "vless_link"

Be careful that instead of `vless_link' you have to replace it with your Reality config.

🚀 Advanced Usage

  • If you want to consider more items when scanning, use the following command on your client:
hiddify_reality_scanner --jobs 10 --limit 100 --sni yahoo.com,google.com "vless_link"
  • Here:

    • --jobs 10 defines the number of concurrent scans. The(default 10 if you dont use this parameter in the command.
    • --sni defines the desired SNIs for scanning.
    • --limit 100 defines the 100 limit for the working SNIs in the result list. The default 10 if you dont use this parameter in the command
  • If you want to add a list of SNIs, use the following command

hiddify_reality_scanner --jobs 10 --limit 100 --sni path_to_the_list vless_link
  • Here:
    • --jobs 10 defines the number of concurrent scans. The(default 10 if you dont use this parameter in the command.
    • --sni path_to_the_list desines the path for the list of SNIs.
    • --limit 100 defines the 100 limit for the working SNIs in the result list. The(default 10 if you dont use this parameter in the command.

Note: during the scan, if you want to intrupt it, you can simply use ctrl+c .

📊 Results

The results will be stored in results.txt and results.json on your client. You can use these SNIs as a Reality domain in your server. How to add Reality domain on Hiddify Manager

Note: If you have installed server-side scanner on your Hiddify Manager; You need to run the following command after finishing the scan:

systemctl start hiddify-xray

hiddify-reality-scanner's People

Contributors

amirmohamadamini avatar hiddify-com avatar hiiirad avatar lymanjre avatar randomguy-on-internet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hiddify-reality-scanner's Issues

Please add Persian translate

با سلام
لطفا توضیحات فارسی نحوه استفاده از اسکریپت هم اضافه کنید

یکی یاد بده چطور ران کنم

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Make xray binary executable

I encountered connection error while scanning since xray binary file was not executable. Changing its execute permission on ./bin/xray sloved it. It would be better to add this command to the script itself.

Can't install Xray

Can't install Xray

  • distro: Ubuntu 22.4
  • kernel: Linux Falcon 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@Falcon:~# bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 30761  100 30761    0     0   131k      0 --:--:-- --:--:-- --:--:--  131k
Failed to stop xray.service: Unit xray.service not loaded.
error: Stopping the Xray service failed.

How to resolve this problem?

Unable to install Xray on macOS client

The client cannot install Xray v1.8.6 for macOs even if the path has correct permissions or it is run as root.
It throws such "Permission denied" errors:

An error occurred for digivto.ir: [Errno 13] Permission denied: '/Users/alireza/Desktop/tmp/scan/bin/xray'
Traceback (most recent call last):
File "/Users/alireza/.pyenv/versions/3.12.0/lib/python3.12/site-packages/hiddify_reality_scanner/cli.py", line 271, in test_domain_async
p = Popen(
^^^^^^
File "/Users/alireza/.pyenv/versions/3.12.0/lib/python3.12/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/alireza/.pyenv/versions/3.12.0/lib/python3.12/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/Users/alireza/Desktop/tmp/scan/bin/xray'

Error----An exception occurred: module 'sys' has no attribute 'setcheckinterval' ---

بعد از اجرای دستور در سمت سرور روی cmd ، این پیغام خطا ظاهر میشه و از برنامه خارج میشه

===============================================================

Attention! This script may take time. You can press ctrl+c to stop scan at any time

===============================================================

An exception occurred: module 'sys' has no attribute 'setcheckinterval'
Exception ignored in: <function tqdm.del at 0x000001C5D78718B0>
Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\tqdm_tqdm.py", line 790, in del
self.close()
File "C:\Python\Python39\lib\site-packages\tqdm_tqdm.py", line 1017, in close
if self.disable:
AttributeError: 'tqdm' object has no attribute 'disable'
Finished=============== Sorting results ===============
Nothing found! :(

Error while connecting to proxy

I tested the latest PIP package on both linux and ma clients, and the server is listening to any incoming connection. However, none of SNI tests result in success and throws such error:

www.google.com [Errno None] Could not connect to proxy 127.0.0.1:52239 [None]

[Errno None] Could not connect to proxy 127.0.0.1:53443 [None]

Is this normal?
It seems like xray is not running, on first run it tried to download xray , dont know if it was succeful or not but all I get are errors:

ubuntu@ubuntu:~ $ hiddify_reality_scanner "vless://[email protected]:11443?security=reality&sni=www.yahoo.com&fp=chrome&pbk=Z84J2IelR9ch3k8VtlVhhs5ycBUlXA7wHBWcBrjqnAw&sid=6ba85179e30d4fc2&type=tcp&flow=xtls-rprx-vision&encryption=none#Hiddify"
{
    "server_address": "xxx.xxx.xxx.xxx",
    "server_port": 11443,
    "short_id": "6ba85179e30d4fc2",
    "public_key": "Z84J2IelR9ch3k8VtlVhhs5ycBUlXA7wHBWcBrjqnAw",
    "uuid": "hiddify",
    "origsni": "www.yahoo.com",
    "type": "tcp",
    "serviceName": "",
    "mode": ""
}
===============================================================
===============================================================
===============================================================
Attention! This script may takes time. You can press ctrl+c to stop scan at any time
===============================================================
===============================================================
===============================================================
www.yahoo.com [Errno None] Could not connect to proxy 127.0.0.1:25977 [None]
2reha.ir [Errno None] Could not connect to proxy 127.0.0.1:44181 [None]
www.yahoo.com           :None
2reha.ir                :None
ferdoone.ir [Errno None] Could not connect to proxy 127.0.0.1:32189 [None]
sepehrad.com [Errno None] Could not connect to proxy 127.0.0.1:37425 [None]
ferdoone.ir             :None
sepehrad.com            :None
vitcom-shop.ir [Errno None] Could not connect to proxy 127.0.0.1:17949 [None]
vitcom-shop.ir          :None
chooblebasy.ir [Errno None] Could not connect to proxy 127.0.0.1:49307 [None]
sazehsite.ir [Errno None] Could not connect to proxy 127.0.0.1:22563 [None]
chooblebasy.ir          :None
sazehsite.ir            :None
azwood.ir [Errno None] Could not connect to proxy 127.0.0.1:34207 [None]
azwood.ir               :None
iran-newspaper.com [Errno None] Could not connect to proxy 127.0.0.1:26487 [None]
iran-newspaper.com              :None
dorfakkhabar.ir [Errno None] Could not connect to proxy 127.0.0.1:49317 [None]
dorfakkhabar.ir         :None
cacooti.com [Errno None] Could not connect to proxy 127.0.0.1:7565 [None]
tvbeta.ir [Errno None] Could not connect to proxy 127.0.0.1:20949 [None]
cacooti.com             :None
tvbeta.ir               :None
jdeihe.ac.ir [Errno None] Could not connect to proxy 127.0.0.1:61663 [None]
jdeihe.ac.ir            :None
codesabz.ir [Errno None] Could not connect to proxy 127.0.0.1:45795 [None]
codesabz.ir             :None
kalaprint.com [Errno None] Could not connect to proxy 127.0.0.1:5353 [None]
kalaprint.com           :None
An error occurred for ir-sanat.ir: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/home/payam/.local/lib/python3.9/site-packages/hiddify_reality_scanner/cli.py", line 294, in test_domain_async
    p.stdin.close()
BrokenPipeError: [Errno 32] Broken pipe
kardookh.com [Errno None] Could not connect to proxy 127.0.0.1:54353 [None]
kardookh.com            :None
novinattari.ir [Errno None] Could not connect to proxy 127.0.0.1:44999 [None]
novinattari.ir          :None
lordled.com [Errno None] Could not connect to proxy 127.0.0.1:2493 [None]
lordled.com             :None
flyoneiran.com [Errno None] Could not connect to proxy 127.0.0.1:58533 [None]

Checked the link again, its correct
Can connect via nekoray

مصرف زیاد رم و فضای ویندوز

5555

هنگام اسکن به شدت مصرف رم میره بالا به حدی که 16 گیگ رم سیستم پر میشود
همچنین درایو c با 20 گیگ فضای خالی به 5 گیگ میرسد!

Termux

سلام،نسخه ی متناسب با ترموکس رو هم لطف میکنید

Invalid file permission after xray download

If you don't have Xray in the current folder, the scanner will automatically download and extract Xray to the bin folder, but it will not set execution permissions to the Xray file. As a result, you will receive an invalid file permission error.

PermissionError: [Errno 13] Permission denied: '/x/home/.../bin/xray'
An error occurred for yadakshenas.ir: [Errno 13] Permission denied: '/x/home/.../bin/xray'
Traceback (most recent call last):
  File "/home/.../.local/lib/python3.10/site-packages/hiddify_reality_scanner/cli.py", line 271, in test_domain_async
    p = Popen(
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
  • OS: Ubuntu
  • Version: 22.04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.