Temporary Ruleset for Parental Controls with SSH or API?

Bonus!

If you need to authenticate using a shell from a remote system without bothering to go to the web login interface, just issue this one-liner:


h=$(echo -n ftp:'$1$BFFWqh5G$9sUDYjMMdcUabCmegmU/B0':$(curl -s -k  -H 'Content-Type: application/json;charset=utf-8' -d '{"jsonrpc": "2.0", "id": 1, "method": "challenge", "params": {"username": "ftp"}}' 'https://192.168.8.1/rpc'|cut -d '"' -f18) |md5sum|cut -d' ' -f1) && curl -s -k -H 'Content-Type: application/json;charset=utf-8' -d '{"jsonrpc": "2.0", "id": 1, "method": "login", "params": {"username": "ftp", "hash":"'$h'"}}' 'https://192.168.8.1/rpc'
{"id":1,"jsonrpc":"2.0","result":{"username":"ftp","sid":"zcRdYgOpVMTtSFb2s5iq0KSxuio60WcU"}}

Let's say you want to use your iPhone's iSH app to authenticate, you can just replace all ftp instances with root, and also replace the ($1$6QuFeZMO$bCvyRzqC0a0jFnoz9p0cR/) string with the root's one (can be found in sahdow file). Now when invoking it, it will get you authenticated, and you will receive a valid SID to be used with other curl commands from the remote system!

1 Like