main
Brett 2023-10-25 17:02:04 -04:00
parent 841597d46f
commit bba6e37b05
4 changed files with 14 additions and 4 deletions

Binary file not shown.

View File

@ -31,3 +31,5 @@
2935 3019 1698265309752227101 insane_dns ff5ae500893d0be1
2 3015 1698266342759371787 CMakeFiles/insane_dns.dir/src/main.cpp.o 727da43cdbc82421
3015 3112 1698266342859370576 insane_dns ff5ae500893d0be1
3 2850 1698267381088345489 CMakeFiles/insane_dns.dir/src/main.cpp.o 727da43cdbc82421
2850 2933 1698267381176344149 insane_dns ff5ae500893d0be1

View File

@ -1,3 +1,3 @@
Start testing: Oct 25 16:39 EDT
Start testing: Oct 25 16:56 EDT
----------------------------------------------------------
End testing: Oct 25 16:39 EDT
End testing: Oct 25 16:56 EDT

View File

@ -1,5 +1,7 @@
/**
*
* Brett Terpstra 6920201
* Michael Boulos 6973523
* Adrian Pinu 6970677
*/
#include <iostream>
@ -26,6 +28,12 @@ static constexpr bool STRICT_MATCHING = false;
// true -> only match A records ; false -> match any named record (A, AAAA, CNAME)
static constexpr bool STRICT_FILTERING = false;
// DNS server to use for forwarding to / resolving DNS requests
static inline constexpr std::string DNS_SERVER_IP()
{
return "8.8.8.8";
}
// replacement IP address. Make sure this is a 4 octet string seperated by .
static inline constexpr IPAddress REPLACEMENT_IP()
{
@ -330,7 +338,7 @@ int main()
// forward to google.
size_t out_bytes;
sendUDPMessage("8.8.8.8", recv_buf.data(), bytes, mod_recv_buf, out_bytes);
sendUDPMessage(DNS_SERVER_IP(), recv_buf.data(), bytes, mod_recv_buf, out_bytes);
uint16_t num_of_answers;
blt::mem::fromBytes(&mod_recv_buf[6], num_of_answers);