The word hacker has both positive and negative connotations depending on who you talk to and in what context the person is using the word. There are also many levels of hackers, from script kiddies to elite hackers. Some countries actively engage in the act of attacking the computer systems of other countries; their purpose is to steal intellectual property and government secrets.
This brings us to another point: hackers are usually divided into three categories: white hat, gray hat, and black hat. The white hat hackers use their skills for good, while black hat hackers often do "bad things." The gray hat is somewhere in the middle. I do not encourage people to engage in illegal activity under any circumstances. On the other hand, sometimes testing a proof of concept in a virtual environment is necessary to "see how the other side operates." Learning how the bad guys do what they do will help us better understand security.
Like many other people in the industry, I have decided to use my skills to earn an honest living. However, even if you are an honest person, you can have fun doing some hacking as long as you are not engaging in illegal activity. My recommendation is for you to set up a test lab at home where you can practice these concepts and skills). You can then use these skills
...
From Defense against the Black Arts: How Hackers Do What They Do and How to Protect against It by Jesse Varsalone and Matthew McFadden. New York: Auerbach Publications, 2011.