Bypass password and key input in webrepl
Posted: Sat Nov 23, 2019 10:05 am
Hi,
I would like to bypass webrepl password input.
By disabling password checking in webrepl.py
It works just fine, but it still needs to press enter.
What I am after is connected automatically after clicking the "connect" button in the browser.
What I've been looking for is likely to modify the extmod/modwebrepl.c, and recompile the firmware. But I am pretty noobs in C programming, so it would be great if someone pointed which line to modify. From what I've seen it should be enough by modifying somewhere along this line :
https://github.com/micropython/micropyt ... epl.c#L106
I would like to bypass webrepl password input.
By disabling password checking in webrepl.py
Code: Select all
def start(port=8266, password=None):
stop()
if password is None:
try:
import webrepl_cfg
#_webrepl.password(webrepl_cfg.PASS)
setup_conn(port, accept_conn)
print("Started webrepl in normal mode")
except:
print("WebREPL is not configured, run 'import webrepl_setup'")
else:
#_webrepl.password(password)
setup_conn(port, accept_conn)
print("Started webrepl in manual override mode")
What I am after is connected automatically after clicking the "connect" button in the browser.
What I've been looking for is likely to modify the extmod/modwebrepl.c, and recompile the firmware. But I am pretty noobs in C programming, so it would be great if someone pointed which line to modify. From what I've seen it should be enough by modifying somewhere along this line :
https://github.com/micropython/micropyt ... epl.c#L106
Code: Select all
STATIC mp_obj_t webrepl_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 1, 2, false);
mp_get_stream_raise(args[0], MP_STREAM_OP_READ | MP_STREAM_OP_WRITE | MP_STREAM_OP_IOCTL);
DEBUG_printf("sizeof(struct webrepl_file) = %lu\n", sizeof(struct webrepl_file));
mp_obj_webrepl_t *o = m_new_obj(mp_obj_webrepl_t);
o->base.type = type;
o->sock = args[0];
o->hdr_to_recv = sizeof(struct webrepl_file);
o->data_to_recv = 0;
o->state = STATE_PASSWD;
write_webrepl_str(args[0], SSTR(passwd_prompt));
return o;
}