Al-jawab billahi at-taufeeq (the answer with Allah’s guidance)
To masterbate whether in Ramdhan or other months is Haraam and sinful. The sin being greater in Ramadhan.
Also, to masturbate will break one’s fast. To make up for it, all you will have to do is make Qadha of that day. Kaffara is not necessary. (Imdaadul Fattah Pg.691/ Hashiyatut Tahtawi Pg. 664)
One should also make Taubah too.
Allaah Ta’ala says : “Say: ‘O My slaves who have transgressed against themselves (by committing evil deeds and sins! Despair not of the mercy of Allaah; verily, Allaah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful’. [39:53].
And Only Allah Ta’ala Knows Best.
Moulana Qamruz Zaman