Lab/Exam Open VPN Connection Randomly Stopping

Dear eLearn Security

How come during labs or exam attempts. The open VPN connection gets turned off in random intervals of 3-5 or 12 hours. With the message of “would you like to keep the environment up?”. Every time is kills my connection and drops all my shells and setup. I have to waste time redoing everything up to this point in time. Instead of getting further in my exam or learning something new. How does a student fix this?

Thanks

You could inject this piece of JS code in order to automatically click yes if asked :sweat_smile:


function findButton(text,where=document){
    return Array.from(where.querySelectorAll('button')).find(el => { 
        return el.textContent.match(text)
    });
};

var target = document.querySelector('body');
console.log('observing body for ".title-bar__close-modal"')
var observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
        console.log('mutation observed, type, target, mutation',mutation.type,target,mutation);
        // if we find  yes button (still in the lab?)
        ntarget=findButton('Yes')
        if(ntarget!==undefined){
            console.log('ntarg',ntarget)
            ntarget.click()
            console.log('clicked yes')
        }
    });
});
observer.observe(target, { attributes: true, childList: false, characterData: false });

You could inject it via a chrome user script

1 Like

Thanks I will give it a go!