FunnyWolf / Viper

Attack Surface Management & Red Team Simulation Platform 互联网攻击面管理&红队模拟平台
https://www.yuque.com/vipersec
BSD 3-Clause "New" or "Revised" License
3.75k stars 528 forks source link

[BUG] 适配redis(6.x) termux #88

Closed 2096779623 closed 2 years ago

2096779623 commented 2 years ago

描述Bug

~/.../Docker/log $ cat *
192.168.1.98 - - [15/Apr/2022:21:16:06 +0800] "GET / HTTP/1.1" 200 691 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:06 +0800] "GET /umi.ee4ddd40.css HTTP/1.1" 200 21778 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:06 +0800] "GET /umi.b51ad7e8.js HTTP/1.1" 200 351795 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~layouts__BasicLayout.2797ef12.chunk.css HTTP/1.1" 200 622 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~layouts__BasicLayout.89f95b4e.async.js HTTP/1.1" 200 11052 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /layouts__BasicLayout.819092da.chunk.css HTTP/1.1" 200 0 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /layouts__BasicLayout.3f85af09.async.js HTTP/1.1" 200 1537 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~p__Core__HostAndSession~p__User__Login.44e7e3ce.chunk.css HTTP/1.1" 200 12414 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~p__Core__HostAndSession~p__User__Login.56256889.async.js HTTP/1.1" 200 15803 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~p__Core__HostAndSession.e2284d9d.chunk.css HTTP/1.1" 200 20893 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /p__Core__HostAndSession.c8ab176e.chunk.css HTTP/1.1" 200 1848 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /p__Core__HostAndSession.5e17185f.async.js HTTP/1.1" 200 44919 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:07 +0800] "GET /vendors~p__Core__HostAndSession.5de4ede0.async.js HTTP/1.1" 200 687719 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:08 +0800] "GET /layouts__UserLayout.c26c1167.chunk.css HTTP/1.1" 200 804 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:08 +0800] "GET /layouts__UserLayout.363424e7.async.js HTTP/1.1" 200 1254 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:08 +0800] "GET /p__User__Login.8ce24f5d.chunk.css HTTP/1.1" 200 101 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:08 +0800] "GET /p__User__Login.86356ebc.async.js HTTP/1.1" 200 2613 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:08 +0800] "GET /api/v1/core/currentuser/ HTTP/1.1" 500 27 "https://192.168.1.130:60000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
192.168.1.98 - - [15/Apr/2022:21:16:09 +0800] "GET /ws/v1/websocket/heartbeat/?&token=forguest HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
None - - [15/Apr/2022:21:16:08] "WSCONNECTING /ws/v1/websocket/heartbeat/" - -
None - - [15/Apr/2022:21:16:09] "WSDISCONNECT /ws/v1/websocket/heartbeat/" - -
[ERROR][2022-04-15 21:16:08][log][log_response][222][uWSGIWorker1Core2] : Internal Server Error: /api/v1/core/currentuser/ 
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 31, in _decorator
    return method(self, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 98, in _get
    return self.client.get(key, default=default, version=version, client=client)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/client/default.py", line 260, in get
    raise ConnectionInterrupted(connection=client) from e
django_redis.exceptions.ConnectionInterrupted: Redis ResponseError: WRONGPASS invalid username-password pair or user is disabled.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 497, in dispatch
    self.initial(request, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 414, in initial
    self.perform_authentication(request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 324, in perform_authentication
    request.user
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/request.py", line 227, in user
    self._authenticate()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/request.py", line 380, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/authentication.py", line 196, in authenticate
    return self.authenticate_credentials(token)
  File "/data/data/com.termux/files/home/viper/./Core/Handle/baseauth.py", line 17, in authenticate_credentials
    cache_user = Xcache.alive_token(key)
  File "/data/data/com.termux/files/home/viper/./Lib/xcache.py", line 737, in alive_token
    cache_user = cache.get(key)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 91, in get
    value = self._get(key, default, version, client)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 38, in _decorator
    raise e.__cause__
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/client/default.py", line 258, in get
    value = client.get(key)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/commands/core.py", line 1600, in get
    return self.execute_command("GET", name)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/client.py", line 1215, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 1386, in get_connection
    connection.connect()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 626, in connect
    self.on_connect()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 716, in on_connect
    auth_response = self.read_response()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 836, in read_response
    raise response
redis.exceptions.ResponseError: WRONGPASS invalid username-password pair or user is disabled.
[pid: 19462|app: 0|req: 17/17] 192.168.1.98 () {52 vars in 881 bytes} [Fri Apr 15 21:16:08 2022] GET /api/v1/core/currentuser/ => generated 27 bytes in 100 msecs (HTTP/1.1 500) 3 headers in 112 bytes (1 switches on core 2)
Internal Server Error: /api/v1/core/currentuser/
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 31, in _decorator
    return method(self, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 98, in _get
    return self.client.get(key, default=default, version=version, client=client)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/client/default.py", line 260, in get
    raise ConnectionInterrupted(connection=client) from e
django_redis.exceptions.ConnectionInterrupted: Redis ResponseError: WRONGPASS invalid username-password pair or user is disabled.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 497, in dispatch
    self.initial(request, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 414, in initial
    self.perform_authentication(request)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/views.py", line 324, in perform_authentication
    request.user
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/request.py", line 227, in user
    self._authenticate()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/request.py", line 380, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/rest_framework/authentication.py", line 196, in authenticate
    return self.authenticate_credentials(token)
  File "/data/data/com.termux/files/home/viper/./Core/Handle/baseauth.py", line 17, in authenticate_credentials
    cache_user = Xcache.alive_token(key)
  File "/data/data/com.termux/files/home/viper/./Lib/xcache.py", line 737, in alive_token
    cache_user = cache.get(key)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 91, in get
    value = self._get(key, default, version, client)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/cache.py", line 38, in _decorator
    raise e.__cause__
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/django_redis/client/default.py", line 258, in get
    value = client.get(key)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/commands/core.py", line 1600, in get
    return self.execute_command("GET", name)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/client.py", line 1215, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 1386, in get_connection
    connection.connect()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 626, in connect
    self.on_connect()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 716, in on_connect
    auth_response = self.read_response()
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/redis/connection.py", line 836, in read_response
    raise response
redis.exceptions.ResponseError: WRONGPASS invalid username-password pair or user is disabled.

如何复现 请说明如何复现Bug:

  1. 在Termux上启动viper

2.用浏览器登录viper或者用viper自定义的msf连接到Redis

3.Bug出现了

截图 image image

提醒

我在termux上运行的viper

可能的解决方法

~/viper/Docker $ pkg info redis
Package: redis
Version: 6.2.6
Maintainer: @termux
Installed-Size: 2486 kB
Homepage: https://redis.io/
Download-Size: 668 kB
APT-Manual-Installed: yes
APT-Sources: https://mirrors.hit.edu.cn/termux/apt/termux-main stable/main aarch64 Packages
Description: In-memory data structure store used as a database, cache and message broker
Application version:
0.118.0+e05e762
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.bfsu.edu.cn/termux/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.bfsu.edu.cn/termux/apt/termux-x11 x11 main
Updatable packages:
clang/stable 14.0.0 aarch64 [upgradable from: 13.0.1]
libcompiler-rt/stable 14.0.0 aarch64 [upgradable from: 13.0.1]
libllvm/stable 14.0.0 aarch64 [upgradable from: 13.0.1]
lld/stable 14.0.0 aarch64 [upgradable from: 13.0.1]
llvm/stable 14.0.0 aarch64 [upgradable from: 13.0.1]
rust/stable 1.60.0 aarch64 [upgradable from: 1.59.0-1]
Android version:
10
Kernel build information:
Linux localhost 4.9.206-perf #2 SMP PREEMPT Fri Jul 3 15:12:14 JST 2020 aarch64 Android
~/viper/Docker $ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
u0_a308   6263  0.1  0.2 118324  7624 ?        S<l   1970   0:23 /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/bin/mitmdump -s /data/data/com.termux/files/home/viper/STATICFILES/Tools/proxyscan.py --ssl-insecure -p 28
u0_a308   6340  0.5  1.6 5342540 48684 ?       Sl    1970   1:37 com.termux
u0_a308   6482  0.0  0.0  35896  1724 pts/1    S<s+  1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308  12245  0.0  0.0  35896  2012 pts/0    S<s+  1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308  12575  0.0  0.0  39156  1048 ?        S<s   1970   0:00 sshd
u0_a308  19091  0.5  0.1 107948  5060 pts/2    S<l   1970   0:02 redis-server 127.0.0.1:6379
u0_a308  19453  0.2  0.4 246256 14196 ?        S<l   1970   0:45 /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/bin/daphne -u /data/data/com.termux/files/home/viper/daphne.sock --access-log /data/data/com.termux/files/
u0_a308  19455  0.0  0.0  51384  1604 ?        S<    1970   0:02 uwsgi --ini /data/data/com.termux/files/home/viper/Docker/uwsgi.ini
u0_a308  19460  0.0  0.0  41700   384 ?        S<s   1970   0:00 nginx: master process nginx
u0_a308  19461  0.0  0.1  41700  5096 ?        S<    1970   0:05 nginx: worker process
u0_a308  19462  0.0  0.3 290680 11580 ?        S<l   1970   0:14 uwsgi --ini /data/data/com.termux/files/home/viper/Docker/uwsgi.ini
u0_a308  23694  3.0  0.0  26624  1728 ?        R<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -c export LANG="en_US";export LANGUAGE="en_US";export LC_ALL="en_US";free;echo finalshell_separator;uptime;echo finalshell_separator;cat /pro
u0_a308  23696  2.0  0.1  33836  3148 pts/2    R<+   1970   0:00 ps aux
u0_a308  31006  2.4  0.0  44792  2752 ?        R<s   1970   0:56 /data/data/com.termux/files/usr/bin/sshd -R
u0_a308  31016  0.0  0.1  35896  3384 pts/2    S<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308  31021  0.0  0.0  39156  2284 ?        S<s   1970   0:00 /data/data/com.termux/files/usr/bin/sshd -R
u0_a308  31022  0.0  0.0  35896  2252 pts/3    S<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308  31082  0.4  0.0  36096  2408 pts/3    S<+   1970   0:09 /system/bin/top

vipermsf

/data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:163:in `call': WRONGPASS invalid username-password pair or user is disabled. (Redis::CommandError)
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:140:in `block in connect'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:344:in `with_reconnect'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:116:in `connect'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:417:in `ensure_connected'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:269:in `block in process'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:356:in `logging'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:268:in `process'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis/client.rb:162:in `call'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis.rb:2539:in `block in publish'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis.rb:72:in `block in synchronize'
        from /data/data/com.termux/files/usr/lib/ruby/3.1.0/monitor.rb:202:in `synchronize'
        from /data/data/com.termux/files/usr/lib/ruby/3.1.0/monitor.rb:202:in `mon_synchronize'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis.rb:72:in `synchronize'
        from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/redis-4.5.1/lib/redis.rb:2538:in `publish'
        from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core/module/rpcredis.rb:59:in `pub_console_print'
        from /data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/shell.rb:209:in `update_prompt'
        from /data/data/com.termux/files/home/metasploit-framework/lib/msf/ui/console/driver.rb:435:in `update_prompt'
        from /data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/shell.rb:144:in `run'
        from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
        from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
        from ./msfconsole:23:in `<main>'

redis.conf

bind 127.0.0.1 -::1
protected-mode yes
port 6379
tcp-backlog 127
unixsocket /data/data/com.termux/files/usr/var/run/redis/redis-server.sock
unixsocketperm 700
timeout 0
tcp-keepalive 300
daemonize no
pidfile /data/data/com.termux/files/usr/var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
always-show-logo no
set-proc-title yes
proc-title-template "{title} {listen-addr} {server-mode}"
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
dir ./
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
lazyfree-lazy-user-flush no
oom-score-adj no
oom-score-adj-values 0 200 800
disable-thp yes
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
requirepass slvCSJxWEm

适配redis高版本(6.x)

@Funnywolf

FunnyWolf commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,https://github.com/rapid7/metasploit-framework/issues/11023

2096779623 commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,rapid7/metasploit-framework#11023

虽然termux官方不打包,处理msf相关的问题,但是可以在termux上跑msf

FunnyWolf commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,rapid7/metasploit-framework#11023

虽然termux官方不打包,处理msf相关的问题,但是可以在termux上跑msf

msf是能跑起来的?在termux上?

2096779623 commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,rapid7/metasploit-framework#11023

虽然termux官方不打包,处理msf相关的问题,但是可以在termux上跑msf

msf是能跑起来的?在termux上?

在使用官方msf的情况下,当然可以,CobaltStrike还能转移会话到msf,用vipermsf会出现redis的问题。 image

FunnyWolf commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,rapid7/metasploit-framework#11023

虽然termux官方不打包,处理msf相关的问题,但是可以在termux上跑msf

msf是能跑起来的?在termux上?

在使用官方msf的情况下,当然可以,CobaltStrike还能转移会话到msf,用vipermsf会出现redis的问题。 image

我又看了一下错误日志,应该不是redis版本问题,是vipermsf和viperpython读取redis密码(从配置文件里面读)失败了. viperpython image

vipermsf image

我理解termux应该是没有/root/这种目录的,所以redis连接就失败了,可以把redis绑定在60004端口上,密码改成foobared规避一下

FunnyWolf commented 2 years ago

viper的很多文件接口直接写死了/root/.msf4/这种目录,可能也有问题

2096779623 commented 2 years ago

termux 适配不了,因为msf本身就不支持termux,rapid7/metasploit-framework#11023

虽然termux官方不打包,处理msf相关的问题,但是可以在termux上跑msf

msf是能跑起来的?在termux上?

在使用官方msf的情况下,当然可以,CobaltStrike还能转移会话到msf,用vipermsf会出现redis的问题。 image

我又看了一下错误日志,应该不是redis版本问题,是vipermsf和viperpython读取redis密码(从配置文件里面读)失败了. viperpython image

vipermsf image

我理解termux应该是没有/root/这种目录的,所以redis连接就失败了,可以把redis绑定在60004端口上,密码改成foobared规避一下

改了目录之后能读取到yml,是不是跳转不到else

FunnyWolf commented 2 years ago

改了目录之后能读取到yml,是不是跳转不到else

改成60004和foobared应该vipermsf能连上了,viperpython还是连不上,还需要把REDIS_URL改成

REDIS_URL = f"redis://:foobared@127.0.0.1:60004/"
2096779623 commented 2 years ago

viper的很多文件接口直接写死了/root/.msf4/这种目录,可能也有问题

image

之前改过

FunnyWolf commented 2 years ago

不是vipermsf,是viperpython里面 image

2096779623 commented 2 years ago

不是vipermsf,是viperpython里面 image

也改过😉 image

FunnyWolf commented 2 years ago

不是vipermsf,是viperpython里面 image

也改过😉

那应该没有问题了,试试跑一下

2096779623 commented 2 years ago

不是vipermsf,是viperpython里面 image

也改过😉

那应该没有问题了,试试跑一下

msf6 > reload_all
[*] Reloading modules from all module paths...
[-] Error while running command reload_all: unsupported

Call stack:
/data/data/com.termux/files/home/metasploit-framework/modules/exploits/windows/http/dnn_cookie_deserialization_rce.rb:150:in `initialize'
/data/data/com.termux/files/home/metasploit-framework/modules/exploits/windows/http/dnn_cookie_deserialization_rce.rb:150:in `new'
/data/data/com.termux/files/home/metasploit-framework/modules/exploits/windows/http/dnn_cookie_deserialization_rce.rb:150:in `initialize_instance_variables'
/data/data/com.termux/files/home/metasploit-framework/modules/exploits/windows/http/dnn_cookie_deserialization_rce.rb:112:in `initialize'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/module_set.rb:53:in `new'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/module_set.rb:53:in `create'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:52:in `block (3 levels) in refresh_metadata'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:48:in `each'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:48:in `block (2 levels) in refresh_metadata'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:45:in `each'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:45:in `block in refresh_metadata'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:42:in `synchronize'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/modules/metadata/cache.rb:42:in `refresh_metadata'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/module_manager/cache.rb:123:in `refresh_cache_from_module_files'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/core/module_manager/reloading.rb:51:in `reload_modules'
/data/data/com.termux/files/home/metasploit-framework/lib/msf/ui/console/command_dispatcher/modules.rb:967:in `cmd_reload_all'
/data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/data/data/com.termux/files/home/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
./msfconsole:23:in `<main>'

vipermsf没问题了,但是viper还有点问题,我再改改

2096779623 commented 2 years ago

不是vipermsf,是viperpython里面 image

也改过😉

那应该没有问题了,试试跑一下

image

logs-1650100944.zip

.../nginx/conf.d $ cat viper.conf 
map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
}
server {
        include /data/data/com.termux/files/home/viper/Docker/nginxconfig/viper.conf;
        ssl on;
        ssl_certificate /data/data/com.termux/files/home/viper/Docker/nginxconfig/server.crt;
        ssl_certificate_key /data/data/com.termux/files/home/viper/Docker/nginxconfig/server.key;
        ssl_session_timeout 60m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        server_name  webhost;
        gzip on;
        gzip_min_length 1k;
        gzip_comp_level 9;
        gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
        gzip_vary on;
        gzip_disable "MSIE [1-6]\.";
        client_max_body_size   200m;
        error_page 497  https://$host:$server_port$uri;
        access_log /data/data/com.termux/files/home/viper/Docker/log/access.log;
        error_log  /data/data/com.termux/files/home/viper/Docker/log/error.log;
        location / {
            root   /data/data/com.termux/files/home/viper/dist;
                try_files $uri $uri/ /index.html;
        }
        location /api {
                uwsgi_connect_timeout 3000;
                uwsgi_read_timeout 3000;
                uwsgi_send_timeout 3000;
                uwsgi_pass unix:/data/data/com.termux/files/home/viper/uwsgi.sock;
                include /data/data/com.termux/files/usr/etc/nginx/uwsgi_params;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        location /ws {
                proxy_pass   http://unix:/data/data/com.termux/files/home/viper/daphne.sock;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
}

改成https之后: image

2022/04/16 17:07:26 [error] 14285#14285: *166 upstream timed out (110: Connection timed out) while SSL handshaking to upstream, client: 192.168.1.98, server: webhost, request: "GET /ws/v1/websocket/heartbeat/?&token=c0a248f15dc9ebd643d7379df50986b49fad5e7f HTTP/1.1", upstream: "https://unix:/data/data/com.termux/files/home/viper/daphne.sock/ws/v1/websocket/heartbeat/?&token=c0a248f15dc9ebd643d7379df50986b49fad5e7f", host: "192.168.1.130:60000"

image

~/metasploit-framework $ ./msfrpcd
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
[*] Use old token in /data/data/com.termux/files/home/.msf4/token.yml.
[+] Token : UFmNDvVOuZ
[*] JSON-RPC starting on 127.0.0.1:55553 (NO SSL)...
[*] URI: /api/v1/json-rpc
[*] JSON-RPC server log: /data/data/com.termux/files/home/.msf4/logs/msf-json-rpc.log
[*] JSON-RPC server PID file: /data/data/com.termux/files/home/.msf4/msf-json-rpc.pid
[*] MSF JSON-RPC web service is already running as PID 29381
[*] Start JSON-RPC server finish.
~/metasploit-framework $ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
u0_a308   2078  0.0  0.1  35896  3844 pts/1    S<s+  1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308   3128  1.3  0.2  39160  7048 ?        R<s   1970   0:31 /data/data/com.termux/files/usr/bin/sshd -R
u0_a308   3141  0.0  0.1  35896  3892 pts/3    S<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308   3145  0.0  0.2  39156  6736 ?        S<s   1970   0:00 /data/data/com.termux/files/usr/bin/sshd -R
u0_a308   3146  0.0  0.1  35896  3928 pts/4    S<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -l
u0_a308   3213  0.5  0.1  36096  3316 pts/4    S<+   1970   0:11 /system/bin/top
u0_a308   9183  0.0  0.0 246108  2668 ?        S<sl  1970   0:00 /data/data/com.termux/files/usr/bin/postgres -D /data/data/com.termux/files/usr/var/lib/postgresql
u0_a308   9188  0.0  0.0 246108  1384 ?        S<s   1970   0:00 postgres: checkpointer 
u0_a308   9189  0.0  0.0 246108  1344 ?        S<s   1970   0:00 postgres: background writer 
u0_a308   9190  0.0  0.0 246108  1300 ?        S<s   1970   0:00 postgres: walwriter 
u0_a308   9191  0.0  0.0 248668  1812 ?        S<s   1970   0:00 postgres: autovacuum launcher 
u0_a308   9192  0.0  0.0 100740  1368 ?        S<s   1970   0:00 postgres: stats collector 
u0_a308   9193  0.0  0.0 246108  1588 ?        S<s   1970   0:00 postgres: logical replication launcher 
u0_a308  11891  1.1  2.9 249328 86048 pts/3    S<l   1970   0:16 /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/bin/daphne -u /data/data/com.termux/files/home/viper/daphne.sock --access-log /data/data/com.termux/files/
u0_a308  11893  0.0  0.3  51384  9848 ?        S<    1970   0:00 uwsgi --ini /data/data/com.termux/files/home/viper/Docker/uwsgi.ini
u0_a308  11895  0.0  0.1  44772  5756 ?        S<s   1970   0:00 nginx: master process nginx
u0_a308  11897 17.4  3.3 567888 96804 ?        S<l   1970   4:07 uwsgi --ini /data/data/com.termux/files/home/viper/Docker/uwsgi.ini
u0_a308  14167  1.1  3.2 5296660 93236 ?       S<l   1970   2:38 com.termux
u0_a308  14222  0.0  0.0  39156  1516 ?        S<s   1970   0:00 sshd
u0_a308  20619  0.8  0.2  44772  6456 ?        S<    1970   0:03 nginx: worker process
u0_a308  22917  0.2  0.2 225616  6500 ?        S<l   1970   0:18 /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/bin/daphne -u /data/data/com.termux/files/home/viper/daphne.sock --access-log /data/data/com.termux/files/
u0_a308  23480  0.1  0.3 118324  9080 ?        S<l   1970   0:11 /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/bin/mitmdump -s /data/data/com.termux/files/home/viper/STATICFILES/Tools/proxyscan.py --ssl-insecure -p 28
u0_a308  24587  1.5  0.1  35896  3916 ?        S<s   1970   0:00 /data/data/com.termux/files/usr/bin/bash -c export LANG="en_US";export LANGUAGE="en_US";export LC_ALL="en_US";free;echo finalshell_separator;uptime;echo finalshell_separator;cat /pro
u0_a308  24594  0.5  0.0  35888  2872 ?        S<    1970   0:00 sleep 1
u0_a308  24595  3.0  0.1  33836  2972 pts/3    R<+   1970   0:00 ps aux
u0_a308  29381 11.5 12.9 645492 376268 ?       S<l   1970  10:08 thin server (127.0.0.1:55553) [msf-json-rpc]
u0_a308  30757  0.4  0.0 107948  1780 ?        S<l   1970   0:19 redis-server 127.0.0.1:60004
u0_a308  32390  1.5  0.1 110508  4612 ?        S<l   1970   0:54 redis-server 127.0.0.1:6379
~/viper $ cat CONFIG.py 
DEBUG = False
import yaml

def get_token():
    token = "foobared"
    try:
        with open('/data/data/com.termux/files/home/.msf4/token.yml', 'r', encoding='utf-8') as f:
            token = yaml.load(f.read(), Loader=yaml.Loader).get("token")
    except Exception as E:
        pass
    return token

JSON_RPC_IP = '127.0.0.1'
JSON_RPC_PORT = 55553
JSON_RPC_URL = f"http://{JSON_RPC_IP}:{JSON_RPC_PORT}/api/v1/json-rpc"
RPC_TOKEN = get_token()
MSFDIR = "/data/data/com.termux/files/home/.msf4/"

REDIS_URL = f"redis://default:{RPC_TOKEN}@127.0.0.1:6379/"

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": f"{REDIS_URL}1",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
        }
    }
}

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": [{"address": "/data/data/com.termux/files/usr/var/run/redis/redis-server.sock", "password": f"{RPC_TOKEN}"}],
            "capacity": 5000,
            "expiry": 5,
        },
    },
}
MSFLOOTTRUE = "/data/data/com.termux/files/home/.msf4/loot"  # 为了调试
FunnyWolf commented 2 years ago

还是redis的密码问题,应该是CHANNEL_LAYERS这

2096779623 commented 2 years ago

还是redis的密码问题,应该是CHANNEL_LAYERS这

image image

~/viper $ cat CONFIG.py 
DEBUG = False
import yaml

def get_token():
    token = "foobared"
    try:
        with open('/data/data/com.termux/files/home/.msf4/token.yml', 'r', encoding='utf-8') as f:
            token = yaml.load(f.read(), Loader=yaml.Loader).get("token")
    except Exception as E:
        pass
    return token

JSON_RPC_IP = '127.0.0.1'
JSON_RPC_PORT = 55553
JSON_RPC_URL = f"http://{JSON_RPC_IP}:{JSON_RPC_PORT}/api/v1/json-rpc"
RPC_TOKEN = get_token()
MSFDIR = "/data/data/com.termux/files/home/.msf4/"

REDIS_URL = f"redis://default:{RPC_TOKEN}@127.0.0.1:6379/"

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": f"{REDIS_URL}1",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
        }
    }
}

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": [{"address": "/data/data/com.termux/files/usr/var/run/redis/redis-server.sock", "password": "aXOxWLAFve"],
            "capacity": 5000,
            "expiry": 5,
        },
    },
}
MSFLOOTTRUE = "/data/data/com.termux/files/home/.msf4/loot"  # 为了调试

logs-1650112260.zip

~/viper/Docker $ cat /data/data/com.termux/files/home/viper/daphne.sock
cat: /data/data/com.termux/files/home/viper/daphne.sock: No such device or address
~/viper/Docker $ cd ..
~/viper $ ls
CONFIG.py  Core  Docker  LICENSE  Lib  MODULES  MODULES_DATA  Msgrpc  PostLateral  PostModule  README.md  STATICFILES  Viper  WebSocket  __pycache__  daphne.sock  daphne.sock.lock  dist  installed.txt  manage.py  uwsgi.pid  uwsgi.sock  viper.py
~/viper $ 
 $ redis-cli -p 6379
127.0.0.1:6379> auth aXOxWLAFve
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> 
2096779623 commented 2 years ago

还是redis的密码问题,应该是CHANNEL_LAYERS这

Redis没问题了,轮到msfrpcd了

[WARNING][2022-04-17 20:54:59][rpcclient][call][47][ThreadPoolExecutor-0_0] : msf连接失败,检查 http://127.0.0.1:55553/api/v1/json-rpc 是否可用 
2022-04-17 20:54:59,319 WARNING  msf连接失败,检查 http://127.0.0.1:55553/api/v1/json-rpc 是否可用
~/metasploit-framework $ msfrpcd
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
[*] Use old token in /data/data/com.termux/files/home/.msf4/token.yml.
[+] Token : foobared
[*] JSON-RPC starting on 127.0.0.1:55553 (NO SSL)...
[*] URI: /api/v1/json-rpc
[*] JSON-RPC server log: /data/data/com.termux/files/home/.msf4/logs/msf-json-rpc.log
[*] JSON-RPC server PID file: /data/data/com.termux/files/home/.msf4/msf-json-rpc.pid
[*] Start JSON-RPC server finish.
~/.msf4 $ redis-cli
127.0.0.1:6379> 
127.0.0.1:6379> auth foobared
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> exit
~/.msf4 $ redis-cli -p^C
~/.msf4 $ redis-cli -p 60004
127.0.0.1:60004> auth foobared
OK
127.0.0.1:60004> ping
PONG
127.0.0.1:60004> exit
~/.msf4 $ cat token.yml 
token: "foobared"
~/.msf4 $ cat redis.yml 
redis_username: "default"
redis_password: "foobared"
redis_sock: "/data/data/com.termux/files/usr/var/run/redis/redis-server.sock"
~/.msf4 $ 
~/metasploit-framework $ cat  /data/data/com.termux/files/home/.msf4/logs/msf-json-rpc.log
2022-04-17 20:52:07 +0800 Exiting!
2022-04-17 20:52:44 +0800 Writing PID to /data/data/com.termux/files/home/.msf4/msf-json-rpc.pid
~/viper $ cat CONFIG.py 
DEBUG = False
import yaml

def get_token():
    token = "foobared"
    try:
        with open('/data/data/com.termux/files/home/.msf4/token.yml', 'r', encoding='utf-8') as f:
            token = yaml.load(f.read(), Loader=yaml.Loader).get("token")
    except Exception as E:
        pass
    return token

JSON_RPC_IP = '127.0.0.1'
JSON_RPC_PORT = 55553
JSON_RPC_URL = "http://127.0.0.1:55553/api/v1/json-rpc"
RPC_TOKEN = get_token()
MSFDIR = "/data/data/com.termux/files/home/.msf4/"

REDIS_URL = "unix://default:foobared@/data/data/com.termux/files/usr/var/run/redis-server.sock?db="

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": f"{REDIS_URL}1",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
        }
    }
}

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": ["redis://default:foobared@127.0.0.1:6379/1"],
            "capacity": 5000,
            "expiry": 5,
        },
    },
}
MSFLOOTTRUE = "/data/data/com.termux/files/home/.msf4/loot"  # 为了调试

msfrpd -S 出现这个:

~/.msf4 $ msfrpcd -S
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
[*] Use old token in /data/data/com.termux/files/home/.msf4/token.yml.
[+] Token : foobared
[*] JSON-RPC starting on 127.0.0.1:55553 (SSL)...
[*] URI: /api/v1/json-rpc
[*] JSON-RPC server log: /data/data/com.termux/files/home/.msf4/logs/msf-json-rpc.log
[*] JSON-RPC server PID file: /data/data/com.termux/files/home/.msf4/msf-json-rpc.pid
[*] Start JSON-RPC server finish.
2022-04-17 20:55:11 +0800 Thin web server (v1.8.1 codename Infinite Smoothie)
2022-04-17 20:55:11 +0800 Maximum connections set to 1024
2022-04-17 20:55:11 +0800 Listening on 127.0.0.1:55553, CTRL+C to stop
2022-04-17 21:02:44 +0800 Exiting!
2022-04-17 21:03:36 +0800 Writing PID to /data/data/com.termux/files/home/.msf4/msf-json-rpc.pid
2096779623 commented 2 years ago

还是redis的密码问题,应该是CHANNEL_LAYERS这

除了MSFCONSOLE进不去别的都正常,部分木马不能生成(termux没有mingw) 为什么Android/meterpreter里的都是暂无数据? Screenshot_20220417-221037

Screenshot_20220417-220150 Screenshot_20220417-215905 Screenshot_20220417-220922

FunnyWolf commented 2 years ago

bared [] JSON-RPC starting on 127.0.0.1:55553 (SSL)... [] URI: /api/v1/json-r

android的载荷没有适配,现在只实现了创建监听