This is usually known as dirtmap, cavity map or AO map and is unfotunately not available in Cycles. There is a workaround with the pointines attribute in the Geometry node which works halfways decently but it is not as good as the possibilities you might know from other 3d programs. Here is a thread on stackexchange that shows the workaround: