Mishkat al-Masabih 4598
Ibn ‘Abbas reported God's messenger as saying:
“If anyone acquires any knowledge of astrology he acquires a branch of magic of which he gets more as long as he continues to do so.” 

Ahmad, Abu Dawud and Ibn Majah transmitted it.
عَنِ ابْنِ عَبَّاسٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنِ اقْتَبَسَ عِلْمًا مِنَ النُّجُومِ اقْتَبَسَ شُعْبَةً مِنَ السِّحْرِ زَادَ مَا زَادَ» . رَوَاهُ أَحْمَدُ وَأَبُو دَاوُدَ وَابْنُ مَاجَه