Oros42 / IMSI-catcher

This program show you IMSI numbers of cellphones around you.
Creative Commons Zero v1.0 Universal
3.09k stars 716 forks source link

Problem with "Address already in use". #100

Closed JNS456123 closed 4 years ago

JNS456123 commented 4 years ago

I have been running into a problem running the script.

First terminal command: python3 simple_IMSI-catcher.py Second terminal command: grgsm_livemon -f 869.2M If I run the first terminal first, then start the command in the second, the second terminal errors out as follows:

pi@raspberrypi:~ $ grgsm_livemon -f 869.2M qt5ct: using qt5ct plugin gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.13.4 built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp [INFO] [UHD] linux; GNU C++ version 8.2.0; Boost_106700; UHD_3.13.1.0-3

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory.

[ERROR] SoapySSDPEndpoint::sendTo(udp://[ff02::c]:1900) = -1 sendto(udp://[ff02::c]:1900) [99: Cannot assign requested address] [INFO] bladerf_open_with_devinfo() [INFO] bladerf_get_serial() = dc38c451ddaf486891824d92fd10017a [INFO] setSampleRate(Rx, 0, 4.000000 MHz), actual = 4.000000 MHz [INFO] setSampleRate(Tx, 0, 4.000000 MHz), actual = 4.000000 MHz [INFO] setSampleRate(Rx, 0, 2.000000 MHz), actual = 2.000000 MHz Traceback (most recent call last): File "/usr/bin/grgsm_livemon", line 361, in main() File "/usr/bin/grgsm_livemon", line 349, in main tb = top_block_cls(args=options.args, collector=options.collector, collectorport=options.collectorport, fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, serverport=options.serverport, shiftoff=options.shiftoff) File "/usr/bin/grgsm_livemon", line 180, in init self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", '127.0.0.1', serverport, 10000, False) File "/usr/lib/python2.7/dist-packages/gnuradio/blocks/blocks_swig5.py", line 1063, in make return _blocks_swig5.socket_pdu_make(type, addr, port, MTU, tcp_no_delay) RuntimeError: bind: Address already in use pi@raspberrypi:~ $

However, if I run the command in the second terminal first , then run the command in the first, the first terminal errors out with:

pi@raspberrypi:~/IMSI-catcher $ python3 simple_IMSI-catcher.py Nb IMSI ; TMSI-1 ; TMSI-2 ; IMSI ; country ; brand ; operator ; MCC ; MNC ; LAC ; CellId ; Timestamp Traceback (most recent call last): File "simple_IMSI-catcher.py", line 553, in udpserver(port=options.port, prn=find_imsi) File "simple_IMSI-catcher.py", line 502, in udpserver sock.bind(server_address) OSError: [Errno 98] Address already in use pi@raspberrypi:~/IMSI-catcher $

It looks like something is trying to open the same UDP port in each of these two scripts. I've done a git pull to get the latest version.

Please note the strikeout script is being added automatically by the editor, so that strikeout should be ignored.

What do I need to do to get this working?

Platform Raspberry Pi 4, running Raspbian GNU/Linux 10 (buster)

JNS456123 commented 4 years ago

I think I found the problem: You need to run the script as:

sudo python simple_IMSI-catcher.py --sniff