I’ve been using nmap for close to ten years.
Recently, after installing the latest beta version, I decided to read the docs.
I was quite surprised to find that proxy-detecting code (both http and SOCKS) was available. Then I was somewhat disappointed that the method used was a bizarre scripting language nobody uses (Lua).
And when I finally tested the code out, I was incredibly unimpressed, especially with the SOCKS code. It does nothing more than request an http from Google (terribly unoriginal).
I have an issue with that.
The reason I started looking at SOCKS proxies in the first place was that I discovered the vast majority of open port 1080 SOCKS proxies were improperly configured Microsoft ISA 2004/2006 (now known as Forefront TMG) boxes. That in itself is not unusual, as there are thousands of server room Trevors and study-at-home MCSE wannabees who have no clue what they’re doing.
The issue with SOCKS and ISA is that Microsoft despises SOCKS. And due the the architecture of ISA server (since the 2004 version), is that ISA SOCKS can’t do any Web protocols (http, https, ftp) if you have the ISA Web proxy service enabled. So, requesting a Web page is bound to fail 99% of the time, making the Google Web page test an Instant FAIL. However, they fail distinctively, and the nmap SOCKS script fails to realize that.
True, ISA servers are not the only SOCKS servers on the Web, but they’re the lowest of the low-hanging fruit. They do have one major advantage: ISA servers do not log SOCKS traffic.
That’s pure, unadulterated anonymity, boys and girls!
The hard part, after finding an ISA SOCKS server open to the outside world, is to find a usable, non-Web port you can use. For that you have to get creative with a stable, public, SOCKS judge, which is something I have personally failed miserably at over the last two years of this project.
However, I am working on the SOCKS judge part. The best port to check is undoubtedly TCP 1935 (Flash server). There are thousands of them, all public. Ssh (TCP 22) is a good one as well. It’s easier to identify (the initial ssh handshake is 100% clear text), but much harder to find and generally better protected. TCP 53 (DNS zone transfer) probably has some good possibilities, but might raise too many red flags (still, it’s the SOCKS server owner’s problem – not yours). If and when the usual Web protocols (80, 443, 21) work, that’s just fine, but using SOCKS for Web browsing is a complete waste of a valuable resource.
I’ve only lightly browsed the nmap Lua SOCKS script but I’m certain I could adapt it to these methods.
Meanwhile, nmap has added some other useful techniques that I missed over the last few revisions. Notably, it can generate random IP addresses for scanning. Nice feature, although that’s not what I do, since I am loathe to violate my ISP’s EULA.
Much.