- There are only 30 primes in the random pool in which p and q was chosen, so there're a maximum of 465
p*q
pairs. What's more,p != q
, so the number drops down to 435. - As the number is small, we can put nc in a loop to continously get
p*q
pairs until we have the required unique pairs:
while true; do nc vuln2014.picoctf.com 51818 | tail -n 1 >> keys.txt; done