Golfgal and HLS have made the most pertinent posts on here. In general most lease agreements do not permit your security deposit to be used to pay rent, first months, last months or otherwise. Using the security deposit in lieu of rent is permitted but does not absolve you of late fees or penalties. Similarly if the landlord has documentation or invoices proving that things need to be fixed then he can come after you for those liabilities. Again it all depends on the terminology of your lease agreement.
My only advice here would be to review your lease to the letter. If you plan on violating it in any way then I would suggest you consult an attorney prior to doing so. Your dilema is not an ethical one it all, it is very simply a matter of you choosing to violate the contract. If you pay your lease but do not get the security deposit back then you simply go to court to fight for it. If you choose not to pay rent then that is okay to. Whatever consequences follow from that will be up to the landlord and what the lease allows for with regards to penalties, late fees, etc and if the landlord has the energy to bring you to court.
This is not advice in any manner so please don’t construe it as such. Consult an attorney