4. Three consecutive positive integers, with the middle one being a perfect square, the product of such three consecutive positive integers is called a "wonderful number". Then the greatest common divisor of all wonderful numbers less than 2017 is $\qquad$ .
4. 60.

It is known that $60=3 \times 4 \times 5$ is a beautiful number. Therefore, the greatest common divisor (GCD) of beautiful numbers cannot be greater than 60.

From any three consecutive positive integers, there must be one that is divisible by 3, so any beautiful number must have a factor of 3.

If the middle number is even and also a perfect square, it must be divisible by 4; if the middle number is odd, then the first and third numbers are even, so any beautiful number must have a factor of 4.

Additionally, the last digit of a perfect square can only be 1, 4, 5, 6, 9, or 0. If the last digit of the middle number is 5 or 0, it must be divisible by 5; if the last digit of the middle number is 1 or 6, the first number must be divisible by 5; if the last digit of the middle number is 4 or 9, the third number must be divisible by 5. Therefore, any beautiful number must have a factor of 5.

Thus, beautiful numbers must have factors of $3, 4, 5$, which means they have a factor of 60, i.e., the GCD of all beautiful numbers is at least 60.

In summary, the GCD of all beautiful numbers less than 2017 is 60.