The easiest is to use an AC current, just like a network analyzer.
You can use a switchable current sink of known value, or a resistor and a FET. Measure voltage with current on, then with current off, substract, divide by current, you get internal resistance. If you keep repeating this on/off cycle, this is equivalent to using an AC current.
An advantage of AC measurement is that you can use a capacitor to get rid of the DC, and only handle the small AC voltage. It also ignores any DC offset in the signal chain, from opamps etc. AC measurement is the most accurate method.
You can use something like this as an experiment:
simulate this circuit – Schematic created using CircuitLab
Here the voltage source on the left drives an AC signal through R1 and C1 into the battery. This is AC coupled via C1.
C2 extracts the AC voltage on the battery.
Knowing AC voltage V1, once you measure the AC voltage on "OUT", battery internal resistance is easily calculated, as it forms a resistive divider with R1.
You can do this with a soundcard, or with a function generator and a multimeter. Make sure you calibrate and verify your test rig by replacing the battery with a resistor of known value, which should be of the same order of magnitude than the expected resistance to be measured.