Here's a naive and probably not very optimized way to play graphics for the triple assembly of a set of cantors :
cantorRule = Line[{{a_, n_}, {b_, n_}}] :> With[{d = b - a, np = n - .1}, {Line[{{a, np}, {a + d/3, np}}], Line[{{b - d/3, np}, {b, np}}]}] Graphics[{CapForm["Butt"], Thickness[.05], Flatten@NestList [

To make Cantor dust using the same replacement rules, we take the result at a certain level, for example. 4:
dust4=Flatten@Nest [
and take tuples from it
dust4 = Transpose /@ Tuples[dust4, 2];
Then we just build the rectangles
Graphics[Rectangle @@@ dust4]

Edit: Cantor dust + squares
Changed specifications → New, but similar, solution (still not optimized).
Set n as a positive integer and select any subset 1, ..., n, then
n = 3; choice = {1, 3}; CanDChoice = c:CanD[__]/;Length[c]===n :> CanD[c[[choice]]]; splitRange = {a_, b_} :> With[{d = (b - a + 0.)/n}, CanD@ @NestList[

Here are the graphics for
n = 7; choice = {1, 2, 4, 6, 7}; dust = NestList[
and everything else:
