Skip to content

Instantly share code, notes, and snippets.

@shekkbuilder
Last active December 29, 2017 02:09
Show Gist options
  • Save shekkbuilder/5675d6e7535c8a56c8e25f844868922a to your computer and use it in GitHub Desktop.
Save shekkbuilder/5675d6e7535c8a56c8e25f844868922a to your computer and use it in GitHub Desktop.
Create raw DNS -> www.cisco.com
#include <stdio.h>
//bsize=$(du -b ./data.dns|awk '{print $1}')
//hping3 -1 -p 53 -E ./data.dns -d ${bsize} 127.0.0.1 -jJ
main( )
{
FILE *fp;
fp=fopen("data.dns", "w");
fprintf(fp, "%c%c%c%c", 0x00, 0x01, 0x01, 0x00);
fprintf(fp, "%c%c%c%c", 0x00, 0x01, 0x00, 0x00);
fprintf(fp, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
fprintf(fp, "%c%s", 0x03, "www");
fprintf(fp, "%c%s", 0x05, "cisco");
fprintf(fp, "%c%s%c", 0x03, "com", 0x00);
fprintf(fp, "%c%c%c%c", 0x00, 0x01, 0x00, 0x01);
fclose(fp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment