I need to take my personal laptop to the workplace so I will be using their internet that only employees usually use. However, if the network I connected to was malicious, is my data only compromised if I am still connected to the malicious network or would it still be compromised even after I have disconnected and use my own personal WiFi?
Your question does not mention what you mean by "malicious network". I can give you a few examples.
- I try to create my own network and then allow people to connect to it. So now everyone connected to the internet via me is using me as a middle guy for traffic. That is the reason why they say you shouldn't use open network places.
- In the second case, if someone wants persistent access to your system, they will allow you to connect to their network and then push you to install something. Now that malicious software will give them access to your system or steal stuff from your systems.
I could offer a lot more but this should get you started.
If you were connected to a malicious network (aka, a network owned by a malicious actor) then if a payload or persistence point was loaded onto your system then yes, you could still be vulnerable.
The hardware MAC address for example, will not change when you connect to different networks and received a different dynamic IP, but a payload beacon on your device could always be sending out information if your device was compromised.