The key to drilling near an electrical socket is knowing exactly where the electrical wiring is located inside the wall. Using a electronic stud finder that has a built-in wire-detection mode is a great way to identify the specific location of the wires hidden behind the wall. This will allow you to mark on the wall the location of wires, giving you a visual representation of where it is safe to drill.
Check your circuit breaker to ensure that power is being supplied to the outlets that will be drilled around.
Turn the electronic stud finder on, and, depending the model, make sure the selector switch is pointed to wire-detection mode.
Start on the left side of the outlet and hold the stud finder against the wall, slowly moving it in a left-to-right pattern. Each time the light indicates a wire, mark that exact position on the wall. Repeat this process as you work your way completely around the outlet in a 12-inch diameter, marking each location of wires. When complete, you should have a pattern marked on the wall where each wire is running.
Turn the power off at the main circuit breaker panel which supplies the outlet that will be drilled next to.
Position the drill bit on the wall so that it is clear of the marked patterns of the wiring, and as close to the outlet as possible. Drill through the wall, repeating this step to drill as many holes as needed for the project.
Turn the power back on once the necessary holes have been drilled and the project is complete.
You could also use a tone generator, available at your local hardware store, to plug into the outlet and determine where the wires are located based on the tone generated by the equipment.
Avoid drilling too close to electrical lines even with the wire locations marked on the wall. Always turn the power off, as failure to do so could result in accidental electrocution.