http://en.wikipedia.org/wiki/Marrette
this will answer all your questions.
There should be no joints like that inside the breaker panel. I'm pretty sure the NEC, or in my case the Canadian Electrical Code prohibits having any wire nuts/marrettes in it. Any such joints should be done outside the breaker panel in it's own junction box.
Turn the circuit breaker to the off position. Then unhook the wire that you need. Those end caps are called marrettes. If you a really sketched out about doing this then you should go to library and find out how to do it. There is no danger of getting electrocuted, but there is a fire hazard associated with improperly installed fixtures! Also, it begs the question, was the wire there for a previously installed fixture or are you going to steal the wire that's being used to power something in the attic?
There are 6 basic household wiring tools. These are a multi-blade screwdriver containing at least small and large flat blades , a #2 (or medium Philips ) and (in north America)a #1 and #2 Robertson . Next is a pair of electricians 6" flatnose pliers with a wirecutter, a pair of 4" long-nose pliers, and a multi wire stripper. - Finally a meter of some kind. - I personally prefer a multimeter with a 'clamp-on' ammeter device. -There are smaller simpler meters around $18-20 to buy. You should ALWAYS check that power is OFF at any area you're working. This is especially important when replacing switches and wall outlets, where you may touch a contact and get a shock. (You can use a two wire diode to detect electrical power and many do, - personally as a trained electrician I'm not in favor of these and find them unreliable ) It's always handy to have half a dozen Marrettes (wire nuts)in your pocket in case you need them.The most important tool is your brain and commonsense - be careful, check power, don't trust others saying "it's off" - check personally with your meter.Never work where water is all around especially if you have to stand in it !- THINK and be safe -