Bathroom venting into attic

Hello homies! Is this proper venting? should the pipe connect directly to the black square opening? What is the black square thing called?