If you have not yet moved out, you are not entitled to a refund of your security deposit. Once you decide to move out, make written demand for an inspection and return of your deposit. If you have moved out and not received your deposit or an explanation, you might have to file a small claims action if more than 30 days have gone by. It will be your decision whether you are throwing good money after bad.
When a property is sold at a foreclosure sale, the new owner "inherits" the current tenants along with their security deposits. By law all tenants must be permitted to live out their current leases. Since you are in a month to month situation, the new owner could legally give you 30 days notice at any time for any reason (the old owner could have done the same). Atty. Goldstein is correct that if you are still living at the property you're not entitled to your security deposit. If the new owner gives you notice to move out, you can recover your security deposit from them.
This answer is intended as informational only, and does not constitute legal advice or form an attorney-client relationship between us.
One clarification to the prior answers: under the Protecting Tenants at Foreclosure Act, the new owner must give you at least 90 days notice before filing an eviction lawsuit against you. If you are current in your rent and you leave the property in good condition, the new owner must return your security deposit when you move out. If your property is governed by the Chicago Residential Landlord and Tenant Ordinance, you may be entitled to additional amounts as damages, as well as attorney's fees, if the new owner does not comply with the ordinance.
This answer does not constitute legal advice and does not create an attorney-client relationship. You should contact an attorney to discuss the particulars of your case.