A tool to manipulate web pages on behalf of the visitor being on the same network as this server.
You can use the InternetHacker class to quickly setup the tool.
InternetHacker.create()
.useDns(new DnsCombinedHacker("google.com", "example.com"))
.start();
The default pom.xml
file puts the main class to com.gianlu.internethacker.Main
. The code above should be placed in a file called Main.java
inside src/com/gianlu/internethacker/
like so:
package com.gianlu.internethacker;
import com.gianlu.internethacker.hackers.DnsCombinedHacker;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
InternetHacker.create()
.useDns(new DnsCombinedHacker("google.com", "example.com"))
.start();
}
}
Using the DNS server by itself isn't very useful as the Host
header will tell the truth about what we're doing and the server may refuse to respond.
Anyway, here's a checklist of things to do to set it up:
- Set the DNS server as system or router default and make sure the changes are applied (restart everything to be sure)
- Check that the server is working by using
dig
ornslookup
- Clear the DNS cache of your system
- You're ready
In the feature, a more effective solution will be to use the DNS and proxy servers in combination: the DNS server will point to the proxy which will effectively do the changes.
The DnsModule setup a DNS server on port 53 which, through the help of some DnsHacker, will fake DNS requests. Some pre-made DNS hackers are available:
- DnsAddressHacker will change A and AAAA records
- DnsCNameHacker will change CNAME records
- DnsCombinedHacker will change A, AAAA and CNAME records
The ProxyModule setup a proxy server on the given port which, through the help of some ProxyHacker, will manipulate the data being transferred in between. Some pre-made proxy hackers are available:
- ProxyHttpUrlSwapHacker will swap the request URL without any redirect. ATM, matching the URL is a bit tricky.