Creating a procedural worm texture
Maybe not exactly the same, but closer to what you're trying to achieve are the following two node setups. The basic idea in both cases is the same. Try to achieve a similar look with combinations of the default procedural textures, and then use either a colorRamp node or a math node set to 'GREATER THAN' to filter the texture.

Using the colorRamp node, the Musgrave Texture will already be enough as an input. Take a closer look at the ColorRamp node. I pulled the white and the black values very close together. What this means effectively is that all pixel values coming into this node, which are below something like 0.6, will be converted to pure black. everything above something like 0.7 will be converted to pure white. The rest becomes greyscales. Basically, this is a bit like an extreme brightness/contrast correction.



Greather than (this is an option in the math node) is only able to output values of 0 or 1, so black or white, nothing inbetween. For your example, this seems to work, but for others there might be too much aliasing in the image. The texture I tried to build using two distorted wave textures overlaid over each other. I just added it so it becomes more clear that you can also stack procedurals, combine them using pixel math, and then again filter the output. The result is less of what you wanted, but the idea might take you further from here: