かく (はじを)
かく (はじを) · kaku (hajiwo) · JLPT N1 · noun
to humiliate oneself
かく (掻く) = to scratch; 恥を掻く = to scrape up shame, to be humiliated, as if you dig embarrassment out of yourself
はじ (恥) is shame and を marks it as the object of かく. Literally you 'scratch/draw up' shame, so the idiom means to humiliate oneself.