the linux kernel does not
do deep packet inspection (examination of the payload), but it does necessarily check packet headers for illegal formations, and generally just silently discards such packets (logging them creates its own security problems, such as logging floods). I'm unaware of any log settings within the network stack. There may
be a way to turn some logging on for these events but you might have to edit the source and rebuild the kernel to do this.
As far as I know there's nothing out of the box that will do specifically what you want, especially as "attacks" are not categorized as such by the kernel or even by iptables. In general network packets are either well-formed and allowed or malformed and quietly discarded.
iptables has some logging features that will allow you to record some types of activity. you could implement it along the lines of:
iptables --state ESTABLISHED -j ALLOW # this allows pkts from established sessions
iptables -j LOG # this logs anything that wasn't deemed 'established' like NEW tcp sessions or stray FIN pkts
(don't use these verbatim - I've left out a lot of details that will be specific to your situation.)