Affine cipher and plaintext attacks, how to find the base modulo?
Well, to start off with, we have:

$$k_1 m_1 + k_2 - n_1 p = c_1$$
$$k_1 m_2 + k_2 - n_2 p = c_2$$
$$k_1 m_3 + k_2 - n_3 p = c_3$$

Where we know $m_1, c_1, m_2, c_2, m_3, c_3$, and we don't know $k_1, k_2, p, n_1, n_2, n_3$.  I chose to use explicit unknown integers $n_1, n_2, n_3$, rather than modulo an unknown $p$, as it makes it easier to justify the operations we'll do.

The first step is to cancel out the $k_2$ unknown; if we take the first equation, and subtract the second equation, this gives us:

$$(k_1 m_1 + k_2 - n_1 p) - (k_1 m_2 + k_2 - n_2 p) = (c_1) - (c_2)$$

or

$$k_1(m_1 - m_2) - (n_1 - n_2)p = c_1 - c_2$$

Subtracting the second and the third equation gives us:

$$k_1(m_2 - m_3) - (n_2 - n_3)p = c_2 - c_3$$

The next step is to cancel out the $k_1$ unknown; to do this, we multiply the first equation by $(m_2 - m_3)$, multiply the second equation by $(m_1 - m_2)$, and then subtract the two.  Doing this (and performing algebraic simplification) results in:

$$((m_2 - m_3)(n_1 - n_2) - (m_1 - m_2)(n_2 - n_3))p =\\ (m_2 - m_3)(c_1 - c_2) - (m_1 - m_2)(c_2 - c_3)$$

Or, in other words, $p$ is a factor of $(m_2 - m_3)(c_1 - c_2) - (m_1 - m_2)(c_2 - c_3)$, which is composed entirely of known values (that is, we can compute it).

Hence, the solution is to compute that value, and if it nonzero, factor it, and go through the factors to search for plausible values of $p$.