You probably want Ruby, because it's the native language for Metasploit, which is the de facto standard open source penetration testing framework. Ruby's going to give you:
- Metasploit's framework, opcode and shellcode databases
- Metasploit's Ruby lorcon bindings for raw 802.11 work.
- Metasploit's KARMA bindings for 802.11 clientside redirection.
- Libcurl and net/http for web tool writing.
- EventMachine for web proxy and fuzzing work (or RFuzz, which extends the well-known Mongrel webserver).
- Metasm for shellcode generation.
- Distorm for x86 disassembly.
- BinData for binary file format fuzzing.
Second place here goes to Python. There are more pentesting libraries available in Python than in Ruby (but not enough to offset Metasploit). Commercial tools tend to support Python as well --- if you're an Immunity CANVAS or CORE Impact customer, you want Python. Python gives you:
- Twisted for network access.
- PaiMei for program tracing and programmable debugging.
- CANVAS and Impact support.
- Dornseif's firewire libraries for remote debugging.
- Ready integration with WinDbg for remote Windows kernel debugging (there's still no good answer in Ruby for kernel debugging, which is why I still occasionally use Python).
- Peach Fuzzer and Sully for fuzzing.
- SpikeProxy for web penetration testing (also, OWASP Pantera).
Unsurprisingly, a lot of web work uses Java tools. The de facto standard web pentest tool is Burp Suite, which is a Java swing app. Both Ruby and Python have Java variants you can use to get access to tools like that. Also, both Ruby and Python offer:
- Direct integration with libpcap for raw packet work.
- OpenSSL bindings for crypto.
- IDA Pro extensions.
- Mature (or at least reasonable) C foreign function interfaces for API access.
- WxWindows for UI work, and decent web stacks for web UIs.
You're not going to go wrong with either language, though for mainstream pentest work, Metasploit probably edges out all the Python benefits, and at present, for x86 reversing work, Python's superior debugging interfaces edge out all the Ruby benefits.
Also: it's 2008. They're not "scripting languages". They're programming languages. ;)