I configured my Kali Linux Vm to run through the Whonix Gateway, however portscanning is not possible now as it shows that all ports are open, which is definitely not the case on my server. Is there a way to fix this? When googling I found out that it has something to to with Whonix' firewall, however I have not been able to find an answer on how to edit the firewall so that portscanning would work. Thanks in advance.
1 Answer
You should read about how nmap works and how iptables transproxying works or SOCKS proxying works and then realise that you will not be able to effectively nmap over a whonix gateway nor should you ever.
Nmap uses by default the "SYN Scan" technique, this means that it sends a TCP SYN packet to each of the ip:port pairs on the list, if it gets a SYN+ACK back from the destination, it considers the port open. (If it gets a RST then, conversely, it considers it 'closed' and if nothing ever comes back it considers it 'filtered').
Since a local SOCKS proxy is expected to accept a connection then "dial" the remote address, it's always "open" in the proxychain/torsocks case. And similarly transproxy will produce the same results results.
Port scanning over Tor is both harmful to the Tor network (its loud, obvious and generates a lot of "abuse" reports for exit operators to deal with) and ineffective. You should not do it, there are better methods for both you and the Tor network.
P.S. quit skiddin'
-
FWIW this is a duplicate of tor.stackexchange.com/questions/10136/… but since no one has upvoted it or accepted the answer I can't mark it as such, these questions should be merged once an answer is accepted or voted up. Commented May 23, 2016 at 0:55
-
But what I still don't understand is why does port scanning work over other ways of using the tor network, eg proxychains?– BrianCommented May 23, 2016 at 6:13
-
You could write your own which could work but it would be unusably slow, prone to false positives and false negatives and you'd still be a selfish cunt for pissing all over the commons. You can start by reading RFC 1928: ietf.org/rfc/rfc1928.txt and to understand why proxychains doesn't work, read their source code to see how it works. Commented May 23, 2016 at 20:55