Skip to content

Commit 5c36d0e

Browse files
committed
FIX decryption fail with padding 01 #1 (bis)
forgot to check the last byte
1 parent 28ed1f6 commit 5c36d0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

exploit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def run(cipher,size_block,host,url,cookie,method,post,error):
142142

143143
break
144144
if found == False:
145-
# lets say padding is 01 for the last block (the padding block)
146-
if len(cipher_block)-1 == block:
145+
# lets say padding is 01 for the last byte of the last block (the padding block)
146+
if len(cipher_block)-1 == block and i == 0:
147147
value = re.findall('..',bk)
148148
valide_value.insert(0,"01")
149149
if args.verbose == True:

test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def run(cipher,size_block):
155155
break
156156
if found == False:
157157
# lets say padding is 01 for the last block (the padding block)
158-
if len(cipher_block)-1 == block:
158+
if len(cipher_block)-1 == block and i == 0:
159159
value = re.findall('..',bk)
160160
valide_value.insert(0,"01")
161161
if args.verbose == True:

0 commit comments

Comments
 (0)