Example project to parse DNS headers in javascript.
John Shaver 1a0fbd3f9d Update readme. 4 months ago
.gitignore Initial commit 1 year ago
README.md Update readme. 4 months ago
data.dns.bin Removed the pcap headers from the data file and renamed it. 1 year ago
data.pcap Removed the pcap headers from the data file and renamed it. 1 year ago
data.udp.bin Removed the pcap headers from the data file and renamed it. 1 year ago
encoded Catpured packet and inserting into ArrayBuffer. 1 year ago
index.htm Done with basic parser. 1 year ago
index.js Removed unecessary global 1 year ago
package.json We need to deal with the tcpdump headers as well :eyeroll: 1 year ago

README.md

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.