Hamas' military wing has taken responsibility for rocket attacks that reached Ashdod and Netivot.