terrycorley / opendlp

Automatically exported from code.google.com/p/opendlp
0 stars 0 forks source link

How to connect to MSSQL on non-default port #100

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I need to scan a SQL Server that is configure to listen on a non-Default port. 
When I try to enter the port number in the server list I get an error that 
there is an invalid character. 

So I need to enter something like this. Servername<\instance>, <port>

I am using 0.4.4 on Ubuntu 

Original issue reported on code.google.com by brent.wi...@gmail.com on 23 Oct 2013 at 8:14

GoogleCodeExporter commented 9 years ago
You will currently have to add an iptables rule to do this. It will probably be 
something like this (I haven't tested this, YMMV):

iptables -t nat -A PREROUTING -p tcp --dport 1433 -j DNAT --to-destination 
1.2.3.4:51433
iptables -t nat -A POSTROUTING -j MASQUERADE

Where "1.2.3.4" is the target system and "51433" is the target port. You'll 
then run a MSSQL scan on 127.0.0.1.

If iptables doesn't work for you, you can try the same thing with netcat:

nc -l -p 1433 -c "nc 1.2.3.4 51433"

Original comment by andrew.O...@gmail.com on 23 Oct 2013 at 8:20

GoogleCodeExporter commented 9 years ago

Original comment by andrew.O...@gmail.com on 23 Oct 2013 at 8:20

GoogleCodeExporter commented 9 years ago
Thanks for the info I will test it out and let you know how it turns out. One 
question: I have never used iptables and I need to scan several servers not on 
the default port, can I add an IP (or Server name) to the prerouting command 
for each server I need to scan or will I need to update this between each scan?

Original comment by brent.wi...@gmail.com on 23 Oct 2013 at 9:23

GoogleCodeExporter commented 9 years ago
With the port redirection option, you can only scan one system at a time.

Did you try to specify hosts like this: 1.2.3.4:51433

Original comment by andrew.O...@gmail.com on 24 Oct 2013 at 1:36