Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
what would happen if port 22 and 23 are opened
It mainly depends on what is listening on that ports.
However, just having the ports open mean that an attacker can interact with the TCP/IP stack of your machine.