Many engines have adjustable parameters, which allow to alter their playing style. If you mess around it a bit, you can create whole 'engine personalities'...
Here, for example, someone though it interesting to create a personality called, the Komodo Kinghunter. Apparently, it does exactly what you are looking for - plays aggressively and not necessarily optimally. Note that I have not tested it myself.
It's different for different engines (I remember most of these at least used to be configurable in stockfish) and graphical interfaces, but
some typical factors one can usually twiddle with (at worst by going to source code and recompiling) are:
Contempt Factor
The Contempt Factor reflects the estimated superiority/inferiority of the program over its opponent. The Contempt factor is assigned as draw score to avoid (early) draws against apparently weaker opponents, or to prefer draws versus stronger opponents otherwise.
Additionally, if the engine has high contempt for its opponent, it might engage in more attacking style.
Pawn structure
Pawn structure is a term used to describe the positions of all the pawns on the board, ignoring all other pieces. Pawn structure encompasses a broad range of ideas, from the general shape of the pawns (such as closed or open) to specific characteristics of individual pawns.
So here there's a wide range of things to change engines evaluations for - double pawns, passed pawns, general structure, exchanges etc.
Mobility
A factor for how much the engine will value the piece mobility - I suppose more mobility leads to more attacking and unpredictable positions.
Aggressiveness
Self-explanatory; allows to make the engine more or less aggressive.
Cowardice
Self-explanatory; allows to define how defensive towards its own king the program should be.
Source for quotes
EDIT: I was made aware (per Student T's comment), that the engine I initially posted below is not attractive at all and in fact a clone of Rybka. I guess it was too good to be true!
If you are reluctant to do all this fiddling yourself, here's an engine which (again, I have not tried it myself, so cannot substantiate these claims in any way):
Thanks to its finely tuned positional vision, Vitruvius shows a readiness to sacrifice a pawn or two, the exchange and sometimes even a whole piece, for purely positional compensation.
And named among its strengths:
Playing strength above the 3100ELOmark; Detects and exploits zugzwang positions; Very human and speculative approach to the game
Also of interest: this Vitruvius article
Unfortunately, it is not free.