Skip to content

Commit 64b9ab2

Browse files
Ignore first PADI.
1 parent 69522af commit 64b9ab2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pppwn.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,18 @@ def ipcp_negotiation(self):
259259
id=pkt[PPP_IPCP].id,
260260
options=pkt[PPP_IPCP].options))
261261

262-
def ppp_negotation(self, cb=None, ignore_initial_reqs=False):
263-
num_reqs_to_ignore = 6 # Ignore initial requests in order to increase the chances of the exploit to work
264-
# Tested from 6 to 8 requests, on version 10.50 - all give best results then not ignoring
265-
num_ignored_reqs = 0
262+
def ppp_negotation(self, cb=None, ignore_initial_req=False):
263+
if ignore_initial_req:
264+
print('[*] Waiting for PADI...')
265+
while True:
266+
pkt = self.s.recv()
267+
if pkt and pkt.haslayer(
268+
PPPoED) and pkt[PPPoED].code == PPPOE_CODE_PADI:
269+
break
270+
266271
print('[*] Waiting for PADI...')
267272
while True:
268273
pkt = self.s.recv()
269-
if ignore_initial_reqs and (num_ignored_reqs < num_reqs_to_ignore):
270-
print('[*] Ignoring initial PS4 PPoE request #{}..'.format(num_ignored_reqs+1))
271-
num_ignored_reqs+=1
272-
continue
273274
if pkt and pkt.haslayer(
274275
PPPoED) and pkt[PPPoED].code == PPPOE_CODE_PADI:
275276
break

0 commit comments

Comments
 (0)