Вот так попробовал
function get(iframe) {
  var doc=iframe.contentDocument;
  if (!doc && iframe.contentWindow) doc=iframe.contentWindow.document;
  if (!doc) doc=window.frames["frameId"].document;
  if (!doc) return false;
  if (doc.location=="about:blank") return false;
  return doc;
}
  var iframe = document.getElementById("frameId");
  if(!iframe && frames["frameId"]) iframe = frames["frameId"];
  
  var ifr = get(iframe);
  
  
document.write(ifr.getElementById('captcha_img').src);
//и так
document.write(ifr.images[0].src);
Тоже не выходит (