I finally found out how do do this, so on the version of macos i am running on(the lastest) raw socket's are EXTREMELY restricted, and so i cannot use raw sockets for my program, and after a bit of research, I found out how nmap bypasses these restrictions: It goes to the Data-Link layer(this may make the program better for multiple platforms without modifying much of the code), thats were the custom packets are injected, so as I am using python, i should use a library like pcapy.
Thank you very much for your answers!