Here was my original logic for how many cuboids can be drawn in a cube.
We need the number of possible cuboid sizes, the number of orientations of each size and the number of positions each cuboid of such size and orientation can take. Then we need to put that in a compact form. Note also that the total number of cuboids includes all the possible cubes as well but it is trivial to subtract those out if you wanted to know only how many non-cubes there were. In this case, they are included because they are also cuboids.
First, the number of possible sizes. For an ##n##x##n##x##n## cube, this is ##n^3##. So, there are ##n^3## possible sizes which include both the size and all orientations of each size. The list is just all the permutations of a set ##(i,j,k)## where each integer ranges from 1 to ##n##. But how do we figure out how many of each size exists? We consider how many degrees of freedom in each direction each size has by noticing that the number of positions each box has is related to the length in each direction. For example, if the length is equal to n along some direction, there is only one position it can take in that direction so we can call the degree of freedom 1. If the length is ##n - 1## there are 2 positions so the freedom is 2. The degree of freedom is always ##n+1 - length## in a given direction. For example, for a 4x4x4 cube with a certain cuboid of length 2 units in the ##x## direction, the degrees of freedom in the ##x## direction is 4+1-2=3. There are 3 positions it can take along the ##x## axis. The number of cuboids of a certain size and orientation is given by the product of it's degrees of freedom. For example, in the previous cube of edge length 4, a cuboid of size {2,2,3} has degrees of freedom of {3,3,2} thus 3x3x2=18 cuboids of that size and orientation. There will also be 18 for each orientation. (Note that the number of orientations of a given size depends on whether there are 1, 2or 3 planes with square faces. For 3 it's a cube and there is only 1 orientation. For 2 there are 3 orientations and for 1 there are 6 orientations.)Next we notice that the list of degrees of freedom is just the list of sizes upside down. We can just save a step and multiply the list of sizes out. Now all we have to do is add them all up.
Thus the products of all possible sizes is;
##\left(\sum_{k=1}^n k \right)## x##\left(\sum_{k=1}^n k \right)## x##\left(\sum_{k=1}^n k \right)## =##\left(\sum_{k=1}^n k \right)^3##
This is in contrast to sum of ##\ \sum_{k=1}^n k^3 \ ## for the number of cubes with a cube.
We further note that ##\ \sum_{k=1}^n k \ ## can be expressed in closed form as;
$$\ \sum_{k=1}^n k \ = n(n+1)/2$$ (which happens to also be the number of integer line segments in a line of length ##n##)
giving our final formula for the total number of cuboids in a cube as; $$\left(\sum_{k=1}^n k \right)^3 = (n(n+1)/2)^3$$ in contrast to the number of cubes in a cube as; $$\ \sum_{k=1}^n k^3 \ = (n(n+1)/2)^2$$
Similarly, the number of squares in a square is; $$\ \sum_{k=1}^n k^2 \ = n(n+1)(2n+1)/6$$ while the number of rectangles in a square is; $$\left(\sum_{k=1}^n k \right)^2 = (n(n+1)/2)^2$$
Likewise, extending these to the forth dimension, the number of hypercuboids in a hypercube is;
$$\left(\sum_{k=1}^n k \right)^4 = (n(n+1)/2)^4$$ in contrast to the number of hypercubes in a hypercube as
@andrewkirk pointed out goes as; ##\ \sum_{k=1}^n k^d \ ##
which in this case for ##d=4## is; $$\ \sum_{k=1}^n k^4 \ = (n(n+1)(2n+1)(3n^2 +3n -1)/30)$$