Selecting all objects that have been specified in Modifiers
Using the bl_rna.properties collection.  This gives the name, type and other properties of the properties of the modifier. If the property is an object it is most likely, both a PointerProperty (prop.type == 'POINTER') and points to a prop.fixed_type of bpy.types.Object.  If so getattr(modifier, propertyname) will be either the object if set, or None if not.
import bpy
context = bpy.context
obj = context.object
for m in obj.modifiers:
    print(&quot;modifier (%s): %s&quot; % (m.type, m.name))
    for k, v in m.bl_rna.properties.items():
        if v.type == 'POINTER' and v.fixed_type.name == &quot;Object&quot;:
            print(&quot;\t&quot;, k, getattr(m, k))
            # select mod obj if not None
            ob = getattr(m, k, None)
            if ob is not None:
                ob.select_set(True)