Code:
for each $folder in dirplus("%appdata%\Mozilla\Firefox\Profiles\","/ad")
  if right($folder,8)=".default"
    ;do stuff
  endif
next


You will need dirplus to make this work

DirPlus -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82153

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1