func unnatended(t []*keys.RSA) []error {
	var errs []error
	for _, a := range attacks.SupportedAttacks.Supported {
		if a.Unnatended {
			if err := attacks.SupportedAttacks.Execute(a.Name, t); err != nil {
				errs = append(errs, err)
			}
			for _, k := range t {
				if k.Key.D != nil {
					if k.Verbose {
						logger.Printf("key factored with attack: %v\n", a.Name)
					}
					return nil
				}
			}
		}
	}
	return errs
}
unnatended will run all supported attacks against t that are listed as working in unnatended mode.
package main
import (
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strings"
	"github.com/sourcekris/goRsaTool/attacks"
	"github.com/sourcekris/goRsaTool/attacks/jwtmodulus"
	"github.com/sourcekris/goRsaTool/attacks/signatures"
	"github.com/sourcekris/goRsaTool/keys"
	"github.com/sourcekris/goRsaTool/utils"
	fmp "github.com/sourcekris/goflint"
)
var (
	fset           = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
	keyFile        = fset.String("key", "", "The filename of the RSA key to attack or dump")
	pastPrimesFile = fset.String("pastprimes", "pastctfprimes.txt", "The filename of a file containing past CTF prime numbers.")
	verboseMode    = fset.Bool("verbose", false, "Enable verbose output.")
	dumpKeyMode    = fset.Bool("dumpkey", false, "Just dump the RSA integers from a key - n,e,d,p,q.")
	createKeyMode  = fset.Bool("createkey", false, "Create a public key given an E and N.")
	exponentArg    = fset.String("e", "", "The exponent value - for use with createkey flag.")
	modulusArg     = fset.String("n", "", "The modulus value - for use with createkey flag.")
	primeArg       = fset.String("p", "", "One of the primes. If provided will shortcut the attack phase and produce a private key.")
	dArg           = fset.String("d", "", "Give d in createkey mode to create a private key.")
	d0Arg          = fset.String("d0", "", "Give LSBs of d, used in partiald attacks.")
	cipherText     = fset.String("ciphertext", "", "An RSA encrypted binary file to decrypt, necessary for certain attacks.")
	numP           = fset.Int("numprimes", 2, "Number of primes expected to be factored.")
	keyList        = fset.String("keylist", "", "Comma seperated list of keys for multi-key attacks.")
	ctList         = fset.String("ctlist", "", "Comma seperated list of ciphertext binaries for multi-key attacks.")
	ptList         = fset.String("ptlist", "", "Comma sepereated list of plaintext files for use in signature mode.")
	sigList        = fset.String("siglist", "", "Comma seperated list of signatures files.")
	jwtList        = fset.String("jwtlist", "", "Comma seperated list of files containing JWTs.")
	attack         = fset.String("attack", "all", "Specific attack to try. Specify \"all\" for everything that works unnatended.")
	list           = fset.Bool("list", false, "List the attacks supported by the attack flag.")
	logger         *log.Logger
)