A brute-force attack is a method used to gain access to restricted information, accounts, or systems by using trial and error. It involves trying all possible combinations of characters until the correct one is found. Brute-force attacks are commonly used to crack passwords, find hidden files or uncover security flaws in websites and databases. To protect against this type of attack, websites should use strong authentication methods and regularly change their passwords.