Example project to parse DNS headers in javascript.
Find a file
2018-09-17 16:52:10 -07:00
.gitignore Initial commit 2017-09-22 22:48:52 -07:00
data.dns.bin Removed the pcap headers from the data file and renamed it. 2017-09-27 16:48:40 -07:00
data.pcap Removed the pcap headers from the data file and renamed it. 2017-09-27 16:48:40 -07:00
data.udp.bin Removed the pcap headers from the data file and renamed it. 2017-09-27 16:48:40 -07:00
encoded Catpured packet and inserting into ArrayBuffer. 2017-09-23 17:51:04 -07:00
index.htm Done with basic parser. 2017-09-25 15:22:52 -07:00
index.js Removed unecessary global 2017-09-27 14:26:10 -07:00
package.json We need to deal with the tcpdump headers as well :eyeroll: 2017-09-25 11:06:36 -07:00
README.md Update readme. 2018-09-17 16:52:10 -07:00

DNS Header Parsing in javascript

Sample code parsing dns headers in javascript. I wrote this at the request of a potential employer during the interview process. Not really a usuable module, but this was specifically what they wanted to see.

ToDo

  • Import packet string into Arraybuffer
  • Parse the headers into a Javascript object
  • Test/Fix browser JS compatibility

To see the parsed result of the packet, clone the repo and :

npm install && npm start

To view in the browser, open index.html in your browser and look at the console output.

The raw packet that is parsed has also been saved as ./data.udp.bin, if you would like to look at it to parse it some other way.