For the S7-300 family that uses external MMC cards (most 31xC CPUs), the password can sometimes be bypassed via direct card reading.
For a step-by-step visual on resetting a forgotten password by overwriting the program via an MMC card, check out this tutorial: unlock s7300 plc password work
This method deletes the online program. Do not use this if the only copy of the code is inside the PLC. Method 2: Extracting Passwords from the SDB For the S7-300 family that uses external MMC
How to Unlock S7300 PLC Passwords: A Comprehensive Guide The SIMATIC S7-300 is a workhorse of the industrial automation world. However, lost passwords can bring maintenance to a screeching halt. Whether you are dealing with a "Know-How Protect" block or a system-level access password, here is how you can regain control of your S7-300 PLC. Understanding S7-300 Password Types Method 2: Extracting Passwords from the SDB How