From c5ebac1c91d8f2d9d414324045a452e1e48927aa Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Sep 2018 15:02:48 +0200 Subject: [PATCH 01/88] commit --- cells_1537879258.json | 11 + cells_1537879363.json | 11 + cells_1537879796.json | 11 + cells_1537880475.json | 323 ++++++++++++++++++++++++ cells_1537880525.json | 248 ++++++++++++++++++ core/__init__.pyc | Bin 0 -> 119 bytes core/mKB.pyc | Bin 0 -> 1245 bytes core/mLog.pyc | Bin 0 -> 1493 bytes engines/__init__.pyc | Bin 0 -> 122 bytes engines/android/__init__.pyc | Bin 0 -> 130 bytes engines/android/generic/ADBshell.pyc | Bin 0 -> 9065 bytes engines/android/generic/__init__.pyc | Bin 0 -> 138 bytes engines/android/samsung/ServiceMode.py | 5 +- engines/android/samsung/ServiceMode.pyc | Bin 0 -> 7210 bytes engines/android/samsung/__init__.pyc | Bin 0 -> 138 bytes engines/host/__init__.pyc | Bin 0 -> 127 bytes engines/host/diag/__init__.pyc | Bin 0 -> 132 bytes engines/host/diag/xgoldmod.pyc | Bin 0 -> 1557 bytes engines/host/serial/AT.pyc | Bin 0 -> 2677 bytes engines/host/serial/__init__.pyc | Bin 0 -> 134 bytes utils/__init__.pyc | Bin 0 -> 120 bytes utils/colors.pyc | Bin 0 -> 698 bytes utils/logprocess.pyc | Bin 0 -> 5575 bytes 23 files changed, 608 insertions(+), 1 deletion(-) create mode 100644 cells_1537879258.json create mode 100644 cells_1537879363.json create mode 100644 cells_1537879796.json create mode 100644 cells_1537880475.json create mode 100644 cells_1537880525.json create mode 100644 core/__init__.pyc create mode 100644 core/mKB.pyc create mode 100644 core/mLog.pyc create mode 100644 engines/__init__.pyc create mode 100644 engines/android/__init__.pyc create mode 100644 engines/android/generic/ADBshell.pyc create mode 100644 engines/android/generic/__init__.pyc create mode 100644 engines/android/samsung/ServiceMode.pyc create mode 100644 engines/android/samsung/__init__.pyc create mode 100644 engines/host/__init__.pyc create mode 100644 engines/host/diag/__init__.pyc create mode 100644 engines/host/diag/xgoldmod.pyc create mode 100644 engines/host/serial/AT.pyc create mode 100644 engines/host/serial/__init__.pyc create mode 100644 utils/__init__.pyc create mode 100644 utils/colors.pyc create mode 100644 utils/logprocess.pyc diff --git a/cells_1537879258.json b/cells_1537879258.json new file mode 100644 index 0000000..cc3873c --- /dev/null +++ b/cells_1537879258.json @@ -0,0 +1,11 @@ +{ + "346-1501": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + } +} \ No newline at end of file diff --git a/cells_1537879363.json b/cells_1537879363.json new file mode 100644 index 0000000..cc3873c --- /dev/null +++ b/cells_1537879363.json @@ -0,0 +1,11 @@ +{ + "346-1501": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + } +} \ No newline at end of file diff --git a/cells_1537879796.json b/cells_1537879796.json new file mode 100644 index 0000000..cc3873c --- /dev/null +++ b/cells_1537879796.json @@ -0,0 +1,11 @@ +{ + "346-1501": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + } +} \ No newline at end of file diff --git a/cells_1537880475.json b/cells_1537880475.json new file mode 100644 index 0000000..e85d316 --- /dev/null +++ b/cells_1537880475.json @@ -0,0 +1,323 @@ +{ + "11ee-9": { + "PLMN": "208-01", + "arfcn": 9, + "cid": "11ee", + "type": "2G" + }, + "1882-10787": { + "PLMN": "208-01", + "RX": 10787, + "TX": 9837, + "band": 1, + "type": "3G" + }, + "1882b-10787": { + "PLMN": "208-01", + "RX": 10787, + "TX": 9837, + "band": 1, + "type": "3G" + }, + "1882b-10812": { + "PLMN": "208-01", + "RX": 10812, + "TX": 9862, + "band": 1, + "type": "3G" + }, + "188ec3-3011": { + "PLMN": "208-01", + "RX": 3011, + "TX": 2786, + "band": 8, + "type": "3G" + }, + "1ba-78": { + "PLMN": "208-10", + "arfcn": 78, + "cid": "1ba", + "type": "2G" + }, + "1ba8-78": { + "PLMN": "208-10", + "arfcn": 78, + "cid": "1ba8", + "type": "2G" + }, + "27-1019": { + "PLMN": "208-20", + "arfcn": 1019, + "cid": "27", + "type": "2G" + }, + "2ca4-10737": { + "PLMN": "208-15", + "RX": 10737, + "TX": 9787, + "band": 1, + "type": "3G" + }, + "346-1501": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "346-6300": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "0", + "band": 20, + "bandwidth": "20MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "351-1300": { + "PCI": "351", + "PLMN": "208-01", + "TAC": "0", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1300, + "type": "4G" + }, + "351-1501": { + "PCI": "351", + "PLMN": "208-10", + "TAC": "0", + "band": 3, + "bandwidth": "10MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "351-1850": { + "PCI": "351", + "PLMN": "208-20", + "TAC": "58104", + "band": 3, + "bandwidth": "15MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "351-3350": { + "PCI": "351", + "PLMN": "208-01", + "TAC": "0", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "353-1501": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "353-1850": { + "PCI": "353", + "PLMN": "208-20", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "353-3000": { + "PCI": "353", + "PLMN": "208-01", + "TAC": "0", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3000, + "type": "4G" + }, + "353-3350": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "353-6300": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "391-6300": { + "PCI": "391", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "435-1675": { + "PCI": "435", + "PLMN": "208-15", + "TAC": "6603", + "band": 3, + "bandwidth": "15MHz_", + "eARFCN": 1675, + "type": "4G" + }, + "435-3350": { + "PCI": "435", + "PLMN": "208-15", + "TAC": "6603", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "56-1850": { + "PCI": "56", + "PLMN": "208-20", + "TAC": "0", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "5f28-8": { + "PLMN": "208-01", + "arfcn": 8, + "cid": "5f28", + "type": "2G" + }, + "65-6200": { + "PCI": "65", + "PLMN": "208-20", + "TAC": "0", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6200, + "type": "4G" + }, + "65-6300": { + "PCI": "65", + "PLMN": "208-20", + "TAC": "0", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "8fc3-10664": { + "PLMN": "208-20", + "RX": 10664, + "TX": 9714, + "band": 1, + "type": "3G" + }, + "8fc30-10664": { + "PLMN": "208-20", + "RX": 10664, + "TX": 9714, + "band": 1, + "type": "3G" + }, + "8fc6e-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "8fc6e5-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "8fc7-10564": { + "PLMN": "208-10", + "RX": 10564, + "TX": 9614, + "band": 1, + "type": "3G" + }, + "8fc77-10564": { + "PLMN": "208-10", + "RX": 10564, + "TX": 9614, + "band": 1, + "type": "3G" + }, + "8fcb-10589": { + "PLMN": "208-10", + "RX": 10589, + "TX": 9639, + "band": 1, + "type": "3G" + }, + "8fcb2-10589": { + "PLMN": "208-10", + "RX": 10589, + "TX": 9639, + "band": 1, + "type": "3G" + }, + "fbc8-9": { + "PLMN": "208-01", + "arfcn": 9, + "cid": "fbc8", + "type": "2G" + }, + "fffff-10589": { + "PLMN": "208-10", + "RX": 10589, + "TX": 9639, + "band": 1, + "type": "3G" + }, + "fffff-10664": { + "PLMN": "208-20", + "RX": 10664, + "TX": 9714, + "band": 1, + "type": "3G" + }, + "fffff-10737": { + "PLMN": "208-15", + "RX": 10737, + "TX": 9787, + "band": 1, + "type": "3G" + }, + "fffff-10812": { + "PLMN": "208-01", + "RX": 10812, + "TX": 9862, + "band": 1, + "type": "3G" + }, + "ffffff-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "ffffff-78": { + "PLMN": "208-10", + "arfcn": 78, + "cid": "ffffff", + "type": "2G" + } +} \ No newline at end of file diff --git a/cells_1537880525.json b/cells_1537880525.json new file mode 100644 index 0000000..a9daac8 --- /dev/null +++ b/cells_1537880525.json @@ -0,0 +1,248 @@ +{ + "11ee-9": { + "PLMN": "208-01", + "arfcn": 9, + "cid": "11ee", + "type": "2G" + }, + "1882-10787": { + "PLMN": "208-01", + "RX": 10787, + "TX": 9837, + "band": 1, + "type": "3G" + }, + "1882b-10787": { + "PLMN": "208-01", + "RX": 10787, + "TX": 9837, + "band": 1, + "type": "3G" + }, + "1882b-10812": { + "PLMN": "208-01", + "RX": 10812, + "TX": 9862, + "band": 1, + "type": "3G" + }, + "188ec3-3011": { + "PLMN": "208-01", + "RX": 3011, + "TX": 2786, + "band": 8, + "type": "3G" + }, + "1ba8-78": { + "PLMN": "208-10", + "arfcn": 78, + "cid": "1ba8", + "type": "2G" + }, + "27-1019": { + "PLMN": "208-20", + "arfcn": 1019, + "cid": "27", + "type": "2G" + }, + "2ca4-10737": { + "PLMN": "208-15", + "RX": 10737, + "TX": 9787, + "band": 1, + "type": "3G" + }, + "346-1501": { + "PCI": "346", + "PLMN": "208-10", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "351-1300": { + "PCI": "351", + "PLMN": "208-01", + "TAC": "0", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1300, + "type": "4G" + }, + "351-1501": { + "PCI": "351", + "PLMN": "208-10", + "TAC": "0", + "band": 3, + "bandwidth": "10MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "351-1850": { + "PCI": "351", + "PLMN": "208-20", + "TAC": "58104", + "band": 3, + "bandwidth": "15MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "351-3350": { + "PCI": "351", + "PLMN": "208-01", + "TAC": "0", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "353-1501": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "20MHz_", + "eARFCN": 1501, + "type": "4G" + }, + "353-1850": { + "PCI": "353", + "PLMN": "208-20", + "TAC": "58104", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "353-3000": { + "PCI": "353", + "PLMN": "208-01", + "TAC": "0", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3000, + "type": "4G" + }, + "353-3350": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "353-6300": { + "PCI": "353", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "391-6300": { + "PCI": "391", + "PLMN": "208-10", + "TAC": "58104", + "band": 20, + "bandwidth": "10MHz_", + "eARFCN": 6300, + "type": "4G" + }, + "435-1675": { + "PCI": "435", + "PLMN": "208-15", + "TAC": "6603", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1675, + "type": "4G" + }, + "435-3350": { + "PCI": "435", + "PLMN": "208-15", + "TAC": "6603", + "band": 7, + "bandwidth": "20MHz_", + "eARFCN": 3350, + "type": "4G" + }, + "56-1850": { + "PCI": "56", + "PLMN": "208-20", + "TAC": "0", + "band": 3, + "bandwidth": "20MHz_", + "eARFCN": 1850, + "type": "4G" + }, + "5f28-8": { + "PLMN": "208-01", + "arfcn": 8, + "cid": "5f28", + "type": "2G" + }, + "8fc30-10664": { + "PLMN": "208-20", + "RX": 10664, + "TX": 9714, + "band": 1, + "type": "3G" + }, + "8fc6e-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "8fc6e5-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "fbc8-9": { + "PLMN": "208-01", + "arfcn": 9, + "cid": "fbc8", + "type": "2G" + }, + "fffff-10664": { + "PLMN": "208-20", + "RX": 10664, + "TX": 9714, + "band": 1, + "type": "3G" + }, + "fffff-10737": { + "PLMN": "208-15", + "RX": 10737, + "TX": 9787, + "band": 1, + "type": "3G" + }, + "fffff-10812": { + "PLMN": "208-01", + "RX": 10812, + "TX": 9862, + "band": 1, + "type": "3G" + }, + "ffffff-3075": { + "PLMN": "208-10", + "RX": 3075, + "TX": 2850, + "band": 8, + "type": "3G" + }, + "ffffff-78": { + "PLMN": "208-10", + "arfcn": 78, + "cid": "ffffff", + "type": "2G" + } +} \ No newline at end of file diff --git a/core/__init__.pyc b/core/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b95e8f6be8b32339a437b4815bed6da8db57a2cf GIT binary patch literal 119 zcmZSn%*$o3wJJK90SXv_v;zfgc5S_L2MMMQcPzfO<3#pRDp^*^kscNAdQG?`gAxKyodz(77y^(i9sT5A- z%n#x3@duchO&xB5Bs-a%9q*fY^Bn%(8=k)W^*Mvhr%V5DXt^(BasUHxp&(cA1K<|m z)08#=7_uRlfX@m#2qmf0CWVl9!T4yejdmdK^JdzGd;pX99zo!cOgbs*d1=trZ5@ij zXSCdNGE@ZPk_{McO4mz4(+(t)IN-DsGSSq}EdnJ!C{A4VBNhMV<)?>r^5mfr&4st?U;Km{0Z@HT)&2x|rF0Dj)(Q2e<5Yx8sx z^QGgsL)Ld%)DCr>8HdcYTP;nKkOMd%lcroun#NoPvdKz^{IG834twNWU9%gL2V&ea z@p z>x>M^u5h`+amY*t2`v8{b_X6uV$F0ovr{@;e~6UJj&j@js`Q1#U?5G`|u z%;P&g<-Vzf@A4Ym$x=r9kWPeDDcxa1@1j&w)CF#<*~P3#$T$A#TUD|wg=0{j2e}e& pmd4ASsj;(#$uQy45^f`TLS~C7-cDF<``8Qjq*dGg;2_xV{{h}-;<^9; literal 0 HcmV?d00001 diff --git a/core/mLog.pyc b/core/mLog.pyc new file mode 100644 index 0000000000000000000000000000000000000000..517d0cf2373e47cfe32f35617cafd180215cc300 GIT binary patch literal 1493 zcma)6OHbQC5T3Q21i~8%2niJzDN;&RQc)x>&0^9`bWs?}|{lq6L(9(nWYD8Y3ik zK?;Nrfq=ud^*hHDrM(g8!UENL*-qSn5m=@Hu}&sT=_J$);$Za*)tyQFta8e-S*osmb_ zGujQyfID_K>^+CwW7l|>ge#r`-2-Q+GYOMqrC|~)D9&#L%EO}WWhZFu5CYiSEjrTo z6|MzG0$j+b94e`vpyT+_shyWCn<%y`wRE&}?c+7N{a|zH!NtT2ZOdknS)AEK-;l61~`lMOv7` z#%38aVnmE#e-wZHVjMAQqaEwM;NkeXDA<^x@Bm-2kHoU?-(slfwC$81R;w}^!mgtE zprGkIUwNALRuL~b-Hc?hSRjzMI8ADv){3gq)Sj>A-2-8SdGYR;*Yd0X83r9Zzt81*4V0PT3(~M+hNP1|g3`VGHA_(M(GkX?A9r zo&_m}R3)U!l}ipurE*GDu1-#=$~~u4<&qroA9BtiKOlLYxA#NKhl#PY>}*eWPk+4q zywCe|59R-ijlO^S54S_r`77i1N6Jy=??^=W=cq)frlXb}94bGt8pHwjTOgtXI&=ybQ0E1jTBWH%$XsOY7QYhGvc%8#m1g z*R)%$EH8BABG)ZYrI|H#S~LopCeruJ>-bIL74Pabw{5f=q;5OyKNaL_ZK-d@QSWBD znP&G>SJNiv-M&%p1xZ`Wq>CZcGdfxIXzV(^_F~>bYAVmNV(NMpHM5mw(3;ZeTAXUr zHU89^PIVrKQ!u+(*GbZ7ZOc4;KThMq_m7|rGs-rdn*EeQt_Z(0v>15|i2`<3YQs^F z92ktn^Zn7~x|Q3}vB0A_cVV0(XvX(Vk^BB@NE(huIdz(&Glw*2YTqw7e&26qQ9Hq{ z$LG8%F8wh`>O~FavE#$|8g^ZAsw2fAB&N-F8m{MAnzhZ9IMJRCBK;Ix{}6S1xZVkB zVD;yK`H+grk^nOdNdmMmEQt{UpVl=0#%0vSU#?fryX!^KIzKgKfXpCBlepE=scEFT zn8Na|XX#|HV{DVAz0%6FP#ZJZid%Xz$3WwBZA#kvKqoDoyI~R-;})44H(QA&KHZ&d zpj&yy%~svOUBztW;W)*e(XAkdlfV~PtKlxR0W~9!xNv+VGuFFHnm`xwVf5mswz-plzhp2@F=OkBD=<(2&>q{sVRaq)E-NO5~q#PIoVK%OrRJB zNfN9iT5f0s&buH6?TldVg6p^>CK7}SUHGe!2doaGF0R600rv=2LFjb{c zpOvI~AKovFY`V&6d<`e8oR{&LaH{wS39v(UFUEfxiLJ>#4{QiMV-+snIiwznZ8s2a zz_Y>;&fP=mmIM{HU@qW7I$g=4ZGworS(-mNp3*){?0M|fIj$y$v5%9Z%$mXgNvc6tsi3Js{zE7nMa1;1jX{YU^z8{!&iK~QmK@xd#c0La=n8`nHRO+LBYNx?NNB6a#zn$H zIzpI1=OSWRVTOohV;CZqjbS6*7zQD0V;E%UsDe=CgQ8WbQjxAvp+*pE=($KLNDmbXg)BJaG4-O5qQ(k=Wd$ z@{bv?U}pp~#JoN!SzP3%jev;h>8*}Os%=8w#&&Da!O5#Ekn&?;%H!#rbpX zWZjM7 z*?x5Q-sDpZFS{^x?ko_je3&3eg!)ZD{%ZxD1WrKX zM0HJWtDReP1ce5cKv-z?^;wnt%{*` zSknb0a?8zumIn52*rXXlkC{TFQ!$}!WJhuP)9BOtciuP^(>uiJ$40%QOmnlm638ez zy?L~*w9+nCC*Pf~llr}Pd7+rH%4G^E@u&o_U_ZGQoHTZsvZJJL&Ae1=pPP~C?5!?0YTj7*Le#V9VIRS zCEF^H1zZAq;6W5upH++<0cw=g=7`F_R1a{A<}2#L-7nSMI{)25#$uflHt>l-v@HZV z_Vm+BZ_M0SSiJZ?HZMFJ2)G>>KwX^H&z|bxF3eio5Ebn_#fHa%aiF?@G>XGQ8Z^B! z!^M}r&bt<8M8K&tvaDxfLR5}q`Y@A{V}ehMjti*c5oX>Gc%dq>a)cX_4sVfi1$G>Q zFZ7gSl+xCgz;oNQq;4||n>Y*Nu&~3Sv+WYLeC#5Prd3zbws@tgR0LV$xW0x@&3VaE z7hRE47pDFku4t(XVYIUm0i1-u4q3`#v0#pSKu4{XRHp#I;zMQGL4s?5JirhT8X~Cy zg+7o1ECOSQ8W2nXBLD}40j>{6)YiYGST>Qh+;@OGRAR99ovptLviI`QT7G*+*==Y0 zmr_=f-ho^6i^m`Vst(6G##;`(!W}2Di8MOg9D+u0FffdQqZ;Sq4#y(^UQFMX>hdV7 z(^DMa8(#Ac21~_&n~D^4+d<~7yT4UK#e~`%RrxIkf3^qYevI#}yPv}$dcBd6akF2# z#>f^0OXdbvqX$}HU%YJK>ypsLED`S-IF?8&)iAv9-Ceo z8$IT}=N>mF&6%f`cO0`@%{_6#4TFLYfP&EA4u=vaiRtI_b?O3dninBx(!0laBUCL8 zv6Q#9xIh%>CUzJEAdUudyIH>yBt{Egi+J~5N2xdtIMe%(4T<+r;uqW{eyF!svLKJH zVylwp?UrpNOfsYEgtzD=?|r7;<1-TbL|=5y3MiSZ;PAPRh5(bcNxWp6Yq2TBOT(<4 z7MHGhub^NTT$N!CQxZSTvnB%XeGcRTE^4?2Np-YTg}YXrQHU&lUcsjf*QL}tfP3bT zlnyv!$Qi@u0CL70IqV@J_1t<6H*jJK33!AYYcnv245NdcB-^8us73{-3lYKe@FBHY zwjK^Y83sfp5dQ`Z4nTBfJxJHI1!)`SJZqqJ>>Wj&_F+gc50d%ynVIYJGXqVb!a1=0 zC1`0kXcrmIBA+5cI^h|Cz_jzE*MNl~MyCuH=t;<1NFR^SoI7*ebb)=+YDa-AHId*} z4hyZ+rZMeEWuMm_l|Y%p>tkydP(dFG#hi5H-*FZMtQx7v%2$B_nPtf6RqlL+y?L%` z7kH4d8G%{Ze1S{PR9uYCvd!z_ewJ?*+by2JM;d4CT*A3LxEB}Om$I#ahdL{WcNy;E z4>krWN+903P)X4%Hy?9AmXU&{yOL)?6b7bnCj)oQ_Pdg8HP8vPTqBS-CXJa7rswBo z{rTCYTQ|H9{iRP9X5Gn2{bLv5lM`6t1dhii?Fj_Qr@tu>j^PY_A%R_3sF%^cU8s&3 z*!>)=^+!&PexfP|9TB{;R?O+?xKp_4J0oI_4XYAU;h5d9Dt_2my?@}5p8cM`de3pd z=Pw_-I45srrs0NoYl73CGw#{9Bx`Q*I!+anZ5%g8?%B5`@2xq>`Whf;U`kK==x2+c zEY94RzjAf%A{_NBKIi(LN+9=xOJB5mpR%Aw^1HCU3@uNr@1Hqh@_`zuIY+I88gN1e ztNy}bJ$Ec@S3>n1lG1-*NpGgPUPHLSQQXa0cNI~=4cmFn6F9QLK;5r&uVZNWNy}RH zd$u(>lgFavE*O%GhM?M+*k3p@v7p2_Q4&2a>-ooN)Usv-mq9xt7D2etfTHTqV0RBK z8w?KIe2&Y2g1h0EBpxami`?c^kaJ#WMJLAnR`7^M- zI~kGw_=euM-xLa$p53RQFqOjlcKiN+=0?pUSWc?F!tE^8l zj{;tf*Q`<(0VD$Z77Mr$@ow{ShnLTI@p%b&332I@gQQ;g==TKLV(0Q77pQb=8W|CMVZO^@$s2?nI-Y@dIgmw96)_Gx%nxjIjMFa J(~E(a0RWEO9b*6h literal 0 HcmV?d00001 diff --git a/engines/android/samsung/ServiceMode.py b/engines/android/samsung/ServiceMode.py index da141bc..4433179 100755 --- a/engines/android/samsung/ServiceMode.py +++ b/engines/android/samsung/ServiceMode.py @@ -120,7 +120,10 @@ def parse3Gcell(self, string): if b'PLMN:' in s: plmn = re.match(b'^.*PLMN:?\s?([\d\-]+)?\s?\_$', s).group(1) elif b'MCC-MNC :' in s: - plmn = re.match(b'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) + try: + plmn = re.match(b'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) + except: + plmn = None if b'CID:' in s: cid = re.match(b'^.*CID:?\s?(\S+)?\s?_$', s).group(1) if b' TX:' in s: diff --git a/engines/android/samsung/ServiceMode.pyc b/engines/android/samsung/ServiceMode.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b62e372a5fdf77f296f0e1935586aa693823276 GIT binary patch literal 7210 zcmchc&u<(_700V*#xtIYopFA7lTFy|WV7t#hiyoVL8FkYJx)wm+X`(*HrYvL+uiMP z+cVwcu9~bZ*%y`@5`upNAtX302gDg^PY4Ol+|V9CLV_cF->dHV<#=J0WNlAPRoAQ6 z_3M4=)pPovqlG_A{o+GM#6M|#zb_0SEo5B$8KNOX(-2P#VNf|G8Y!_F=hB^Arjr{& zE-k#Q*ffNj5kD5<6Cr;1Bq!VvcMr!t*)mWEB}tP~Xs@Cn@2jsl)V2bU4GsR8kz`Vmc{ixv2XGVeTFp zJ{cBnmSmpfg|$-3;RTZ3TQK9FO2d}Yv^S)RY;-uN_vd*GrV7ovr_5%!;Ws?f@frk{Xm3zZVv(3qhopCAvtL)7eWNbEu~n@A#` z>*nKD!$~VN5u%!+R)<+?7@)`bL_Tl0g(UxZ^2QTK+M;<{?BFuc_tu*$cvYA`XHG91-N1cfeo*@6wXz9=AZv&`)s6zsH8=LnMp$=j z)h8UbRoQfXN3lJ~PMxI9KUz>}d@ZitR~dZI*?}uhBlB$XI_2+`?^Wf!Qq{e2&1ZVB z(CqR&HV&lMho!iHguC$V0wWYsQs3=T%s0STn+td?_by@l_~ z@v|$aDH<2?DH`KO!5B4i{K*-oQhZ?0j-o;Gf$=*mCjdYP22xl&Qs53L4h*DOJ}Poz z?{A|2sQ3#VAaqm=^HJd@_yf3xljDJj0u_XK;7&{aG?4`T1|&7L0V*x|X(9>q3`nL~ zCyos*`PW1ehsS_qh9z-?XvyhB5@*JMB#yCZ`dh=eV?Z;7fynw0Gy1m%F&YyyN?;}C zo)m78p{#k`TQ!zcVQO(Eqy_e+<}MRCFMLc1>P~~csL}L2qYE0(XLTVW)Xxe>Sq^j78wjv zXmy>xtaT;>=Wj1qW2jy(@z_pLYdU`{dY?r-x5$hwqOL_FwrIIZq|thll8cmFLc)jv zOIWMgBgiD7%amL}!kppcWne>nW7yng*wkcQ-fs9i-aMYO-hS#3bBHp%pDUmY z{c6gLf-)~6%-@MH7nm?eK^UYU3{qGN(hgzX8*oO)jn_h$yX>B78hj@9-%fyV6f!BX zw)>ed3`2Jx`E?>$hdTdCnjWQ&=2M3{X5vyFrH(FVvM+tj4#FAG;G3y%Xx=zWBj((GJuNYs{@g96_p(x)+ay+%t#@j|3jOsFs z_(h)55q=Fr4=)m3sW*sUXPI9}!7rp4_KJqY-tPyzqF)iu$ScC74j1V4gb*-An2f$O zYp)2t&UN;RwB(NxNq9v^CD8*mI@0;eL=wOnknDIxT4yPd1fK>ZGh(+ye`^>G`8te> zdYZkQX9-14^izb3M3E78fcPc~2PmcpkBU7TL>HhDo=vgWvl#;`PO-Ox2Dr@5&;>ZB z-53h#IQqo6rA81iodyMl6tVo2!vsmgIGSO_cvKw$GO*zTL2g zaZ9@|Y_?z0han>w@L{y|(-qY+DS2Hse~Vp~pW_wsCX%kr4|*wAjB`B}&Nm=fGl$DM zH=t*Dav;PuY>cB|hlarI4nZp1i7-cW>tXAl&LN&#T=8U~Rb4&-pGpf7WQ+L z!AG$XTw;Fcx<7Fp+>5vlqX9{D-9NYvE=F939L5XF)n(mtcs3}56W_)#)^@i$=ukP7at7bi1EI+*2bLU2hg2c_fNBY2|5W?e@ zYb)tnJIbZ7@P+ud-QuH2#^0a@!0+FsjJ z6j_;-`+>6+g+bVs4-ncB1BFUT|rj%rSh8h_Yh>E z<4&ru#X6lvC_Rp3vw`z%tQCchC#9lrh*Z?w+Aa@mwEH095m~ef+{Uq62<>^SynzS^ zIT|k?CZV3!v3K-B{~9GZO^Sz#M&3A$Pl2N)myAm|?M9RD0@K`-9I`+8Di|%79NRC0- zt(F(Kl`X&Fa`&`4ikR+f@LE!Miz8q=oIcmRLH(;)Tw`A#^k$n(q*kNH6{UnR%Hd@$q^El_eZN9X7f7DWy57b|7<$ftUdR D!u%TY literal 0 HcmV?d00001 diff --git a/engines/host/diag/xgoldmod.pyc b/engines/host/diag/xgoldmod.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd7be1ee4ac3c646abb1ae8124439af10a9f61e9 GIT binary patch literal 1557 zcmbtU%Wm676g@-gVM(^7Bt-*d)lE<(KqA0FjUaU&i47M)Y}cV3*mV&QvPi0wDN-g! zfCEsgcHjRf(68$UH0NF_$vTLr8J@Y%GxrY1{cofF)5Cv$A7k}%`TiLO#U4Sxzd-`b z3@!|etQ{l{W-cz=YV9Ja;WVfrtRpfA>i7%z6Zq|-fuMntL6d>v|M?pjBD=|Hp2w;6 zqeVKlah6u{4&}RHk`zfcnS^;I6px2?jq}YUOM+Pzd?e~n_(F(&Ll8pvg^nfQ}ypw@gk7be}QFq0)Mo=1Z6v@$m6V%d*q6m{n!I-Qnofs64I1TeGv%|xTj4o%R z`7lf;aT*rGKeECOgLpIlNG}+`x9QiJ*&Zo`RL5 zFzkI4+(KW7-(KygFWNf{K=TfEN?=NcYoayR$2dC+fY;~OPa)uB@D*!+q+O2UB-E33 za_CFP3+|WgkS0BgWmfpT&Ofl)?AgmbT|KhW!My|j&2w*mw~BUraCoFf-t%33AMh=G zfAWiFv+w4iuDx^he)GY*kW^6B>G_~7SaQu?y;=vZTxQZkv z+Ro-uC#~5EZ+T*^E|pHGkK^Erz8)#=e3TdAJ~>IhiY-nsEwf>|rpI@eW8K^~HFJl! z!ACS-^Vu{VK23AW+;;}bP3{ukPe-%R_pOxI_j#)<5-vR{y%xuNK=g^UqR;>CJ=uMi zL+_b}>DG?)GF+vN7Iu+KT3SF4!8psq$FqZMqD-`~m1x!c>~b28t%m(#avFW7+WL=j N_ZHIL9_!h5-UFFsCSd>o literal 0 HcmV?d00001 diff --git a/engines/host/serial/AT.pyc b/engines/host/serial/AT.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9803efebbd0ed55a80b65a577a687c2a8bee6f9c GIT binary patch literal 2677 zcmbtW-EJFI5T3OiJ2nZlPz4n(SV}9oCDcvAMX6efF=_!dZe?3S4T9Bn_c+;Pz3c8d zrj6uWp!NxPi*m;+@Bq9F4*=gcHcrFO1&tkV=A1J-Ki_;ayXD_k8@I3g{B0!jPZ|F| z6HjagA;zC4smREa9Zx*2OOlpkrzCM%Oj(AW#1(li@=WC6PDRX;#7lBel44&>MdGSF z!>v^@H8EA$U#1>*JTB@I*K`3_Fxzh~!)5XZK1~mjdmWc?kz_6yPO``)dDe9$?6n7r zXu15H(S8lV2!n*poiZawPzVU|Q$ScH6*LsY{v2T~&tu;~Bv7d8Ww*V@kGQT}KYj$0<%O)_I!d%1P3nU7X`aCLmBMgka5ToBNe zWmMv6E_6U|n#(T`5|JaM;K{z$83-Yxqq02xNv36{37k-@FTVRxjw&*(=vIYWM@xcI zOqVFL-b+$6xdevi_kq6Fl~w`q%xYDS>;H9JlPNSxa!`}vg-o%8`KsJ}{6Zc#`S%Sr z`ppKSw!mB({!5<+VPTEm9(>rj|Db>Cwx49fycmUK%n7|DYi?Y=;adk%?fOwZwtivU zq{vJ>-#nq7PuvYZP9moU?c&T5SoL+o2OZ`hUtV`)?Rv6=YeEKCN)tEy=(?U+#*9uHx!%FJ0wqs@eAK~HHE?Lhsym9J z5xRz+GUKvvWL}w6L>;sQ$OKqxa1L8it$J^IYu+2UzK8FMcg~BLBl95dlxUwoK*d0Y zBkdc~3ax_~K;nTMpyxs&9idxh`JpmzD*GC2EXupuPz-wtB%ygyB+e-F3lqjEI-|FS zZS6wEZl=n9ER3C`?v;Tcn7hUig?AxZLLpw=TlE^=N-1LA42VC?{YwZ)7A-YL09{lP z6zgDFii>Ow9AWygwREDQ?T7_BNZV{!k~Ja~bH31OS2={fh4Z&?`3saw$@=E{g-iCr zYU7x7FTq5t2F1km-iDy`Fq!g;MvwWm-RW$1I|^kuarp=gREkkh5MLQNA{Fh0*{*qT zZ@c>eR&(&GfNupqB@RimAkI5j{5x?J4(fGJFk=(U;I2lhna-A)BM~@N^pmVGyNPwC zxB^p__E`Fa9(BB)VEs$MgVH6PoHN#==zXQ8{S9|6h6=}7M*;G?#y!c419vz!K9Tn) zmh-ATz{nbn!Yn=>MZ9Z1)$l<1$DLPCn5XilkJ0G2QCw?M6S;MNV@tR0_P6~!OAme6 z_cuP)y{)^tb<&DX#c`2G#&UeJpB7#$>D3;5-+$Qe-0$A`>h3KNa|2(Lru+BW5U&~a zSRiH_oQ`8>VP?j$If4V&yo$|Pv1)a%+vFsfKO{L4gTRrQK>(a5DVMBkH^&H}&||~v zFzKs)$(+8P626xRwGD{ymMF65jp&u=K_a(l?3S^ntAN=& zOR|+JPFtAkAXEzw6G@9Tq|F)6_Qno9KJ!;NQ_;URTV&Ua?(n_ z*>S-R3wBhngH*Al=43yevjq+t(M70J0Iq)_3JU^T`HXSKOQuXF@Ru*aBB55+2{eFQ z2cQ|Q{dUh6hK_DJ!#m$JV|3FOz8@HV-xk3j=xerh)gBBD@q=F1Wp5@^aq{RQAp>d$ z%v)ud_HMH%&1UIz>8jbIbY6Smd!OjHtS#U*y+b;O{kEK8R5;$i1t+qfM>({V@T#u_Z+x{VM3OdV6 KIOhTsf<6I$uX8;B literal 0 HcmV?d00001 diff --git a/utils/logprocess.pyc b/utils/logprocess.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41002b185e01be01cc512b618c951d1ffaa813fe GIT binary patch literal 5575 zcmds5-EtJy5k9lK`dMiuKo|kWaVB=Km!GTvJ0wLgAS9qDthFj z=A1>^6uL;^t2~46QR+ZgHR63zLlWJ|!&Bs_xt<_`<{FGXoQhHjwQflpliYqD}6*{KA zDXXPGCR+btEjWDV1NwM%KOvqsh84}fiX6q zCeMzjtx@%|q}YuOmqmnTeGIR#d}%Y!G$svBVA;PO~lG&BX;_ zY|?Q{OsaLa&RwKmPR~PhOj|m3!o*s3ghjiKA0@&a}z<6q_M3+4e zWwgo^63o^Jy*7s4;6EeKOUdbldo(Q#5@vCcC$WjQ1DaNj^6AY_ZU$3mB{XH7lSRJy z#rtMcr>PvX^W?rLEy}Zvq%D4Nuva&fdF%(6)*5QEd z6>ThZs(*wILm8D<^-lf|^c0-L-Ur&bcJ2E0BiadOID<$D-XS?d!s7?CAadZ~EIB-H z=@)#r9Cuk4FOo>}#2=yW=!t15dY^d44KRm218zZQ05Fud2Yd;*TJR7!4ZH%H6SQ!T zrWn=2iM2hj{BAo>;k|LdSJ)~@H!O^Pm~7=pJCIW+wY9s$W~s`wIvhgESDBs@ICl^+Dyk|=6yUs2;! zQL8G7nmAAtwa|2KaRF?7k}n}SWTd0+Ku`zol5n+PuU&-ehyqb)gZDY`LlPfEv?d-C ze8482w{#nNn`rEiL<6N==MZ7(@G|C&In^Re=j|C}XPcG37ybY(~k z7*qp-Fkny(Xp@8ZZ!Gb8j8llCG1)xMHu788)6llcizp{w$v29ueK7EHh=r6*7ng7d zp@-oQPLJ@nhiEt=!4VTAb|P2I?jc?xQX+Sh)ocvwm((86Q8|=O*q~d$TgI7tIdhn1 zC}&fWq<|pFVx8H9iV>`sys)ip-8Y88D?$V{t&4GE%jB6H=%SIIohycp{`Hk-{sQOt zCVZj&(D)Zkoo@(81a4d@7>j$It`X;v=0=)_R%YZ~NI(tk6p3{SEJ|~u16rZZ0SV&y z`j*?3R@*Wnnyk-4q&;eR~f0Fu*tyPn9OFq)83Rf;Y>*L4NdqR8gREQSP@x_ zHUt`O-ZWO_FEfCstu7&+kcf6x}6xS3my9#Mc(nFUQxiD z{+FLGH4OvKXLtOC%`j^NRsPb#!rW4G!QaS>TksUgQ|8A>Y7b=kQJOmdY|b2dL9<>;|%&LdR;3^m-|p( z=fN&2GP?T1Fg04-Iu30Z{1ja-wGmK2N)g)q5-_wa7(^rmlDJrkGFi;xMY`OPF!q)~ zna3EEd|wRSI=}LW?+}my7d3AbS*#4Mim+VuPT?WX=M0cD3N9iniPs@={)q;h4#8;{ z`3NDVE-3_opWVL@AjRL0AV=aJs{l!Tf}9aac7Oqp!)OTPAaW8TZUoWqHRKF?UqjBY z_sz(uG64>d^PM1PQcw=K;}9|iyXq=e;;hi!G>itfz;2pYSrL59 zsgxv6qLxHE!$GTKQQ&{4s--aNg(+hDQnQCw7{*5h_+Nk`rd^p^M$a$={0WWz9~cFO zD%g{gpx&iwpbG>Dr~_xmnISiR(1wz>E6O}(Gj><-ZxxCd7<~&!$K9J8;JUv6xOFRm z-dVYrqwtlhB>~JNT;r>dSGUJi@vXcq!(AOROmV@dgXfx>uc5oM!DrI&~XkD)W-h^46@ zYvK27je{rv>ja=x{{eU@AzJvpWqXBgwE~V?A4Id_(xx%^&e3S=OczPi7=9P|@C}np z*fG7V-8gg+v%CiGZ?>5m+lZ5}-PpfmTYfZnZP?&7VcM8q30O9vq(rgAZ%B>7$15Ho z$_w4VM;TYov$C=7vs>17H%?B%wO%gnPUZ5!LgKu5wIrE?Ybp;Dd_+P$yOi;e++&ho zlKh(FHz1sGh`iNTuiGdYd#S!7rlIXm;(EY8_glkn&8wBFrI~7V1b?H|YPDRQsLoc; JRmZB+{|5WvOB?_I literal 0 HcmV?d00001 From 5cb5eeb6b4ba764be80fcce633f12387a60d3e17 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Sat, 30 May 2020 18:51:24 +0200 Subject: [PATCH 02/88] Moving samples to a dedicated directory --- cells_1537879258.json => samples/cells_1537879258.json | 0 cells_1537879363.json => samples/cells_1537879363.json | 0 cells_1537879796.json => samples/cells_1537879796.json | 0 cells_1537880475.json => samples/cells_1537880475.json | 0 cells_1537880525.json => samples/cells_1537880525.json | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename cells_1537879258.json => samples/cells_1537879258.json (100%) rename cells_1537879363.json => samples/cells_1537879363.json (100%) rename cells_1537879796.json => samples/cells_1537879796.json (100%) rename cells_1537880475.json => samples/cells_1537880475.json (100%) rename cells_1537880525.json => samples/cells_1537880525.json (100%) diff --git a/cells_1537879258.json b/samples/cells_1537879258.json similarity index 100% rename from cells_1537879258.json rename to samples/cells_1537879258.json diff --git a/cells_1537879363.json b/samples/cells_1537879363.json similarity index 100% rename from cells_1537879363.json rename to samples/cells_1537879363.json diff --git a/cells_1537879796.json b/samples/cells_1537879796.json similarity index 100% rename from cells_1537879796.json rename to samples/cells_1537879796.json diff --git a/cells_1537880475.json b/samples/cells_1537880475.json similarity index 100% rename from cells_1537880475.json rename to samples/cells_1537880475.json diff --git a/cells_1537880525.json b/samples/cells_1537880525.json similarity index 100% rename from cells_1537880525.json rename to samples/cells_1537880525.json From 6cc005958812720718c31e5680bca3d1c85c0e30 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Sun, 31 May 2020 22:37:49 +0200 Subject: [PATCH 03/88] Adding GRGSM support + fixing bugs and cleaning the repository --- .gitmodules | 0 __init__.py | 6 + cache/operators.json | 2 +- core/__init__.py | 4 +- core/__init__.pyc | Bin 119 -> 0 bytes core/mKB.py | 2 +- core/mKB.pyc | Bin 1245 -> 0 bytes core/mLog.py | 2 +- core/mLog.pyc | Bin 1493 -> 0 bytes engines/__init__.py | 2 +- engines/__init__.pyc | Bin 122 -> 0 bytes engines/android/__init__.py | 2 +- engines/android/__init__.pyc | Bin 130 -> 0 bytes engines/android/generic/ADBshell.py | 2 +- engines/android/generic/ADBshell.pyc | Bin 9065 -> 0 bytes engines/android/generic/__init__.py | 2 +- engines/android/generic/__init__.pyc | Bin 138 -> 0 bytes engines/android/samsung/ServiceMode.py | 2 +- engines/android/samsung/ServiceMode.pyc | Bin 7210 -> 0 bytes engines/android/samsung/__init__.py | 4 +- engines/android/samsung/__init__.pyc | Bin 138 -> 0 bytes engines/host/__init__.py | 2 +- engines/host/__init__.pyc | Bin 127 -> 0 bytes engines/host/diag/__init__.py | 2 +- engines/host/diag/__init__.pyc | Bin 132 -> 0 bytes engines/host/diag/xgoldmod.py | 2 +- engines/host/diag/xgoldmod.pyc | Bin 1557 -> 0 bytes engines/host/serial/AT.py | 8 + engines/host/serial/AT.pyc | Bin 2677 -> 0 bytes engines/host/serial/__init__.py | 4 +- engines/host/serial/__init__.pyc | Bin 134 -> 0 bytes engines/sdr/__init__.py | 6 + engines/sdr/grgsm_scanner.py | 456 ++++++++++++++++++++++++ modmobmap.py | 64 ++-- requirements.txt | 2 +- utils/.logprocess.py.swp | Bin 0 -> 16384 bytes utils/__init__.py | 2 +- utils/__init__.pyc | Bin 120 -> 0 bytes utils/colors.pyc | Bin 698 -> 0 bytes utils/eu_arfcn_calc.py | 2 +- utils/logprocess.py | 52 ++- utils/logprocess.pyc | Bin 5575 -> 0 bytes 42 files changed, 583 insertions(+), 49 deletions(-) create mode 100644 .gitmodules delete mode 100644 core/__init__.pyc delete mode 100644 core/mKB.pyc delete mode 100644 core/mLog.pyc delete mode 100644 engines/__init__.pyc delete mode 100644 engines/android/__init__.pyc delete mode 100644 engines/android/generic/ADBshell.pyc delete mode 100644 engines/android/generic/__init__.pyc delete mode 100644 engines/android/samsung/ServiceMode.pyc delete mode 100644 engines/android/samsung/__init__.pyc delete mode 100644 engines/host/__init__.pyc delete mode 100644 engines/host/diag/__init__.pyc delete mode 100644 engines/host/diag/xgoldmod.pyc delete mode 100644 engines/host/serial/AT.pyc delete mode 100644 engines/host/serial/__init__.pyc create mode 100644 engines/sdr/__init__.py create mode 100755 engines/sdr/grgsm_scanner.py create mode 100644 utils/.logprocess.py.swp delete mode 100644 utils/__init__.pyc delete mode 100644 utils/colors.pyc delete mode 100644 utils/logprocess.pyc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/__init__.py b/__init__.py index e69de29..fe0868c 100644 --- a/__init__.py +++ b/__init__.py @@ -0,0 +1,6 @@ +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# )penthertz.com> wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# ---------------------------------------------------------------------------- diff --git a/cache/operators.json b/cache/operators.json index 94f8921..9fb70c2 100644 --- a/cache/operators.json +++ b/cache/operators.json @@ -3,4 +3,4 @@ "20810": "F SFR", "20815": "Free", "20820": "F-Bouygues Telecom" -} \ No newline at end of file +} diff --git a/core/__init__.py b/core/__init__.py index d13e961..1232884 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -2,7 +2,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) -# ---------------------------------------------------------------------------- +# ---------------------------------------------------------------------------- \ No newline at end of file diff --git a/core/__init__.pyc b/core/__init__.pyc deleted file mode 100644 index b95e8f6be8b32339a437b4815bed6da8db57a2cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmZSn%*$o3wJJK90SXv_v;z)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/core/mKB.pyc b/core/mKB.pyc deleted file mode 100644 index 4b1b05f745ddd7955b135acce9dadd60a3496322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1245 zcmb7DO>fgc5S_L2MMMQcPzfO<3#pRDp^*^kscNAdQG?`gAxKyodz(77y^(i9sT5A- z%n#x3@duchO&xB5Bs-a%9q*fY^Bn%(8=k)W^*Mvhr%V5DXt^(BasUHxp&(cA1K<|m z)08#=7_uRlfX@m#2qmf0CWVl9!T4yejdmdK^JdzGd;pX99zo!cOgbs*d1=trZ5@ij zXSCdNGE@ZPk_{McO4mz4(+(t)IN-DsGSSq}EdnJ!C{A4VBNhMV<)?>r^5mfr&4st?U;Km{0Z@HT)&2x|rF0Dj)(Q2e<5Yx8sx z^QGgsL)Ld%)DCr>8HdcYTP;nKkOMd%lcroun#NoPvdKz^{IG834twNWU9%gL2V&ea z@p z>x>M^u5h`+amY*t2`v8{b_X6uV$F0ovr{@;e~6UJj&j@js`Q1#U?5G`|u z%;P&g<-Vzf@A4Ym$x=r9kWPeDDcxa1@1j&w)CF#<*~P3#$T$A#TUD|wg=0{j2e}e& pmd4ASsj;(#$uQy45^f`TLS~C7-cDF<``8Qjq*dGg;2_xV{{h}-;<^9; diff --git a/core/mLog.py b/core/mLog.py index 96406a8..d43ebf7 100755 --- a/core/mLog.py +++ b/core/mLog.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/core/mLog.pyc b/core/mLog.pyc deleted file mode 100644 index 517d0cf2373e47cfe32f35617cafd180215cc300..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1493 zcma)6OHbQC5T3Q21i~8%2niJzDN;&RQc)x>&0^9`bWs?}|{lq6L(9(nWYD8Y3ik zK?;Nrfq=ud^*hHDrM(g8!UENL*-qSn5m=@Hu}&sT=_J$);$Za*)tyQFta8e-S*osmb_ zGujQyfID_K>^+CwW7l|>ge#r`-2-Q+GYOMqrC|~)D9&#L%EO}WWhZFu5CYiSEjrTo z6|MzG0$j+b94e`vpyT+_shyWCn<%y`wRE&}?c+7N{a|zH!NtT2ZOdknS)AEK-;l61~`lMOv7` z#%38aVnmE#e-wZHVjMAQqaEwM;NkeXDA<^x@Bm-2kHoU?-(slfwC$81R;w}^!mgtE zprGkIUwNALRuL~b-Hc?hSRjzMI8ADv){3gq)Sj>A)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/__init__.pyc b/engines/__init__.pyc deleted file mode 100644 index 53550a690ac3fc152569e5775ba2f5ebdef603a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZSn%*$o3wJJK90SXv_v;z)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/android/__init__.pyc b/engines/android/__init__.pyc deleted file mode 100644 index c66820159b5c02ac5eaffb8f85f12131b51c4260..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmZSn%*$o3wJJK90SXv_v;z)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/android/generic/ADBshell.pyc b/engines/android/generic/ADBshell.pyc deleted file mode 100644 index 78943728eac54387a718d1d3d58ad07280c4e8b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9065 zcmb_iO>-2-8SdGYR;*Yd0X83r9Zzt81*4V0PT3(~M+hNP1|g3`VGHA_(M(GkX?A9r zo&_m}R3)U!l}ipurE*GDu1-#=$~~u4<&qroA9BtiKOlLYxA#NKhl#PY>}*eWPk+4q zywCe|59R-ijlO^S54S_r`77i1N6Jy=??^=W=cq)frlXb}94bGt8pHwjTOgtXI&=ybQ0E1jTBWH%$XsOY7QYhGvc%8#m1g z*R)%$EH8BABG)ZYrI|H#S~LopCeruJ>-bIL74Pabw{5f=q;5OyKNaL_ZK-d@QSWBD znP&G>SJNiv-M&%p1xZ`Wq>CZcGdfxIXzV(^_F~>bYAVmNV(NMpHM5mw(3;ZeTAXUr zHU89^PIVrKQ!u+(*GbZ7ZOc4;KThMq_m7|rGs-rdn*EeQt_Z(0v>15|i2`<3YQs^F z92ktn^Zn7~x|Q3}vB0A_cVV0(XvX(Vk^BB@NE(huIdz(&Glw*2YTqw7e&26qQ9Hq{ z$LG8%F8wh`>O~FavE#$|8g^ZAsw2fAB&N-F8m{MAnzhZ9IMJRCBK;Ix{}6S1xZVkB zVD;yK`H+grk^nOdNdmMmEQt{UpVl=0#%0vSU#?fryX!^KIzKgKfXpCBlepE=scEFT zn8Na|XX#|HV{DVAz0%6FP#ZJZid%Xz$3WwBZA#kvKqoDoyI~R-;})44H(QA&KHZ&d zpj&yy%~svOUBztW;W)*e(XAkdlfV~PtKlxR0W~9!xNv+VGuFFHnm`xwVf5mswz-plzhp2@F=OkBD=<(2&>q{sVRaq)E-NO5~q#PIoVK%OrRJB zNfN9iT5f0s&buH6?TldVg6p^>CK7}SUHGe!2doaGF0R600rv=2LFjb{c zpOvI~AKovFY`V&6d<`e8oR{&LaH{wS39v(UFUEfxiLJ>#4{QiMV-+snIiwznZ8s2a zz_Y>;&fP=mmIM{HU@qW7I$g=4ZGworS(-mNp3*){?0M|fIj$y$v5%9Z%$mXgNvc6tsi3Js{zE7nMa1;1jX{YU^z8{!&iK~QmK@xd#c0La=n8`nHRO+LBYNx?NNB6a#zn$H zIzpI1=OSWRVTOohV;CZqjbS6*7zQD0V;E%UsDe=CgQ8WbQjxAvp+*pE=($KLNDmbXg)BJaG4-O5qQ(k=Wd$ z@{bv?U}pp~#JoN!SzP3%jev;h>8*}Os%=8w#&&Da!O5#Ekn&?;%H!#rbpX zWZjM7 z*?x5Q-sDpZFS{^x?ko_je3&3eg!)ZD{%ZxD1WrKX zM0HJWtDReP1ce5cKv-z?^;wnt%{*` zSknb0a?8zumIn52*rXXlkC{TFQ!$}!WJhuP)9BOtciuP^(>uiJ$40%QOmnlm638ez zy?L~*w9+nCC*Pf~llr}Pd7+rH%4G^E@u&o_U_ZGQoHTZsvZJJL&Ae1=pPP~C?5!?0YTj7*Le#V9VIRS zCEF^H1zZAq;6W5upH++<0cw=g=7`F_R1a{A<}2#L-7nSMI{)25#$uflHt>l-v@HZV z_Vm+BZ_M0SSiJZ?HZMFJ2)G>>KwX^H&z|bxF3eio5Ebn_#fHa%aiF?@G>XGQ8Z^B! z!^M}r&bt<8M8K&tvaDxfLR5}q`Y@A{V}ehMjti*c5oX>Gc%dq>a)cX_4sVfi1$G>Q zFZ7gSl+xCgz;oNQq;4||n>Y*Nu&~3Sv+WYLeC#5Prd3zbws@tgR0LV$xW0x@&3VaE z7hRE47pDFku4t(XVYIUm0i1-u4q3`#v0#pSKu4{XRHp#I;zMQGL4s?5JirhT8X~Cy zg+7o1ECOSQ8W2nXBLD}40j>{6)YiYGST>Qh+;@OGRAR99ovptLviI`QT7G*+*==Y0 zmr_=f-ho^6i^m`Vst(6G##;`(!W}2Di8MOg9D+u0FffdQqZ;Sq4#y(^UQFMX>hdV7 z(^DMa8(#Ac21~_&n~D^4+d<~7yT4UK#e~`%RrxIkf3^qYevI#}yPv}$dcBd6akF2# z#>f^0OXdbvqX$}HU%YJK>ypsLED`S-IF?8&)iAv9-Ceo z8$IT}=N>mF&6%f`cO0`@%{_6#4TFLYfP&EA4u=vaiRtI_b?O3dninBx(!0laBUCL8 zv6Q#9xIh%>CUzJEAdUudyIH>yBt{Egi+J~5N2xdtIMe%(4T<+r;uqW{eyF!svLKJH zVylwp?UrpNOfsYEgtzD=?|r7;<1-TbL|=5y3MiSZ;PAPRh5(bcNxWp6Yq2TBOT(<4 z7MHGhub^NTT$N!CQxZSTvnB%XeGcRTE^4?2Np-YTg}YXrQHU&lUcsjf*QL}tfP3bT zlnyv!$Qi@u0CL70IqV@J_1t<6H*jJK33!AYYcnv245NdcB-^8us73{-3lYKe@FBHY zwjK^Y83sfp5dQ`Z4nTBfJxJHI1!)`SJZqqJ>>Wj&_F+gc50d%ynVIYJGXqVb!a1=0 zC1`0kXcrmIBA+5cI^h|Cz_jzE*MNl~MyCuH=t;<1NFR^SoI7*ebb)=+YDa-AHId*} z4hyZ+rZMeEWuMm_l|Y%p>tkydP(dFG#hi5H-*FZMtQx7v%2$B_nPtf6RqlL+y?L%` z7kH4d8G%{Ze1S{PR9uYCvd!z_ewJ?*+by2JM;d4CT*A3LxEB}Om$I#ahdL{WcNy;E z4>krWN+903P)X4%Hy?9AmXU&{yOL)?6b7bnCj)oQ_Pdg8HP8vPTqBS-CXJa7rswBo z{rTCYTQ|H9{iRP9X5Gn2{bLv5lM`6t1dhii?Fj_Qr@tu>j^PY_A%R_3sF%^cU8s&3 z*!>)=^+!&PexfP|9TB{;R?O+?xKp_4J0oI_4XYAU;h5d9Dt_2my?@}5p8cM`de3pd z=Pw_-I45srrs0NoYl73CGw#{9Bx`Q*I!+anZ5%g8?%B5`@2xq>`Whf;U`kK==x2+c zEY94RzjAf%A{_NBKIi(LN+9=xOJB5mpR%Aw^1HCU3@uNr@1Hqh@_`zuIY+I88gN1e ztNy}bJ$Ec@S3>n1lG1-*NpGgPUPHLSQQXa0cNI~=4cmFn6F9QLK;5r&uVZNWNy}RH zd$u(>lgFavE*O%GhM?M+*k3p@v7p2_Q4&2a>-ooN)Usv-mq9xt7D2etfTHTqV0RBK z8w?KIe2&Y2g1h0EBpxami`?c^kaJ#WMJLAnR`7^M- zI~kGw_=euM-xLa$p53RQFqOjlcKiN+=0?pUSWc?F!tE^8l zj{;tf*Q`<(0VD$Z77Mr$@ow{ShnLTI@p%b&332I@gQQ;g==TKLV(0Q77pQb=)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/android/generic/__init__.pyc b/engines/android/generic/__init__.pyc deleted file mode 100644 index 2a9de57e78b42294b81c7daaf603eca6e6bfcbca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmZSn%*$o3wJJK90SXv_v;z8W|CMVZO^@$s2?nI-Y@dIgmw96)_Gx%nxjIjMFa J(~E(a0RWEO9b*6h diff --git a/engines/android/samsung/ServiceMode.py b/engines/android/samsung/ServiceMode.py index 4433179..d7e65b6 100755 --- a/engines/android/samsung/ServiceMode.py +++ b/engines/android/samsung/ServiceMode.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/android/samsung/ServiceMode.pyc b/engines/android/samsung/ServiceMode.pyc deleted file mode 100644 index 7b62e372a5fdf77f296f0e1935586aa693823276..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7210 zcmchc&u<(_700V*#xtIYopFA7lTFy|WV7t#hiyoVL8FkYJx)wm+X`(*HrYvL+uiMP z+cVwcu9~bZ*%y`@5`upNAtX302gDg^PY4Ol+|V9CLV_cF->dHV<#=J0WNlAPRoAQ6 z_3M4=)pPovqlG_A{o+GM#6M|#zb_0SEo5B$8KNOX(-2P#VNf|G8Y!_F=hB^Arjr{& zE-k#Q*ffNj5kD5<6Cr;1Bq!VvcMr!t*)mWEB}tP~Xs@Cn@2jsl)V2bU4GsR8kz`Vmc{ixv2XGVeTFp zJ{cBnmSmpfg|$-3;RTZ3TQK9FO2d}Yv^S)RY;-uN_vd*GrV7ovr_5%!;Ws?f@frk{Xm3zZVv(3qhopCAvtL)7eWNbEu~n@A#` z>*nKD!$~VN5u%!+R)<+?7@)`bL_Tl0g(UxZ^2QTK+M;<{?BFuc_tu*$cvYA`XHG91-N1cfeo*@6wXz9=AZv&`)s6zsH8=LnMp$=j z)h8UbRoQfXN3lJ~PMxI9KUz>}d@ZitR~dZI*?}uhBlB$XI_2+`?^Wf!Qq{e2&1ZVB z(CqR&HV&lMho!iHguC$V0wWYsQs3=T%s0STn+td?_by@l_~ z@v|$aDH<2?DH`KO!5B4i{K*-oQhZ?0j-o;Gf$=*mCjdYP22xl&Qs53L4h*DOJ}Poz z?{A|2sQ3#VAaqm=^HJd@_yf3xljDJj0u_XK;7&{aG?4`T1|&7L0V*x|X(9>q3`nL~ zCyos*`PW1ehsS_qh9z-?XvyhB5@*JMB#yCZ`dh=eV?Z;7fynw0Gy1m%F&YyyN?;}C zo)m78p{#k`TQ!zcVQO(Eqy_e+<}MRCFMLc1>P~~csL}L2qYE0(XLTVW)Xxe>Sq^j78wjv zXmy>xtaT;>=Wj1qW2jy(@z_pLYdU`{dY?r-x5$hwqOL_FwrIIZq|thll8cmFLc)jv zOIWMgBgiD7%amL}!kppcWne>nW7yng*wkcQ-fs9i-aMYO-hS#3bBHp%pDUmY z{c6gLf-)~6%-@MH7nm?eK^UYU3{qGN(hgzX8*oO)jn_h$yX>B78hj@9-%fyV6f!BX zw)>ed3`2Jx`E?>$hdTdCnjWQ&=2M3{X5vyFrH(FVvM+tj4#FAG;G3y%Xx=zWBj((GJuNYs{@g96_p(x)+ay+%t#@j|3jOsFs z_(h)55q=Fr4=)m3sW*sUXPI9}!7rp4_KJqY-tPyzqF)iu$ScC74j1V4gb*-An2f$O zYp)2t&UN;RwB(NxNq9v^CD8*mI@0;eL=wOnknDIxT4yPd1fK>ZGh(+ye`^>G`8te> zdYZkQX9-14^izb3M3E78fcPc~2PmcpkBU7TL>HhDo=vgWvl#;`PO-Ox2Dr@5&;>ZB z-53h#IQqo6rA81iodyMl6tVo2!vsmgIGSO_cvKw$GO*zTL2g zaZ9@|Y_?z0han>w@L{y|(-qY+DS2Hse~Vp~pW_wsCX%kr4|*wAjB`B}&Nm=fGl$DM zH=t*Dav;PuY>cB|hlarI4nZp1i7-cW>tXAl&LN&#T=8U~Rb4&-pGpf7WQ+L z!AG$XTw;Fcx<7Fp+>5vlqX9{D-9NYvE=F939L5XF)n(mtcs3}56W_)#)^@i$=ukP7at7bi1EI+*2bLU2hg2c_fNBY2|5W?e@ zYb)tnJIbZ7@P+ud-QuH2#^0a@!0+FsjJ z6j_;-`+>6+g+bVs4-ncB1BFUT|rj%rSh8h_Yh>E z<4&ru#X6lvC_Rp3vw`z%tQCchC#9lrh*Z?w+Aa@mwEH095m~ef+{Uq62<>^SynzS^ zIT|k?CZV3!v3K-B{~9GZO^Sz#M&3A$Pl2N)myAm|?M9RD0@K`-9I`+8Di|%79NRC0- zt(F(Kl`X&Fa`&`4ikR+f@LE!Miz8q=oIcmRLH(;)Tw`A#^k$n(q*kN)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) -# ---------------------------------------------------------------------------- +# ---------------------------------------------------------------------------- \ No newline at end of file diff --git a/engines/android/samsung/__init__.pyc b/engines/android/samsung/__init__.pyc deleted file mode 100644 index 49b20b456ddcf68a64e2c2e9d73ccce40a7d9492..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmZSn%*$o3wJJK90SXv_v;z)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/host/__init__.pyc b/engines/host/__init__.pyc deleted file mode 100644 index 07ea7b543c418efe896df817efb1b914896c8c21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 127 zcmZSn%*$o3wJJK90SXv_v;z)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/host/diag/__init__.pyc b/engines/host/diag/__init__.pyc deleted file mode 100644 index d3d4fe20c01bba767906593fab500264b32df867..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmZSn%*$o3wJJK90SXv_v;zH6{UnR%Hd@$q^El_eZN9X7f7DWy57b|7<$ftUdR D!u%TY diff --git a/engines/host/diag/xgoldmod.py b/engines/host/diag/xgoldmod.py index 9457af7..030159a 100644 --- a/engines/host/diag/xgoldmod.py +++ b/engines/host/diag/xgoldmod.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/engines/host/diag/xgoldmod.pyc b/engines/host/diag/xgoldmod.pyc deleted file mode 100644 index dd7be1ee4ac3c646abb1ae8124439af10a9f61e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1557 zcmbtU%Wm676g@-gVM(^7Bt-*d)lE<(KqA0FjUaU&i47M)Y}cV3*mV&QvPi0wDN-g! zfCEsgcHjRf(68$UH0NF_$vTLr8J@Y%GxrY1{cofF)5Cv$A7k}%`TiLO#U4Sxzd-`b z3@!|etQ{l{W-cz=YV9Ja;WVfrtRpfA>i7%z6Zq|-fuMntL6d>v|M?pjBD=|Hp2w;6 zqeVKlah6u{4&}RHk`zfcnS^;I6px2?jq}YUOM+Pzd?e~n_(F(&Ll8pvg^nfQ}ypw@gk7be}QFq0)Mo=1Z6v@$m6V%d*q6m{n!I-Qnofs64I1TeGv%|xTj4o%R z`7lf;aT*rGKeECOgLpIlNG}+`x9QiJ*&Zo`RL5 zFzkI4+(KW7-(KygFWNf{K=TfEN?=NcYoayR$2dC+fY;~OPa)uB@D*!+q+O2UB-E33 za_CFP3+|WgkS0BgWmfpT&Ofl)?AgmbT|KhW!My|j&2w*mw~BUraCoFf-t%33AMh=G zfAWiFv+w4iuDx^he)GY*kW^6B>G_~7SaQu?y;=vZTxQZkv z+Ro-uC#~5EZ+T*^E|pHGkK^Erz8)#=e3TdAJ~>IhiY-nsEwf>|rpI@eW8K^~HFJl! z!ACS-^Vu{VK23AW+;;}bP3{ukPe-%R_pOxI_j#)<5-vR{y%xuNK=g^UqR;>CJ=uMi zL+_b}>DG?)GF+vN7Iu+KT3SF4!8psq$FqZMqD-`~m1x!c>~b28t%m(#avFW7+WL=j N_ZHIL9_!h5-UFFsCSd>o diff --git a/engines/host/serial/AT.py b/engines/host/serial/AT.py index 7158ae2..0a4f211 100644 --- a/engines/host/serial/AT.py +++ b/engines/host/serial/AT.py @@ -1,4 +1,12 @@ # -*- coding: utf-8 -*- + +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# )penthertz.com> wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# ---------------------------------------------------------------------------- + from __future__ import print_function import serial diff --git a/engines/host/serial/AT.pyc b/engines/host/serial/AT.pyc deleted file mode 100644 index 9803efebbd0ed55a80b65a577a687c2a8bee6f9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2677 zcmbtW-EJFI5T3OiJ2nZlPz4n(SV}9oCDcvAMX6efF=_!dZe?3S4T9Bn_c+;Pz3c8d zrj6uWp!NxPi*m;+@Bq9F4*=gcHcrFO1&tkV=A1J-Ki_;ayXD_k8@I3g{B0!jPZ|F| z6HjagA;zC4smREa9Zx*2OOlpkrzCM%Oj(AW#1(li@=WC6PDRX;#7lBel44&>MdGSF z!>v^@H8EA$U#1>*JTB@I*K`3_Fxzh~!)5XZK1~mjdmWc?kz_6yPO``)dDe9$?6n7r zXu15H(S8lV2!n*poiZawPzVU|Q$ScH6*LsY{v2T~&tu;~Bv7d8Ww*V@kGQT}KYj$0<%O)_I!d%1P3nU7X`aCLmBMgka5ToBNe zWmMv6E_6U|n#(T`5|JaM;K{z$83-Yxqq02xNv36{37k-@FTVRxjw&*(=vIYWM@xcI zOqVFL-b+$6xdevi_kq6Fl~w`q%xYDS>;H9JlPNSxa!`}vg-o%8`KsJ}{6Zc#`S%Sr z`ppKSw!mB({!5<+VPTEm9(>rj|Db>Cwx49fycmUK%n7|DYi?Y=;adk%?fOwZwtivU zq{vJ>-#nq7PuvYZP9moU?c&T5SoL+o2OZ`hUtV`)?Rv6=YeEKCN)tEy=(?U+#*9uHx!%FJ0wqs@eAK~HHE?Lhsym9J z5xRz+GUKvvWL}w6L>;sQ$OKqxa1L8it$J^IYu+2UzK8FMcg~BLBl95dlxUwoK*d0Y zBkdc~3ax_~K;nTMpyxs&9idxh`JpmzD*GC2EXupuPz-wtB%ygyB+e-F3lqjEI-|FS zZS6wEZl=n9ER3C`?v;Tcn7hUig?AxZLLpw=TlE^=N-1LA42VC?{YwZ)7A-YL09{lP z6zgDFii>Ow9AWygwREDQ?T7_BNZV{!k~Ja~bH31OS2={fh4Z&?`3saw$@=E{g-iCr zYU7x7FTq5t2F1km-iDy`Fq!g;MvwWm-RW$1I|^kuarp=gREkkh5MLQNA{Fh0*{*qT zZ@c>eR&(&GfNupqB@RimAkI5j{5x?J4(fGJFk=(U;I2lhna-A)BM~@N^pmVGyNPwC zxB^p__E`Fa9(BB)VEs$MgVH6PoHN#==zXQ8{S9|6h6=}7M*;G?#y!c419vz!K9Tn) zmh-ATz{nbn!Yn=>MZ9Z1)$l<1$DLPCn5XilkJ0G2QCw?M6S;MNV@tR0_P6~!OAme6 z_cuP)y{)^tb<&DX#c`2G#&UeJpB7#$>D3;5-+$Qe-0$A`>h3KNa|2(Lru+BW5U&~a zSRiH_oQ`8>VP?j$If4V&yo$|Pv1)a%+vFsfKO{L4gTRrQK>(a5DVMBkH^&H}&||~v zFzK)synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) -# ---------------------------------------------------------------------------- +# ---------------------------------------------------------------------------- \ No newline at end of file diff --git a/engines/host/serial/__init__.pyc b/engines/host/serial/__init__.pyc deleted file mode 100644 index 09341637cd7641e3842f778b440d6d669ab17d6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmZSn%*$o3wJJK90SXv_v;z)penthertz.com> wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# ---------------------------------------------------------------------------- diff --git a/engines/sdr/grgsm_scanner.py b/engines/sdr/grgsm_scanner.py new file mode 100755 index 0000000..c6bb74a --- /dev/null +++ b/engines/sdr/grgsm_scanner.py @@ -0,0 +1,456 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @file +# @author (C) 2015 by Piotr Krysik +# @author (C) 2015 by Roman Khassraf +# @adaptation (C) 2020 by Sebastien Dudek (@FlUxIuS) +# @section LICENSE +# +# GRGSM Scanner Modmobmap edition +# +# Gr-gsm is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Gr-gsm is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gr-gsm; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# +# +from core.mLog import * + +from gnuradio import blocks +from gnuradio import gr +from gnuradio import eng_notation +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.filter import pfb +from math import pi +from optparse import OptionParser + +import grgsm +import numpy +import os +import osmosdr +import pmt +import time +import sys + +# from wideband_receiver import * + +class receiver_with_decoder(grgsm.hier_block): + def __init__(self, OSR=4, chan_num=0, fc=939.4e6, ppm=0, samp_rate=0.2e6): + grgsm.hier_block.__init__( + self, "Receiver With Decoder", + gr.io_signature(1, 1, gr.sizeof_gr_complex * 1), + gr.io_signature(0, 0, 0), + ) + self.message_port_register_hier_out("bursts") + self.message_port_register_hier_out("msgs") + + ################################################## + # Parameters + ################################################## + self.OSR = OSR + self.chan_num = chan_num + self.fc = fc + self.ppm = ppm + self.samp_rate = samp_rate + + ################################################## + # Variables + ################################################## + self.samp_rate_out = samp_rate_out = 1625000.0 / 6.0 * OSR + + ################################################## + # Blocks + ################################################## + self.gsm_receiver_0 = grgsm.receiver(OSR, ([chan_num]), ([])) + self.gsm_input_0 = grgsm.gsm_input( + ppm=ppm, + osr=OSR, + fc=fc, + samp_rate_in=samp_rate, + ) + self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() + self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate, osr=4) + self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(0) + + ################################################## + # Connections + ################################################## + self.msg_connect(self.gsm_bcch_ccch_demapper_0, 'bursts', self, 'bursts') + self.msg_connect(self.gsm_bcch_ccch_demapper_0, 'bursts', self.gsm_control_channels_decoder_0, 'bursts') + self.msg_connect(self.gsm_clock_offset_control_0, 'ctrl', self.gsm_input_0, 'ctrl_in') + self.msg_connect(self.gsm_control_channels_decoder_0, 'msgs', self, 'msgs') + self.msg_connect(self.gsm_receiver_0, 'C0', self.gsm_bcch_ccch_demapper_0, 'bursts') + self.msg_connect(self.gsm_receiver_0, 'measurements', self.gsm_clock_offset_control_0, 'measurements') + self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) + self.connect((self, 0), (self.gsm_input_0, 0)) + + def get_OSR(self): + return self.OSR + + def set_OSR(self, OSR): + self.OSR = OSR + self.set_samp_rate_out(1625000.0 / 6.0 * self.OSR) + self.gsm_input_0.set_osr(self.OSR) + + def get_chan_num(self): + return self.chan_num + + def set_chan_num(self, chan_num): + self.chan_num = chan_num + + def get_fc(self): + return self.fc + + def set_fc(self, fc): + self.fc = fc + self.gsm_input_0.set_fc(self.fc) + + def get_ppm(self): + return self.ppm + + def set_ppm(self, ppm): + self.ppm = ppm + self.gsm_input_0.set_ppm(self.ppm) + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.gsm_input_0.set_samp_rate_in(self.samp_rate) + + def get_samp_rate_out(self): + return self.samp_rate_out + + def set_samp_rate_out(self, samp_rate_out): + self.samp_rate_out = samp_rate_out + + +class wideband_receiver(grgsm.hier_block): + def __init__(self, OSR=4, fc=939.4e6, samp_rate=0.4e6): + grgsm.hier_block.__init__( + self, "Wideband receiver", + gr.io_signature(1, 1, gr.sizeof_gr_complex * 1), + gr.io_signature(0, 0, 0), + ) + self.message_port_register_hier_out("bursts") + self.message_port_register_hier_out("msgs") + self.__init(OSR, fc, samp_rate) + + def __init(self, OSR=4, fc=939.4e6, samp_rate=0.4e6): + ################################################## + # Parameters + ################################################## + self.OSR = OSR + self.fc = fc + self.samp_rate = samp_rate + self.channels_num = int(samp_rate / 0.2e6) + self.OSR_PFB = 2 + + ################################################## + # Blocks + ################################################## + self.pfb_channelizer_ccf_0 = pfb.channelizer_ccf( + self.channels_num, + (), + self.OSR_PFB, + 100) + self.pfb_channelizer_ccf_0.set_channel_map(([])) + self.create_receivers() + + ################################################## + # Connections + ################################################## + self.connect((self, 0), (self.pfb_channelizer_ccf_0, 0)) + for chan in xrange(0, self.channels_num): + self.connect((self.pfb_channelizer_ccf_0, chan), (self.receivers_with_decoders[chan], 0)) + self.msg_connect(self.receivers_with_decoders[chan], 'bursts', self, 'bursts') + self.msg_connect(self.receivers_with_decoders[chan], 'msgs', self, 'msgs') + + def create_receivers(self): + self.receivers_with_decoders = {} + for chan in xrange(0, self.channels_num): + self.receivers_with_decoders[chan] = receiver_with_decoder(fc=self.fc, OSR=self.OSR, chan_num=chan, + samp_rate=self.OSR_PFB * 0.2e6) + + def get_OSR(self): + return self.OSR + + def set_OSR(self, OSR): + self.OSR = OSR + self.create_receivers() + + def get_fc(self): + return self.fc + + def set_fc(self, fc): + self.fc = fc + self.create_receivers() + + def get_samp_rate(self): + return self.samp_rate + + +class wideband_scanner(gr.top_block): + def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=24, ppm=0, args=""): + gr.top_block.__init__(self, "Wideband Scanner") + + self.rec_len = rec_len + self.sample_rate = sample_rate + self.carrier_frequency = carrier_frequency + self.ppm = ppm + + # if no file name is given process data from rtl_sdr source + print "Args=", args + self.rtlsdr_source = osmosdr.source(args="numchan=" + str(1) + " " + + str(grgsm.device.get_default_args(args))) + #self.rtlsdr_source.set_min_output_buffer(int(sample_rate*rec_len)) #this line causes segfaults on HackRF + self.rtlsdr_source.set_sample_rate(sample_rate) + + # capture half of GSM channel lower than channel center (-0.1MHz) + # this is needed when even number of channels is captured in order to process full captured bandwidth + + self.rtlsdr_source.set_center_freq(carrier_frequency - 0.1e6, 0) + + # correction of central frequency + # if the receiver has large frequency offset + # the value of this variable should be set close to that offset in ppm + self.rtlsdr_source.set_freq_corr(ppm, 0) + + self.rtlsdr_source.set_dc_offset_mode(2, 0) + self.rtlsdr_source.set_iq_balance_mode(0, 0) + self.rtlsdr_source.set_gain_mode(True, 0) + self.rtlsdr_source.set_bandwidth(sample_rate, 0) + self.rtlsdr_source.set_gain(gain, 0) + self.rtlsdr_source.set_if_gain(32, 0) + self.rtlsdr_source.set_bb_gain(30, 0) + self.head = blocks.head(gr.sizeof_gr_complex * 1, int(rec_len * sample_rate)) + + # shift again by -0.1MHz in order to align channel center in 0Hz + self.blocks_rotator_cc = blocks.rotator_cc(-2 * pi * 0.1e6 / sample_rate) + + self.wideband_receiver = wideband_receiver(OSR=4, fc=carrier_frequency, samp_rate=sample_rate) + self.gsm_extract_system_info = grgsm.extract_system_info() + + self.connect((self.rtlsdr_source, 0), (self.head, 0)) + self.connect((self.head, 0), (self.blocks_rotator_cc, 0)) + self.connect((self.blocks_rotator_cc, 0), (self.wideband_receiver, 0)) + self.msg_connect(self.wideband_receiver, 'msgs', self.gsm_extract_system_info, 'msgs') + + def set_carrier_frequency(self, carrier_frequency): + self.carrier_frequency = carrier_frequency + self.rtlsdr_source.set_center_freq(carrier_frequency - 0.1e6, 0) + + +class channel_info(object): + def __init__(self, arfcn, freq, cid, lac, mcc, mnc, ccch_conf, power, neighbours, cell_arfcns): + self.arfcn = arfcn + self.freq = freq + self.cid = cid + self.lac = lac + self.mcc = mcc + self.mnc = mnc + self.ccch_conf = ccch_conf + self.power = power + self.neighbours = neighbours + self.cell_arfcns = cell_arfcns + + def get_verbose_info(self): + i = " |---- Configuration: %s\n" % self.get_ccch_conf() + i += " |---- Cell ARFCNs: " + ", ".join(map(str, self.cell_arfcns)) + "\n" + i += " |---- Neighbour Cells: " + ", ".join(map(str, self.neighbours)) + "\n" + return i + + def get_ccch_conf(self): + if self.ccch_conf == 0: + return "1 CCCH, not combined" + elif self.ccch_conf == 1: + return "1 CCCH, combined" + elif self.ccch_conf == 2: + return "2 CCCH, not combined" + elif self.ccch_conf == 4: + return "3 CCCH, not combined" + elif self.ccch_conf == 6: + return "4 CCCH, not combined" + else: + return "Unknown" + + def getKey(self): + return self.arfcn + + + @Cellslogger + def attr2dic(self): + cell = {} + cid2 = str(self.cid) + '_' + str(self.arfcn) + cell[self.cid] = {'PLMN' : str(self.mcc)+str(self.mnc), + 'arfcn' : int(self.arfcn), + 'type' : '2G', + 'cid' : str(self.cid)} + return cell + + + def __cmp__(self, other): + if hasattr(other, 'getKey'): + return self.getKey().__cmp__(other.getKey()) + + def __repr__(self): + return "%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % ( + self.__class__, self.arfcn, self.freq, self.cid, self.lac, + self.mcc, self.mnc, self.ccch_conf, self.power, + self.neighbours, self.cell_arfcns) + + def __str__(self): + return "ARFCN: %4u, Freq: %6.1fM, CID: %5u, LAC: %5u, MCC: %3u, MNC: %3u, Pwr: %3i" % ( + self.arfcn, self.freq / 1e6, self.cid, self.lac, self.mcc, self.mnc, self.power) + + + +def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): + signallist = [] + channels_num = int(samp_rate / 0.2e6) + for arfcn_range in grgsm.arfcn.get_arfcn_ranges(band): + first_arfcn = arfcn_range[0] + last_arfcn = arfcn_range[1] + last_center_arfcn = last_arfcn - int((channels_num / 2) - 1) + + current_freq = grgsm.arfcn.arfcn2downlink(first_arfcn + int(channels_num / 2) - 1) + last_freq = grgsm.arfcn.arfcn2downlink(last_center_arfcn) + stop_freq = last_freq + 0.2e6 * channels_num + + while current_freq < stop_freq: + + if not debug: + # silence rtl_sdr output: + # open 2 fds + null_fds = [os.open(os.devnull, os.O_RDWR) for x in xrange(2)] + # save the current file descriptors to a tuple + save = os.dup(1), os.dup(2) + # put /dev/null fds on 1 and 2 + os.dup2(null_fds[0], 1) + os.dup2(null_fds[1], 2) + + # instantiate scanner and processor + scanner = wideband_scanner(rec_len=6 - speed, + sample_rate=samp_rate, + carrier_frequency=current_freq, + ppm=ppm, gain=gain, args=args) + + print "record" + # start recording + scanner.start() + scanner.wait() + scanner.stop() + print "record2" + + freq_offsets = numpy.fft.ifftshift( + numpy.array(range(int(-numpy.floor(channels_num / 2)), int(numpy.floor((channels_num + 1) / 2)))) * 2e5) + detected_c0_channels = scanner.gsm_extract_system_info.get_chans() + + found_list = [] + if detected_c0_channels: + chans = numpy.array(scanner.gsm_extract_system_info.get_chans()) + found_freqs = current_freq + freq_offsets[(chans)] + + cell_ids = numpy.array(scanner.gsm_extract_system_info.get_cell_id()) + lacs = numpy.array(scanner.gsm_extract_system_info.get_lac()) + mccs = numpy.array(scanner.gsm_extract_system_info.get_mcc()) + mncs = numpy.array(scanner.gsm_extract_system_info.get_mnc()) + ccch_confs = numpy.array(scanner.gsm_extract_system_info.get_ccch_conf()) + powers = numpy.array(scanner.gsm_extract_system_info.get_pwrs()) + + for i in range(0, len(chans)): + cell_arfcn_list = scanner.gsm_extract_system_info.get_cell_arfcns(chans[i]) + neighbour_list = scanner.gsm_extract_system_info.get_neighbours(chans[i]) + + info = channel_info(grgsm.arfcn.downlink2arfcn(found_freqs[i]), found_freqs[i], + cell_ids[i], lacs[i], mccs[i], mncs[i], ccch_confs[i], powers[i], + neighbour_list, cell_arfcn_list) + + found_list.append(info) + + scanner = None + + + if not debug: + # restore file descriptors so we can print the results + os.dup2(save[0], 1) + os.dup2(save[1], 2) + # close the temporary fds + os.close(null_fds[0]) + os.close(null_fds[1]) + if prn: + prn(found_list) + signallist.extend(found_list) + + current_freq += channels_num * 0.2e6 + return signallist + + +def argument_parser(): + parser = OptionParser(option_class=eng_option, usage="%prog: [options]") + bands_list = ", ".join(grgsm.arfcn.get_bands()) + parser.add_option("-b", "--band", dest="band", default="GSM900", + help="Specify the GSM band for the frequency.\nAvailable bands are: " + bands_list) + parser.add_option("-s", "--samp-rate", dest="samp_rate", type="float", default=2e6, + help="Set sample rate [default=%default] - allowed values even_number*0.2e6") + parser.add_option("-p", "--ppm", dest="ppm", type="intx", default=0, + help="Set frequency correction in ppm [default=%default]") + parser.add_option("-g", "--gain", dest="gain", type="eng_float", default=24.0, + help="Set gain [default=%default]") + parser.add_option("", "--args", dest="args", type="string", default="", + help="Set device arguments [default=%default]." + " Use --list-devices the view the available devices") + parser.add_option("-l", "--list-devices", action="store_true", + help="List available SDR devices, use --args to specify hints") + parser.add_option("--speed", dest="speed", type="intx", default=4, + help="Scan speed [default=%default]. Value range 0-5.") + parser.add_option("-v", "--verbose", action="store_true", + help="If set, verbose information output is printed: ccch configuration, cell ARFCN's, neighbour ARFCN's") + parser.add_option("-d", "--debug", action="store_true", + help="Print additional debug messages") + + """ + Dont forget: sudo sysctl kernel.shmmni=32000 + """ + return parser + +def main(options = None): + if options is None: + (options, args) = argument_parser().parse_args() + + if options.list_devices: + grgsm.device.print_devices(options.args) + sys.exit(0) + + if options.band not in grgsm.arfcn.get_bands(): + parser.error("Invalid GSM band\n") + + if options.speed < 0 or options.speed > 5: + parser.error("Invalid scan speed.\n") + + if (options.samp_rate / 0.2e6) % 2 != 0: + parser.error("Invalid sample rate. Sample rate must be an even numer * 0.2e6") + + def printfunc(found_list): + for info in sorted(found_list): + print info + if options.verbose: + print info.get_verbose_info() + print "" + do_scan(options.samp_rate, options.band, options.speed, + options.ppm, options.gain, options.args, prn = printfunc, debug = options.debug) + +if __name__ == '__main__': + main() diff --git a/modmobmap.py b/modmobmap.py index 5136de4..3f26ccd 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- @@ -12,35 +12,11 @@ from utils.logprocess import * -if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Mobile network mapping tool with cheap equipments') - parser.add_argument('-m', '--module', dest='module', required=False, default='servicemode', - help='Module to use (e.g: "servicemode" by default)') - parser.add_argument('-n', '--networks', dest='networks', required=False, default=None, - help='Networks in MCCMNC format splitted with commas') - parser.add_argument('-o', '--cached_operator', dest='operators', required=False, default=False, action='store_true', - help='Use operator in cache to speed up the passive scan') - parser.add_argument('-s', '--sdk', dest='androidsdk', required=False, default='/opt/Android', - help='Android SDK path') - parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, - help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') - parser.add_argument('-f', '--file', dest='file', required=False, default=None, - help='File to parse. For the moment it could be used in combination with AT mode host.') - args = parser.parse_args() - sm = ADBshell() - kb = mKB() - kb.config['androidsdk'] = args.androidsdk - sm.androidsdkpath = args.androidsdk - if args.file is not None: - kb.config['file'] = args.file - if args.module == "xgoldmod": - startXgoldmodCollect() - else: - startServiceModeCollect() +def phone_actions(args): cops = None if args.networks is not None: printInfo('=> Manual MCC/MNC processing...') - cops = processManualMCCMN(args.networks) + cops = processManualMCCMN(args.networks) else: printInfo('=> Requesting a list of MCC/MNC. Please wait, it may take a while...') operators = load_operators() @@ -49,6 +25,8 @@ cops = operators if cops is None: if args.atmode is None: + sm = ADBshell() + sm.androidsdkpath = args.androidsdk cops = sm.getCOPSfromRIL() else: at = AT(args.atmode) @@ -65,3 +43,35 @@ else: kb.config['tty_file'] = args.atmode processOperatorAT(operators) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Mobile network mapping tool with cheap equipments') + parser.add_argument('-m', '--module', dest='module', required=False, default='servicemode', + help='Module to use (e.g: "servicemode" by default).') + parser.add_argument('-b', '--bands', dest='bands', required=False, default=None, + help='Bands to use for SDR engines (for GSM: GSM900, DCS1800, GSM850, PCS1900, GSM450, GSM480, GSM-R). A list can be provided separated with commas.') + parser.add_argument('-n', '--networks', dest='networks', required=False, default=None, + help='Networks in MCCMNC format splitted with commas') + parser.add_argument('-o', '--cached_operator', dest='operators', required=False, default=False, action='store_true', + help='Use operator in cache to speed up the passive scan.') + parser.add_argument('-s', '--sdk', dest='androidsdk', required=False, default='/opt/Android', + help='Android SDK path') + parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, + help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') + parser.add_argument('-f', '--file', dest='file', required=False, default=None, + help='File to parse. For the moment it could be used in combination with AT mode host.') + args = parser.parse_args() + + kb = mKB() + kb.config['androidsdk'] = args.androidsdk + if args.file is not None: + kb.config['file'] = args.file + if args.module == "xgoldmod": + startXgoldmodCollect() + elif args.module == "grgsm": + processGRGSM(args.bands) + else: + startServiceModeCollect() + if args.module != "grgsm": + phone_actions(args) diff --git a/requirements.txt b/requirements.txt index b6be06a..f6c1a1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -serial +pyserial diff --git a/utils/.logprocess.py.swp b/utils/.logprocess.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..e5a21d400f60dfd1cc61454f138f5469e0fe1d11 GIT binary patch literal 16384 zcmeI3ZHOIL8OM*cN!z5c#oA~o!pU8iJ2!iG_9bgvH`&DOW|MA{-KM)6Tg}U5?#!8c zCp&lMGUv?Ry|F4)5J6B83R((93Pw>s6wwb_#1A59u}H-?@D-&WqKMEBMM3cYoSC^V zn{2m98jUamznz(Lp68r1&pFSTbDp_d9sS_^0-rR;7>;`xyL9>I=U?7^CwuZ0#$qWV zO5W;-t8t*>t)v+H7!^3O5IT*p+OV1cv)SIdkX$0SKyHC+w?M4i z;mKWW-}u-lDGwC(@cZ6=`r6CMHF68&7RW7-TOhYUZh_naxdn0y-v*xp3Y-Iv zf(h^*@GkI9up8_IJHTDw*LO4a1MqpU4qR{+EPzSyKCmC`0lUC&cQW=>a0z?`d=^{; z^Wc8)4saiMZ3kn22Hyu?15bl5fiHqKsDd%@Zm=Ev@h-+*1TTQ^f$xInfC3Uk;5=9a zyTL1WGWH|zJa`VQffy*T1V+GvU_>)L7EqU0(0Qs=+l?Lr@&)?`uKjZ^}#ne z3e$)9a?4Y8-3w~GYT2t?h1`l&INS&wQ7CgOs!flV*hYP+EG1-P&5#Y#u3JG(EDF^M zqt%smQzRD0^=!s6>#_sq~aemaOm&67$*!r^WdHn<%}kq8tg<-+UN z;y^1=?yrSd0)Im@(}zaJ|}@VmGsRE>(cUk)t!RE_~l8F-N#O{e96RX-kl6bXrxKf;;e@ zLt1NM7P``~>2JRQbP_69t(uOdtTV;sg^Er~YtPEbp5vJ1%j7{QN37eTskm`Mw5y>N zIr9O`9>q;n=F4q#L1S*+Q)p0D%Et4JyPu{0C+_!VR(lQZcLUYli2HS_y{YbpTH=oH z-YoaC6nWE%VX2Bz?Zg+7>%<8%H$-N|g)hSmuI6wnSMj%I~T>SErM4EMj@FkNx966t)XI~ME4LWXqC#K zV_uM9K+~%0hn6yw*AOQCF-nPiS~yfl&~)NPQyO9QLK%~qgZXiKqReF&smiKo%W0ah z5x36wjtjedG=RPE5m)M!3(V&>%Oxgn`wl-f|1I=6UqHk-jRVKTob9(GPrdt(Fg-HyEBLCNpqzh3Cl4cTN7#;(`qfUs`%}tZKQ z7W(+@sgu4HbnTC)X;)OOXYh2z(u`$Y3Of?2`wA|Oj*g8L%e-ZIDqHbfpItV*tgh^b z%oRm85+(Hkz!ZC`k{v)hfma))r_v zW2qOD>u1+!s~%NMuacDZCt8=LqKSiL!rJ|lGxFYG#k)ZJ|*U0a{_3 z*+|_WUa7dTiX%~}WEr~mkQ&&^g8|t9S9Nr=RI%$)KVjvMNy)>yrya)JwgO&_+Z^+= z#j8R@v}}a4#ZkbI`KQgXEU|6js> z^hNAdY5zZyZVqYR{~howXn_xdgWv#|0)yaH?EQZMz6m}79tQK^Aus_3z#ZT+_WCb@ z=fP8;4bB6K6PyHx!Gqv6?D4+^J_$Uq1oi^j``-YxT(a0(m; z4}gDQZ~rUsEZ715fW15I@1F*r22X%Gr~wx|3LXG|hb?{s$R3vK zmg?F_Wm=hc7UcLU5DEOdC)UNHad_%%a8@BI(-+u42Qfs+pwe&QMh09J+?iI;S^&E}OomlyH*H%C*GWI+99 zM#nJ%2PHmH1rEjd=$vf#>8cy4$XeA6tzeINeChb|!j%zK(xl-|XIb&_&7|vJSO22H zvf{hv0*W49DkR@3y2*4!Sre0^h5nio8J+juP4Z67E|0x`bdyXJI=PwRQ7BG!6uZxb zt~omVOve;yjHjPew5hry+zBg~G6Q2=>@TM_N0bzSmhn*&e+&3jhX`jaiO1;P z@9zo^;b7BJDjLVI#WaSv0mN(A>LXIgSz-&!@^E|-rQVim#?1zXp+`^_1551yi}i(6)96>$;9J+3{sS`+ BlX3t6 literal 0 HcmV?d00001 diff --git a/utils/__init__.py b/utils/__init__.py index d13e961..8df667a 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -2,7 +2,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/utils/__init__.pyc b/utils/__init__.pyc deleted file mode 100644 index b30af7d96a3d1e826cd799b4a05373642e47909d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmZSn%*$o3wJJK90SXv_v;zs)$(+8P626xRwGD{ymMF65jp&u=K_a(l?3S^ntAN=& zOR|+JPFtAkAXEzw6G@9Tq|F)6_Qno9KJ!;NQ_;URTV&Ua?(n_ z*>S-R3wBhngH*Al=43yevjq+t(M70J0Iq)_3JU^T`HXSKOQuXF@Ru*aBB55+2{eFQ z2cQ|Q{dUh6hK_DJ!#m$JV|3FOz8@HV-xk3j=xerh)gBBD@q=F1Wp5@^aq{RQAp>d$ z%v)ud_HMH%&1UIz>8jbIbY6Smd!OjHtS#U*y+b;O{kEK8R5;$i1t+qfM>({V@T#u_Z+x{VM3OdV6 KIOhTsf<6I$uX8;B diff --git a/utils/eu_arfcn_calc.py b/utils/eu_arfcn_calc.py index 157a721..440bb95 100755 --- a/utils/eu_arfcn_calc.py +++ b/utils/eu_arfcn_calc.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- diff --git a/utils/logprocess.py b/utils/logprocess.py index 3118165..3fb6ef5 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -3,9 +3,10 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# ---------------------------------------------------------------------------- from __future__ import print_function from engines.android.generic.ADBshell import * @@ -19,8 +20,10 @@ import argparse import json + kb = mKB() + def statesmv(func, msg=None, wait=10, arg=None): if msg is not None: print (bcolors.OKBLUE+msg+bcolors.ENDC) @@ -30,22 +33,26 @@ def statesmv(func, msg=None, wait=10, arg=None): func() time.sleep(wait) + def bringTestMode(): sm = ADBshell() sm.androidsdkpath = mKB.config['androidsdk'] statesmv(sm.pushsecretcode, arg='4636', wait=2) + def bringServiceMode(): sm = ADBshell() sm.androidsdkpath = mKB.config['androidsdk'] statesmv(sm.pushsecretcode, arg='0011', wait=2) + def startXgoldmodCollect(): xg = xgoldmod() th = Thread(target=xg.parseFifo) th.daemon = True th.start() + def startServiceModeCollect(): sm = ServiceMode() sm.androidsdkpath = mKB.config['androidsdk'] @@ -55,9 +62,11 @@ def startServiceModeCollect(): th.daemon = True th.start() + def printInfo(string): print (bcolors.OKBLUE+string+bcolors.ENDC) + def saveCells(obj): import time jscells = json.dumps(obj, indent=4, sort_keys=True) @@ -90,6 +99,7 @@ def processOperatorAT(operators): cells = kb.data['SM_cells'] saveCells(cells) + def processOperatorADB(operators): sm = ADBshell() sm.androidsdkpath = mKB.config['androidsdk'] @@ -114,6 +124,42 @@ def processOperatorADB(operators): saveCells(cells) process = sm.grablogcat() + +def scanGRGSM(band): + from engines.sdr.grgsm_scanner import do_scan + def trigfunc(found_list): + for info in sorted(found_list): + info.attr2dic() # trigger log + do_scan(2e6, band, 4, 0, 30.0, "", trigfunc, False) + + +def processGRGSM(bands): + state = True + cbands_list = ["GSM900", + "DCS1800", + "GSM850", + "PCS1900", + "GSM450", + "GSM480", + "GSM-R"] + + if bands is None: + bands_list = cbands_list + else: + bands_list = bands.split(',') + + while state: + try: + for band in bands_list: + statesmv(scanGRGSM, + "=> Switching to %s band" % band, arg=band) + except (KeyboardInterrupt, SystemExit): + state = False + kb = mKB() + cells = kb.data['SM_cells'] + saveCells(cells) + + def processManualMCCMN(string): dic_ = {} splitted = string.replace(' ','').split(',') @@ -121,6 +167,7 @@ def processManualMCCMN(string): dic_[code] = code return dic_ + def load_operators(): try: f = open('cache/operators.json', 'r') @@ -134,7 +181,8 @@ def load_operators(): f.close() except: return None - + + def saveMCCMNC(obj): jscache = json.dumps(obj, indent=4, sort_keys=True) f = open('cache/operators.json', 'w+') diff --git a/utils/logprocess.pyc b/utils/logprocess.pyc deleted file mode 100644 index 41002b185e01be01cc512b618c951d1ffaa813fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5575 zcmds5-EtJy5k9lK`dMiuKo|kWaVB=Km!GTvJ0wLgAS9qDthFj z=A1>^6uL;^t2~46QR+ZgHR63zLlWJ|!&Bs_xt<_`<{FGXoQhHjwQflpliYqD}6*{KA zDXXPGCR+btEjWDV1NwM%KOvqsh84}fiX6q zCeMzjtx@%|q}YuOmqmnTeGIR#d}%Y!G$svBVA;PO~lG&BX;_ zY|?Q{OsaLa&RwKmPR~PhOj|m3!o*s3ghjiKA0@&a}z<6q_M3+4e zWwgo^63o^Jy*7s4;6EeKOUdbldo(Q#5@vCcC$WjQ1DaNj^6AY_ZU$3mB{XH7lSRJy z#rtMcr>PvX^W?rLEy}Zvq%D4Nuva&fdF%(6)*5QEd z6>ThZs(*wILm8D<^-lf|^c0-L-Ur&bcJ2E0BiadOID<$D-XS?d!s7?CAadZ~EIB-H z=@)#r9Cuk4FOo>}#2=yW=!t15dY^d44KRm218zZQ05Fud2Yd;*TJR7!4ZH%H6SQ!T zrWn=2iM2hj{BAo>;k|LdSJ)~@H!O^Pm~7=pJCIW+wY9s$W~s`wIvhgESDBs@ICl^+Dyk|=6yUs2;! zQL8G7nmAAtwa|2KaRF?7k}n}SWTd0+Ku`zol5n+PuU&-ehyqb)gZDY`LlPfEv?d-C ze8482w{#nNn`rEiL<6N==MZ7(@G|C&In^Re=j|C}XPcG37ybY(~k z7*qp-Fkny(Xp@8ZZ!Gb8j8llCG1)xMHu788)6llcizp{w$v29ueK7EHh=r6*7ng7d zp@-oQPLJ@nhiEt=!4VTAb|P2I?jc?xQX+Sh)ocvwm((86Q8|=O*q~d$TgI7tIdhn1 zC}&fWq<|pFVx8H9iV>`sys)ip-8Y88D?$V{t&4GE%jB6H=%SIIohycp{`Hk-{sQOt zCVZj&(D)Zkoo@(81a4d@7>j$It`X;v=0=)_R%YZ~NI(tk6p3{SEJ|~u16rZZ0SV&y z`j*?3R@*Wnnyk-4q&;eR~f0Fu*tyPn9OFq)83Rf;Y>*L4NdqR8gREQSP@x_ zHUt`O-ZWO_FEfCstu7&+kcf6x}6xS3my9#Mc(nFUQxiD z{+FLGH4OvKXLtOC%`j^NRsPb#!rW4G!QaS>TksUgQ|8A>Y7b=kQJOmdY|b2dL9<>;|%&LdR;3^m-|p( z=fN&2GP?T1Fg04-Iu30Z{1ja-wGmK2N)g)q5-_wa7(^rmlDJrkGFi;xMY`OPF!q)~ zna3EEd|wRSI=}LW?+}my7d3AbS*#4Mim+VuPT?WX=M0cD3N9iniPs@={)q;h4#8;{ z`3NDVE-3_opWVL@AjRL0AV=aJs{l!Tf}9aac7Oqp!)OTPAaW8TZUoWqHRKF?UqjBY z_sz(uG64>d^PM1PQcw=K;}9|iyXq=e;;hi!G>itfz;2pYSrL59 zsgxv6qLxHE!$GTKQQ&{4s--aNg(+hDQnQCw7{*5h_+Nk`rd^p^M$a$={0WWz9~cFO zD%g{gpx&iwpbG>Dr~_xmnISiR(1wz>E6O}(Gj><-ZxxCd7<~&!$K9J8;JUv6xOFRm z-dVYrqwtlhB>~JNT;r>dSGUJi@vXcq!(AOROmV@dgXfx>uc5oM!DrI&~XkD)W-h^46@ zYvK27je{rv>ja=x{{eU@AzJvpWqXBgwE~V?A4Id_(xx%^&e3S=OczPi7=9P|@C}np z*fG7V-8gg+v%CiGZ?>5m+lZ5}-PpfmTYfZnZP?&7VcM8q30O9vq(rgAZ%B>7$15Ho z$_w4VM;TYov$C=7vs>17H%?B%wO%gnPUZ5!LgKu5wIrE?Ybp;Dd_+P$yOi;e++&ho zlKh(FHz1sGh`iNTuiGdYd#S!7rlIXm;(EY8_glkn&8wBFrI~7V1b?H|YPDRQsLoc; JRmZB+{|5WvOB?_I From 6446a5f341869e40e920998777e3b789f53ad1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 31 May 2020 22:43:25 +0200 Subject: [PATCH 04/88] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 58d6b41..78c4258 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,43 @@ Found 4 operator(s) Note that retrieving results from AT+COPS command could take a lot of time and sometime would need to restart the tool. If the tool is blocked on the operator retrieving step, please use cached or targeted operators features instead. +Using Modmobmap with GRGSM +------------------------------ + +Modmodmap can be use with `gr-gsm` to retrieve GSM cells' information with a Software-Defined Radio device compatible with OSMOSDR. + +To use this feature, please issue the following command: + +``` +$ python modmobmap.py -m grgsm -b GSM-R,GSM900 +=> Switching to GSM-R band +[+] New cell detected [CellID/PCI-DL_freq (****)] + Network type=2G + PLMN=**** + ARFCN=978 +[+] New cell detected [CellID/PCI-DL_freq (*****)] + Network type=2G + PLMN=20820 + ARFCN=983 +[+] New cell detected [CellID/PCI-DL_freq (*****)] + Network type=2G + PLMN=20820 + ARFCN=1014 +[+] New cell detected [CellID/PCI-DL_freq (*****)] + Network type=2G + PLMN=20810 + ARFCN=79 +[+] New cell detected [CellID/PCI-DL_freq (****)] + Network type=2G + PLMN=20810 + ARFCN=86 +=> Switching to GSM900 band +[+] New cell detected [CellID/PCI-DL_freq (*****)] + Network type=2G + PLMN=20820 + ARFCN=978 +``` + Saving results --------------- From bfd9c94f041e8ec32ca51843c4935a8e4f5a8a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 31 May 2020 22:46:05 +0200 Subject: [PATCH 05/88] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 78c4258..0974bf9 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,22 @@ Note that all devices should be rooted. In any other case, you will have to use Also: Patches, or engines, for other devices are very much welcomed! ;) +But this is not finished yet, Modmobmap include a GRGSM scanner to scan GSM cells with SDR. Compatible SDR devices are the same as those compatible with `gr-osmosdr` as follows: + +* FunCube Dongle through libgnuradio-fcd +* FUNcube Dongle Pro+ through gr-fcdproplus +* sysmocom OsmoSDR Devices through libosmosdr +* Nuand LLC bladeRF through libbladeRF library +* Great Scott Gadgets HackRF through libhackrf +* Ettus USRP Devices through Ettus UHD library +* Fairwaves UmTRX through Fairwaves' fork of Ettus' UHD library +* RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option) +* RTL2832U based DVB-T dongles through librtlsdr +* RTL-TCP spectrum server (see librtlsdr project) +* MSi2500 based DVB-T dongles through libmirisdr +* SDRplay RSP through SDRplay API library +* AirSpy R820t dongles through libairspy + Requirements ------------- From f0530417b42ccd8bc45fefb957736a999e1dc9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 1 Jun 2020 19:10:59 +0200 Subject: [PATCH 06/88] Update README.md Fixing typos in README --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0974bf9..23a6fc5 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ Modmobmap ========== -Modmobmap is a tool aimed to retrieve information of cellular networks. -As shown in the first [presentation made at BeeRump 2018](https://www.rump.beer/2018/slides/modmobmap.pdf), this tool is able to retrieve information of 2G, 3G, 4G and more cellular network types with minimum requierement: only a phone with ServiceMode. +Modmobmap is a tool aimed to retrieve information on cellular networks. +As shown in the first [presentation made at BeeRump 2018](https://www.rump.beer/2018/slides/modmobmap.pdf), this tool is able to retrieve information of 2G, 3G, 4G, and more cellular network types with minimum requirement: only phone with ServiceMode. -For the moment, the tool has only been tested and developped for the following devices: +For the moment, the tool has only been tested and developed for the following devices: - Samsung Galaxy S3 via [xgoldmon (Modmobmap's edition)](https://github.com/FlUxIuS/xgoldmon); - Samsung Galaxy S4; - Samsung Galaxy S5; - Samsung Galaxy Note 2 with LTE; -Moreover, as it's compatible for XGold via Modmobmap's forked of *xgoldmon*, this tools should also be able to work with devices supported by *xgoldmon* as well: +Moreover, as it's compatible for XGold via Modmobmap's forked of *xgoldmon*, this tool should also be able to work with devices supported by *xgoldmon* as well: - Samsung Galaxy S4 GT-I9500 (this is the version without LTE!) - Samsung Galaxy Nexus GT-I9250 (has to be rooted!) - Samsung Galaxy S2 GT-I9100 @@ -43,12 +43,12 @@ Here are the following requirements: - Python 2 or 3; - Last Android SDK to run ADB: https://developer.android.com/studio/#downloads; - A compatible mobile phone; -- A valid/unvalid SIM card (just in case to provide an IMSI number). +- A valid/invalid SIM card (just in case to provide an IMSI number). How to use ---------- -The tool is provided with a quick help that shows you the required argument as follows: +The tool is provided with quick help that shows you the required argument as follows: ``` python modmobmap.py -h @@ -126,7 +126,7 @@ When looking for operators, an AT command is sent to the modem. If you want to s } ``` -Only the MCC/MNC codes are inmportant. Then you can re-launch the tool as follows: +Only the MCC/MNC codes are important. Then you can re-launch the tool as follows: ``` $ sudo python modmobmap.py -o @@ -166,9 +166,9 @@ Found 4 operator(s) [...] ``` -Note we have been able to detect other cells the AT command *AT+COPS* did not returned. +Note we have been able to detect other cells the AT command *AT+COPS* did not return. -A complet list of MCC and MNC codes could be retrieved anywhere on internet and in Wikipedia: https://en.wikipedia.org/wiki/Mobile_country_code +A complete list of MCC and MNC codes could be retrieved anywhere on the internet and in Wikipedia: https://en.wikipedia.org/wiki/Mobile_country_code Focusing some operators ------------------------ @@ -205,7 +205,7 @@ Found 1 operator(s) Using Modmobmap with xgoldmon ------------------------------ -With XGold modems, the use of xgoldmon will be required. But for now, only the fork for *Modmobmap* works to retrieve exact information of cells via the DIAG interface, and could be downloaded at: https://github.com/FlUxIuS/xgoldmon +With XGold modems, the use of xgoldmon will be required. But for now, only the fork for *Modmobmap* works to retrieve exact information of cells via the DIAG interface and could be downloaded at: https://github.com/FlUxIuS/xgoldmon Then after compiling, the tool *xgoldmon* could be started using the *-m* parameter like this: @@ -220,7 +220,7 @@ $ ls celllog.fifo Makefile screenshot-mtsms-while-in-a-call.png xgoldmon ``` -Then we can start running *Modmobmap* as follows precising the AT serial interface (*/dev/ttyACM0*) and the fifo file created by *xgoldmon* (*/celllog.fifo -m xgoldmod -a /dev/ttyACM0 -o @@ -250,12 +250,12 @@ Found 4 operator(s) [...] ``` -Note that retrieving results from AT+COPS command could take a lot of time and sometime would need to restart the tool. If the tool is blocked on the operator retrieving step, please use cached or targeted operators features instead. +Note that retrieving results from AT+COPS command could take a lot of time and sometime would need to restart the tool. If the tool is blocked on the operator retrieving step, please use cached or targeted operators' features instead. Using Modmobmap with GRGSM ------------------------------ -Modmodmap can be use with `gr-gsm` to retrieve GSM cells' information with a Software-Defined Radio device compatible with OSMOSDR. +Modmodmap can be used with `gr-gsm` to retrieve GSM cells' information with a Software-Defined Radio device compatible with OSMOSDR. To use this feature, please issue the following command: @@ -292,7 +292,7 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 Saving results --------------- -The process could be stopped any time when killing the process with a keyboard interrupt signal. Then results will be automatically save in a JSON file as follows: +The process could be stopped at any time when killing the process with a keyboard interrupt signal. Then results will be automatically saved in a JSON file as follows: ``` [...] From 354567c7ef6ff617901f40b9255e27c611610eb7 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Tue, 21 Jul 2020 19:39:50 +0200 Subject: [PATCH 07/88] Master branch now supports SDR scanning with GNU Radio 3.8 --- engines/sdr/grgsm_scanner.py | 35 ++++++++++++++--------------- install_all-Ubuntu_20.04.sh | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 19 deletions(-) create mode 100755 install_all-Ubuntu_20.04.sh diff --git a/engines/sdr/grgsm_scanner.py b/engines/sdr/grgsm_scanner.py index c6bb74a..d32e254 100755 --- a/engines/sdr/grgsm_scanner.py +++ b/engines/sdr/grgsm_scanner.py @@ -45,9 +45,9 @@ # from wideband_receiver import * -class receiver_with_decoder(grgsm.hier_block): +class receiver_with_decoder(gr.hier_block2): def __init__(self, OSR=4, chan_num=0, fc=939.4e6, ppm=0, samp_rate=0.2e6): - grgsm.hier_block.__init__( + gr.hier_block2.__init__( self, "Receiver With Decoder", gr.io_signature(1, 1, gr.sizeof_gr_complex * 1), gr.io_signature(0, 0, 0), @@ -137,9 +137,9 @@ def set_samp_rate_out(self, samp_rate_out): self.samp_rate_out = samp_rate_out -class wideband_receiver(grgsm.hier_block): +class wideband_receiver(gr.hier_block2): def __init__(self, OSR=4, fc=939.4e6, samp_rate=0.4e6): - grgsm.hier_block.__init__( + gr.hier_block2.__init__( self, "Wideband receiver", gr.io_signature(1, 1, gr.sizeof_gr_complex * 1), gr.io_signature(0, 0, 0), @@ -173,14 +173,14 @@ def __init(self, OSR=4, fc=939.4e6, samp_rate=0.4e6): # Connections ################################################## self.connect((self, 0), (self.pfb_channelizer_ccf_0, 0)) - for chan in xrange(0, self.channels_num): + for chan in range(0, self.channels_num): self.connect((self.pfb_channelizer_ccf_0, chan), (self.receivers_with_decoders[chan], 0)) self.msg_connect(self.receivers_with_decoders[chan], 'bursts', self, 'bursts') self.msg_connect(self.receivers_with_decoders[chan], 'msgs', self, 'msgs') def create_receivers(self): self.receivers_with_decoders = {} - for chan in xrange(0, self.channels_num): + for chan in range(0, self.channels_num): self.receivers_with_decoders[chan] = receiver_with_decoder(fc=self.fc, OSR=self.OSR, chan_num=chan, samp_rate=self.OSR_PFB * 0.2e6) @@ -212,7 +212,7 @@ def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=24, self.ppm = ppm # if no file name is given process data from rtl_sdr source - print "Args=", args + print("Args=", args) self.rtlsdr_source = osmosdr.source(args="numchan=" + str(1) + " " + str(grgsm.device.get_default_args(args))) #self.rtlsdr_source.set_min_output_buffer(int(sample_rate*rec_len)) #this line causes segfaults on HackRF @@ -266,6 +266,10 @@ def __init__(self, arfcn, freq, cid, lac, mcc, mnc, ccch_conf, power, neighbours self.neighbours = neighbours self.cell_arfcns = cell_arfcns + def __lt__(self, other): + return self.arfcn < other.arfcn + + def get_verbose_info(self): i = " |---- Configuration: %s\n" % self.get_ccch_conf() i += " |---- Cell ARFCNs: " + ", ".join(map(str, self.cell_arfcns)) + "\n" @@ -289,7 +293,6 @@ def get_ccch_conf(self): def getKey(self): return self.arfcn - @Cellslogger def attr2dic(self): cell = {} @@ -300,7 +303,6 @@ def attr2dic(self): 'cid' : str(self.cid)} return cell - def __cmp__(self, other): if hasattr(other, 'getKey'): return self.getKey().__cmp__(other.getKey()) @@ -315,8 +317,6 @@ def __str__(self): return "ARFCN: %4u, Freq: %6.1fM, CID: %5u, LAC: %5u, MCC: %3u, MNC: %3u, Pwr: %3i" % ( self.arfcn, self.freq / 1e6, self.cid, self.lac, self.mcc, self.mnc, self.power) - - def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): signallist = [] channels_num = int(samp_rate / 0.2e6) @@ -334,7 +334,7 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): if not debug: # silence rtl_sdr output: # open 2 fds - null_fds = [os.open(os.devnull, os.O_RDWR) for x in xrange(2)] + null_fds = [os.open(os.devnull, os.O_RDWR) for x in range(2)] # save the current file descriptors to a tuple save = os.dup(1), os.dup(2) # put /dev/null fds on 1 and 2 @@ -347,18 +347,17 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): carrier_frequency=current_freq, ppm=ppm, gain=gain, args=args) - print "record" # start recording scanner.start() scanner.wait() scanner.stop() - print "record2" freq_offsets = numpy.fft.ifftshift( numpy.array(range(int(-numpy.floor(channels_num / 2)), int(numpy.floor((channels_num + 1) / 2)))) * 2e5) detected_c0_channels = scanner.gsm_extract_system_info.get_chans() found_list = [] + if detected_c0_channels: chans = numpy.array(scanner.gsm_extract_system_info.get_chans()) found_freqs = current_freq + freq_offsets[(chans)] @@ -377,7 +376,6 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): info = channel_info(grgsm.arfcn.downlink2arfcn(found_freqs[i]), found_freqs[i], cell_ids[i], lacs[i], mccs[i], mncs[i], ccch_confs[i], powers[i], neighbour_list, cell_arfcn_list) - found_list.append(info) scanner = None @@ -397,7 +395,6 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): current_freq += channels_num * 0.2e6 return signallist - def argument_parser(): parser = OptionParser(option_class=eng_option, usage="%prog: [options]") bands_list = ", ".join(grgsm.arfcn.get_bands()) @@ -445,10 +442,10 @@ def main(options = None): def printfunc(found_list): for info in sorted(found_list): - print info + print(info) if options.verbose: - print info.get_verbose_info() - print "" + print(info.get_verbose_info()) + print("") do_scan(options.samp_rate, options.band, options.speed, options.ppm, options.gain, options.args, prn = printfunc, debug = options.debug) diff --git a/install_all-Ubuntu_20.04.sh b/install_all-Ubuntu_20.04.sh new file mode 100755 index 0000000..0516b97 --- /dev/null +++ b/install_all-Ubuntu_20.04.sh @@ -0,0 +1,43 @@ +#!/usr/bin/bash + +echo "[+] Installing Python3 requirements" +sudo python3 -m pip install --upgrade pip +sudo python3 -m pip install -r requirements.txt + +echo "[+] Installing GNU Radio dependencies" +sudo add-apt-repository ppa:gnuradio/gnuradio-releases +sudo apt-get update +sudo apt-get install gnuradio + +sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ +python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \ +libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ +liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ +python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 + +echo "[+] Installing gr-osmosdr package" +sudo apt install gr-osmosdr + +echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.8" +mkdir thirdparty +cd thirdparty +git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git +echo "[+] Building and installing gr-gsm for GNU Radio 3.8" +cd gr-gsm +mkdir build +cd build +cmake ../ +make +sudo make install +sudo ln -s /usr/local/lib/python3/dist-packages/grgsm /usr/lib/python3/dist-packages/ +sudo ln -s /usr/local/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git /usr/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git +cd ../../ +echo "[+] Installing SDK tools" +sudo apt install openjdk-14-jdk +wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip +unzip commandlinetools-linux-6609375_latest.zip +sudo mkdir -p /opt/Android +cd tools +./bin/sdkmanager --sdk_root=/opt/Android --update +sudo ./bin/sdkmanager --sdk_root=/opt/Android --install platform-tools +echo "====END====" From e63cd618d205c06a94809b3b6c25747c50183efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 21 Jul 2020 19:44:04 +0200 Subject: [PATCH 08/88] Update README.md Simple installation process with Ubuntu --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 23a6fc5..c957662 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ Here are the following requirements: - A compatible mobile phone; - A valid/invalid SIM card (just in case to provide an IMSI number). +Ubuntu installation +--------------------- + +A script installing all depencies for all engines is available in the `install_all-Ubuntu_20.04.sh`. + + How to use ---------- From a0fe6d65f6a1129cfaf495ff417e9852cc55f412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 21 Jul 2020 19:45:45 +0200 Subject: [PATCH 09/88] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c957662..2a2199d 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Here are the following requirements: - Python 2 or 3; - Last Android SDK to run ADB: https://developer.android.com/studio/#downloads; - A compatible mobile phone; +- GNU Radio 3.8 with gr-gsm to scan GSM stations with Software-Defined Radio - A valid/invalid SIM card (just in case to provide an IMSI number). Ubuntu installation From 6926ae891b6d08a7d2733e292c4b035a3f070caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 21 Jul 2020 19:47:41 +0200 Subject: [PATCH 10/88] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a2199d..e03edbe 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,9 @@ Here are the following requirements: Ubuntu installation --------------------- -A script installing all depencies for all engines is available in the `install_all-Ubuntu_20.04.sh`. +A `install_all-Ubuntu_20.04.sh` script installing all dependencies for all engines is available in the root directory. +For other distributions, please adapt this script base on listed dependencies. How to use ---------- From 45e4aa4133fa737e69cb7aba5b1d910da96352be Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Wed, 22 Jul 2020 21:48:20 +0200 Subject: [PATCH 11/88] Adding SDR LTE scanning feature base on SRSLTE --- .gitmodules | 3 +++ engines/sdr/srslte_pss.py | 53 +++++++++++++++++++++++++++++++++++++++ modmobmap.py | 25 ++++++++++++++++-- thirdparty/srsLTE | 1 + utils/logprocess.py | 48 +++++++++++++++++++++++++++++++++++ 5 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 engines/sdr/srslte_pss.py create mode 160000 thirdparty/srsLTE diff --git a/.gitmodules b/.gitmodules index e69de29..64ada83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/srsLTE"] + path = thirdparty/srsLTE + url = https://github.com/PentHertz/srsLTE.git diff --git a/engines/sdr/srslte_pss.py b/engines/sdr/srslte_pss.py new file mode 100644 index 0000000..1bc5b1e --- /dev/null +++ b/engines/sdr/srslte_pss.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# )penthertz.com> wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# ---------------------------------------------------------------------------- + +from __future__ import print_function +from core.mLog import Cellslogger +from core.mKB import * +import os + +class srslte_pss(object): + @Cellslogger + def go2logs(self, cell): + return cell + + def parseFifo(self): + kb = mKB() + FIFO = kb.config['file'] + if os.path.isfile(FIFO) == False: + try: + os.mkfifo(FIFO) + except: + pass + if 'SM_cells' not in kb.data: + kb.data['SM_cells'] = {} + while True: + with open(FIFO) as fifo: + while True: + data = fifo.read() + if len(data) == 0: + break + infos = data.split(':')[1] + isplit = infos.split(';') + tmpcell = {} + tmpcell2 = {} + for cell in isplit: + pcell = cell.split('=') + tmpcell[pcell[0]] = pcell[1] + cid = tmpcell['CID'] + '-' + tmpcell['DL_EARFCN'] + tmpcell2[cid] = { 'FREQ' : tmpcell['FREQ'], + 'PLMN' : "-1", + 'type' : "4G", + 'eARFCN' : int(tmpcell['DL_EARFCN']), + 'POWER' : tmpcell['POWER'], + } + self.go2logs(tmpcell2) + + diff --git a/modmobmap.py b/modmobmap.py index 3f26ccd..48ff7f0 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -11,6 +11,7 @@ from __future__ import print_function from utils.logprocess import * +SRSLTE_PATH = "thirdparty/srsLTE/" # thirdparty project def phone_actions(args): cops = None @@ -50,7 +51,7 @@ def phone_actions(args): parser.add_argument('-m', '--module', dest='module', required=False, default='servicemode', help='Module to use (e.g: "servicemode" by default).') parser.add_argument('-b', '--bands', dest='bands', required=False, default=None, - help='Bands to use for SDR engines (for GSM: GSM900, DCS1800, GSM850, PCS1900, GSM450, GSM480, GSM-R). A list can be provided separated with commas.') + help='Bands to use for SDR engines (for GSM: GSM900, DCS1800, GSM850, PCS1900, GSM450, GSM480, GSM-R. For LTE provide band indexes such as 28 for B28 at 700 MHz, etc.). A list can be provided separated with commas.') parser.add_argument('-n', '--networks', dest='networks', required=False, default=None, help='Networks in MCCMNC format splitted with commas') parser.add_argument('-o', '--cached_operator', dest='operators', required=False, default=False, action='store_true', @@ -59,19 +60,39 @@ def phone_actions(args): help='Android SDK path') parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') + parser.add_argument('-g', '--args', dest='dargs', required=False, default=None, + help='Device args for SDR engines') parser.add_argument('-f', '--file', dest='file', required=False, default=None, help='File to parse. For the moment it could be used in combination with AT mode host.') args = parser.parse_args() + phoneinteract = False + kb = mKB() kb.config['androidsdk'] = args.androidsdk + kb.config['device_args'] = args.dargs if args.file is not None: kb.config['file'] = args.file if args.module == "xgoldmod": startXgoldmodCollect() + phoneinteract = True + elif args.module == "srslte_pss": + kb.config['SRSLTETOOLS_PATH'] = SRSLTE_PATH + "build/lib/examples/" + kb.config['file'] = "celllog.fifo" + if args.file is not None: + kb.config['file'] = args.file + + if args.bands is not None: + kb.config['bands'] = args.bands + else: + print ("Bands argument not set! Using band 7 by default instead.") + kb.config['bands'] = "7" + startSrsLTEPSS() elif args.module == "grgsm": processGRGSM(args.bands) else: startServiceModeCollect() - if args.module != "grgsm": + phoneinteract = True + + if phoneinteract is True: phone_actions(args) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE new file mode 160000 index 0000000..fc89f55 --- /dev/null +++ b/thirdparty/srsLTE @@ -0,0 +1 @@ +Subproject commit fc89f556bdd0c4826c4a65986b43591e1ba4b9f3 diff --git a/utils/logprocess.py b/utils/logprocess.py index 3fb6ef5..1d03ea8 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -12,6 +12,7 @@ from engines.android.generic.ADBshell import * from engines.android.samsung.ServiceMode import * from engines.host.diag.xgoldmod import * +from engines.sdr.srslte_pss import * from engines.host.serial.AT import AT from utils.colors import * from core.mKB import * @@ -53,6 +54,53 @@ def startXgoldmodCollect(): th.start() +def startSrsLTEPSSProcess(): + import subprocess + state = True + bands = mKB.config['bands'].split(",") + while state: + try: + for band in bands: + commandstring = [mKB.config['SRSLTETOOLS_PATH']+"cell_search_modmobmap", "-b", band] + if mKB.config['device_args'] is not None: + commandstring.append("-a") + commandstring.append(mKB.config['device_args']) + p = subprocess.Popen(commandstring, stdout=subprocess.PIPE) + p.wait() + except (KeyboardInterrupt, SystemExit): + state = False + cells = kb.data['SM_cells'] + saveCells(cells) + + +def startSrsLTEPSSCollect(): + srs = srslte_pss() + th = Thread(target=srs.parseFifo) + th.daemon = True + th.start() + + +def startSrsLTEPSS(): + th = Thread(target=startSrsLTEPSSProcess) + th.daemon = True + th.start() + startSrsLTEPSSCollect() + state = True + while state: + try: + pass + except (KeyboardInterrupt, SystemExit): + state = False + cells = kb.data['SM_cells'] + saveCells(cells) + + +def startSrsLTEPSSCollect(): + srs = srslte_pss() + th = Thread(target=srs.parseFifo) + th.daemon = True + th.start() + def startServiceModeCollect(): sm = ServiceMode() sm.androidsdkpath = mKB.config['androidsdk'] From beb2d46da6df848047180ffb4d5f2201aa25789f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 22 Jul 2020 21:54:12 +0200 Subject: [PATCH 12/88] Update README.md --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index e03edbe..276eeba 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,54 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 ARFCN=978 ``` +Using Modmobmap with srsLTE +------------------------------ + +Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, Soapy drivers like the RTL-SDR. + +To use this feature, please issue the following command: + +``` +$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'id=3' + +[INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 +[INFO] [LOGGING] Fastpath logging disabled at runtime. +[...] + +Found Rafael Micro R820T tuner +Found Rafael Micro R820T tuner +[INFO] Using format CF32. + +[+] New cell detected [CellID/PCI-DL_freq (2-9383)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9383 +[+] New cell detected [CellID/PCI-DL_freq (95-9461)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9461 +[+] New cell detected [CellID/PCI-DL_freq (259-9591)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9591 +[+] New cell detected [CellID/PCI-DL_freq (259-9592)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9592 +[+] New cell detected [CellID/PCI-DL_freq (1-9593)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9593 +[+] New cell detected [CellID/PCI-DL_freq (1-9594)] + Network type=4G + PLMN=-1 + Downlink EARFCN=9594 +[...] +^C[+] Cells save as cells_1595446203.json +``` + +The `g` parameters is not mandatory and is used mainly to select the right device to scan the Synchronization Signals. + Saving results --------------- From 60556bcf6f7b1dd5069b2e7ff087699ceb43c74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 22 Jul 2020 21:58:05 +0200 Subject: [PATCH 13/88] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 276eeba..d951f7d 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,14 @@ But this is not finished yet, Modmobmap include a GRGSM scanner to scan GSM cell * SDRplay RSP through SDRplay API library * AirSpy R820t dongles through libairspy +Modmobmap is also able to scan LTE cells by wrapping srsLTE tools. The engine supports several SDR devices: + +* USRP +* BladeRF +* HackRF +* RFSpace +* and so on. + Requirements ------------- @@ -300,7 +308,7 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 Using Modmobmap with srsLTE ------------------------------ -Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, Soapy drivers like the RTL-SDR. +Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. To use this feature, please issue the following command: From 4c5d0f5bd8110ba693d2faeda42c9a0b38e03c2b Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Wed, 22 Jul 2020 22:13:41 +0200 Subject: [PATCH 14/88] Installation script updated --- install_all-Ubuntu_20.04.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/install_all-Ubuntu_20.04.sh b/install_all-Ubuntu_20.04.sh index 0516b97..6dd86bf 100755 --- a/install_all-Ubuntu_20.04.sh +++ b/install_all-Ubuntu_20.04.sh @@ -1,5 +1,8 @@ #!/usr/bin/bash +echo "[+] Retrieving submodules" +git submodule update --init --recursive + echo "[+] Installing Python3 requirements" sudo python3 -m pip install --upgrade pip sudo python3 -m pip install -r requirements.txt @@ -21,13 +24,14 @@ sudo apt install gr-osmosdr echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.8" mkdir thirdparty cd thirdparty +REMPATH=`pwd` git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git echo "[+] Building and installing gr-gsm for GNU Radio 3.8" cd gr-gsm mkdir build cd build cmake ../ -make +make -j$(nproc) sudo make install sudo ln -s /usr/local/lib/python3/dist-packages/grgsm /usr/lib/python3/dist-packages/ sudo ln -s /usr/local/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git /usr/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git @@ -40,4 +44,29 @@ sudo mkdir -p /opt/Android cd tools ./bin/sdkmanager --sdk_root=/opt/Android --update sudo ./bin/sdkmanager --sdk_root=/opt/Android --install platform-tools +echo "[+] Installing dependencies for srsLTE" +sudo apt install libsoapysdr-dev +#osmo sdr support: +sudo apt-get install osmo-sdr soapysdr-module-osmosdr +#rtl sdr support: +sudo apt-get install rtl-sdr soapysdr-module-rtlsdr +#blade rf support: +sudo apt-get install bladerf soapysdr-module-bladerf +#hack rf support: +sudo apt-get install hackrf soapysdr-module-hackrf +#usrp support: +sudo apt-get install uhd-host uhd-soapysdr soapysdr-module-uhd +#miri SDR support: +sudo apt-get install miri-sdr soapysdr-module-mirisdr +#rf space support: +sudo apt-get install soapysdr-module-rfspace +#airspy support: +sudo apt-get install airspy soapysdr-module-airspy +echo "[+] Installaing srsLTE for Modmobmap" +cd $REMPATH +cd srsLTE +mkdir build +cd build +cmake ../ +make -j$(nproc) echo "====END====" From f4f36e5c7f003cad14d503dc2c4a373b65711495 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Wed, 22 Jul 2020 22:16:38 +0200 Subject: [PATCH 15/88] Including srsLTE dependencies for compiling --- install_all-Ubuntu_20.04.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_all-Ubuntu_20.04.sh b/install_all-Ubuntu_20.04.sh index 6dd86bf..4afaf7e 100755 --- a/install_all-Ubuntu_20.04.sh +++ b/install_all-Ubuntu_20.04.sh @@ -45,6 +45,7 @@ cd tools ./bin/sdkmanager --sdk_root=/opt/Android --update sudo ./bin/sdkmanager --sdk_root=/opt/Android --install platform-tools echo "[+] Installing dependencies for srsLTE" +sudo apt-get install cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev sudo apt install libsoapysdr-dev #osmo sdr support: sudo apt-get install osmo-sdr soapysdr-module-osmosdr From c68490671b2fac8d740fda6715f5108aad965881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 22 Jul 2020 22:18:31 +0200 Subject: [PATCH 16/88] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d951f7d..219ca03 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The tool is provided with quick help that shows you the required argument as fol ``` python modmobmap.py -h usage: modmobmap.py [-h] [-m MODULE] [-n NETWORKS] [-o] [-s ANDROIDSDK] - [-a ATMODE] [-f FILE] + [-a ATMODE] [-f FILE]Before running the engine, make sure all dependencies are installed. You can refer to the installation script Mobile network mapping tool with cheap equipments @@ -310,6 +310,12 @@ Using Modmobmap with srsLTE Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. +Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: + +``` +git submodule update --remote +``` + To use this feature, please issue the following command: ``` From 33e828042dbb4d4910c7746cdad27864c7a08e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Thu, 23 Jul 2020 18:11:41 +0200 Subject: [PATCH 17/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 219ca03..b7d241e 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Define Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: ``` -git submodule update --remote +git submodule update --init --recursive ``` To use this feature, please issue the following command: From 0de6d9cc61936b5d3ff649880927f297cb47d5c3 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Thu, 23 Jul 2020 18:39:53 +0200 Subject: [PATCH 18/88] Including NB-IoT support --- modmobmap.py | 2 +- utils/.logprocess.py.swp | Bin 16384 -> 0 bytes utils/logprocess.py | 28 ++++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) delete mode 100644 utils/.logprocess.py.swp diff --git a/modmobmap.py b/modmobmap.py index 48ff7f0..cfb21c9 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -76,7 +76,7 @@ def phone_actions(args): if args.module == "xgoldmod": startXgoldmodCollect() phoneinteract = True - elif args.module == "srslte_pss": + elif args.module == "srslte_pss" or args.module == "srslte_npss": kb.config['SRSLTETOOLS_PATH'] = SRSLTE_PATH + "build/lib/examples/" kb.config['file'] = "celllog.fifo" if args.file is not None: diff --git a/utils/.logprocess.py.swp b/utils/.logprocess.py.swp deleted file mode 100644 index e5a21d400f60dfd1cc61454f138f5469e0fe1d11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3ZHOIL8OM*cN!z5c#oA~o!pU8iJ2!iG_9bgvH`&DOW|MA{-KM)6Tg}U5?#!8c zCp&lMGUv?Ry|F4)5J6B83R((93Pw>s6wwb_#1A59u}H-?@D-&WqKMEBMM3cYoSC^V zn{2m98jUamznz(Lp68r1&pFSTbDp_d9sS_^0-rR;7>;`xyL9>I=U?7^CwuZ0#$qWV zO5W;-t8t*>t)v+H7!^3O5IT*p+OV1cv)SIdkX$0SKyHC+w?M4i z;mKWW-}u-lDGwC(@cZ6=`r6CMHF68&7RW7-TOhYUZh_naxdn0y-v*xp3Y-Iv zf(h^*@GkI9up8_IJHTDw*LO4a1MqpU4qR{+EPzSyKCmC`0lUC&cQW=>a0z?`d=^{; z^Wc8)4saiMZ3kn22Hyu?15bl5fiHqKsDd%@Zm=Ev@h-+*1TTQ^f$xInfC3Uk;5=9a zyTL1WGWH|zJa`VQffy*T1V+GvU_>)L7EqU0(0Qs=+l?Lr@&)?`uKjZ^}#ne z3e$)9a?4Y8-3w~GYT2t?h1`l&INS&wQ7CgOs!flV*hYP+EG1-P&5#Y#u3JG(EDF^M zqt%smQzRD0^=!s6>#_sq~aemaOm&67$*!r^WdHn<%}kq8tg<-+UN z;y^1=?yrSd0)Im@(}zaJ|}@VmGsRE>(cUk)t!RE_~l8F-N#O{e96RX-kl6bXrxKf;;e@ zLt1NM7P``~>2JRQbP_69t(uOdtTV;sg^Er~YtPEbp5vJ1%j7{QN37eTskm`Mw5y>N zIr9O`9>q;n=F4q#L1S*+Q)p0D%Et4JyPu{0C+_!VR(lQZcLUYli2HS_y{YbpTH=oH z-YoaC6nWE%VX2Bz?Zg+7>%<8%H$-N|g)hSmuI6wnSMj%I~T>SErM4EMj@FkNx966t)XI~ME4LWXqC#K zV_uM9K+~%0hn6yw*AOQCF-nPiS~yfl&~)NPQyO9QLK%~qgZXiKqReF&smiKo%W0ah z5x36wjtjedG=RPE5m)M!3(V&>%Oxgn`wl-f|1I=6UqHk-jRVKTob9(GPrdt(Fg-HyEBLCNpqzh3Cl4cTN7#;(`qfUs`%}tZKQ z7W(+@sgu4HbnTC)X;)OOXYh2z(u`$Y3Of?2`wA|Oj*g8L%e-ZIDqHbfpItV*tgh^b z%oRm85+(Hkz!ZC`k{v)hfma))r_v zW2qOD>u1+!s~%NMuacDZCt8=LqKSiL!rJ|lGxFYG#k)ZJ|*U0a{_3 z*+|_WUa7dTiX%~}WEr~mkQ&&^g8|t9S9Nr=RI%$)KVjvMNy)>yrya)JwgO&_+Z^+= z#j8R@v}}a4#ZkbI`KQgXEU|6js> z^hNAdY5zZyZVqYR{~howXn_xdgWv#|0)yaH?EQZMz6m}79tQK^Aus_3z#ZT+_WCb@ z=fP8;4bB6K6PyHx!Gqv6?D4+^J_$Uq1oi^j``-YxT(a0(m; z4}gDQZ~rUsEZ715fW15I@1F*r22X%Gr~wx|3LXG|hb?{s$R3vK zmg?F_Wm=hc7UcLU5DEOdC)UNHad_%%a8@BI(-+u42Qfs+pwe&QMh09J+?iI;S^&E}OomlyH*H%C*GWI+99 zM#nJ%2PHmH1rEjd=$vf#>8cy4$XeA6tzeINeChb|!j%zK(xl-|XIb&_&7|vJSO22H zvf{hv0*W49DkR@3y2*4!Sre0^h5nio8J+juP4Z67E|0x`bdyXJI=PwRQ7BG!6uZxb zt~omVOve;yjHjPew5hry+zBg~G6Q2=>@TM_N0bzSmhn*&e+&3jhX`jaiO1;P z@9zo^;b7BJDjLVI#WaSv0mN(A>LXIgSz-&!@^E|-rQVim#?1zXp+`^_1551yi}i(6)96>$;9J+3{sS`+ BlX3t6 diff --git a/utils/logprocess.py b/utils/logprocess.py index 1d03ea8..eebf2c1 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -54,14 +54,14 @@ def startXgoldmodCollect(): th.start() -def startSrsLTEPSSProcess(): +def startSrsLTExPSSProcess(cmdprog): import subprocess state = True bands = mKB.config['bands'].split(",") while state: try: for band in bands: - commandstring = [mKB.config['SRSLTETOOLS_PATH']+"cell_search_modmobmap", "-b", band] + commandstring = [mKB.config['SRSLTETOOLS_PATH']+cmdprog, "-b", band] if mKB.config['device_args'] is not None: commandstring.append("-a") commandstring.append(mKB.config['device_args']) @@ -73,6 +73,14 @@ def startSrsLTEPSSProcess(): saveCells(cells) +def startSrsLTENPSSProcess(): + startSrsLTExPSSProcess("cell_search_nbiot_modmobmap") + + +def startSrsLTEPSSProcess(): + startSrsLTExPSSProcess("cell_search_modmobmap") + + def startSrsLTEPSSCollect(): srs = srslte_pss() th = Thread(target=srs.parseFifo) @@ -80,6 +88,21 @@ def startSrsLTEPSSCollect(): th.start() +def startSrsLTEPSS(): + th = Thread(target=startSrsLTEPSSProcess) + th.daemon = True + th.start() + startSrsLTENPSSCollect() + state = True + while state: + try: + pass + except (KeyboardInterrupt, SystemExit): + state = False + cells = kb.data['SM_cells'] + saveCells(cells) + + def startSrsLTEPSS(): th = Thread(target=startSrsLTEPSSProcess) th.daemon = True @@ -101,6 +124,7 @@ def startSrsLTEPSSCollect(): th.daemon = True th.start() + def startServiceModeCollect(): sm = ServiceMode() sm.androidsdkpath = mKB.config['androidsdk'] From 7482d70c875c9c5d52ce1e01e284c2c11a755eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Thu, 23 Jul 2020 18:42:39 +0200 Subject: [PATCH 19/88] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index b7d241e..d5e92a5 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,32 @@ Found Rafael Micro R820T tuner The `g` parameters is not mandatory and is used mainly to select the right device to scan the Synchronization Signals. +For NB-IoT scanning, you can use the `srslte_npss` option as follows: + +``` +$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'id=3' +[INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 +[INFO] [LOGGING] Fastpath logging disabled at runtime. + +Found Rafael Micro R820T tuner +Found Rafael Micro R820T tuner +[INFO] Using format CF32. +[R82XX] PLL not locked! +[+] New cell detected [CellID/PCI-DL_freq (1-6200)] + Network type=4G + PLMN=-1 + Downlink EARFCN=6200 +[+] New cell detected [CellID/PCI-DL_freq (1-6203)] + Network type=4G + PLMN=-1 + Downlink EARFCN=6203 +[+] New cell detected [CellID/PCI-DL_freq (446-6400)] + Network type=4G + PLMN=-1 + Downlink EARFCN=6400 +[...] +``` + Saving results --------------- From f57be17ec184a23b4fd5f9990d2ff3ebdc2ee992 Mon Sep 17 00:00:00 2001 From: FlUxIUS Date: Thu, 23 Jul 2020 18:45:39 +0200 Subject: [PATCH 20/88] Updating srsLTE version --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index fc89f55..9855146 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit fc89f556bdd0c4826c4a65986b43591e1ba4b9f3 +Subproject commit 9855146c0e9ca91aec0fe69fa9ab4933f4849cde From 5b7b7119530de8fb0565a92f67f0a2fa57160fc3 Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Fri, 21 May 2021 10:30:27 +0200 Subject: [PATCH 21/88] Updating to srsRAN --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 9855146..53b0744 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 9855146c0e9ca91aec0fe69fa9ab4933f4849cde +Subproject commit 53b07447a7b6f8790dfbe1abc119b2b19e729f72 From 03b4050c61f80e9eec1b87067f8a4d3641e384d0 Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Fri, 21 May 2021 11:51:58 +0200 Subject: [PATCH 22/88] Update srsRAN submodule --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 53b0744..296b17a 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 53b07447a7b6f8790dfbe1abc119b2b19e729f72 +Subproject commit 296b17a261906e088e05dfb1a7560bb7fc6d46ce From 5158eee2a1fd11c8106bb3f539bed307a63ad967 Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Fri, 21 May 2021 11:57:17 +0200 Subject: [PATCH 23/88] Right commit --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 296b17a..7ee0725 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 296b17a261906e088e05dfb1a7560bb7fc6d46ce +Subproject commit 7ee07253519b17ac5a928d14deac11cdf3295b40 From af2aaf6d4de0fc6a2107f6734b277bc325279af2 Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Tue, 1 Jun 2021 14:06:23 +0200 Subject: [PATCH 24/88] Forcing GNU Radio 3.8 installation --- install_all-Ubuntu_20.04.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_all-Ubuntu_20.04.sh b/install_all-Ubuntu_20.04.sh index 4afaf7e..c54259b 100755 --- a/install_all-Ubuntu_20.04.sh +++ b/install_all-Ubuntu_20.04.sh @@ -10,7 +10,8 @@ sudo python3 -m pip install -r requirements.txt echo "[+] Installing GNU Radio dependencies" sudo add-apt-repository ppa:gnuradio/gnuradio-releases sudo apt-get update -sudo apt-get install gnuradio +gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.8(.*)"|sed 's/ 500//'|sed 's/ //') +sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.8 installation sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \ From e8d719c446162bd3c2297c3198e5c0326c195095 Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Sat, 11 Sep 2021 01:49:59 +0200 Subject: [PATCH 25/88] Adding 2G/3G/4G support for Galaxy S20 --- core/mLog.py | 3 +- engines/android/samsung/ServiceMode.py | 122 ++++++++++++++++++++++++- 2 files changed, 121 insertions(+), 4 deletions(-) diff --git a/core/mLog.py b/core/mLog.py index d43ebf7..1c9ac17 100755 --- a/core/mLog.py +++ b/core/mLog.py @@ -36,7 +36,8 @@ def wrapped(*args, **kwargs): string2print += "\n\r Downlink EARFCN=%i" % v['eARFCN'] elif '3G' in v['type']: string2print += "\n\r Downlink UARFCN=%i" % v['RX'] - string2print += "\n\r Uplink UARFCN=%i" % v['TX'] + if 'TX' in v: + string2print += "\n\r Uplink UARFCN=%i" % v['TX'] elif '2G' in v['type']: string2print += "\n\r ARFCN=%i" % v['arfcn'] print (bcolors.OKGREEN+string2print+bcolors.ENDC) diff --git a/engines/android/samsung/ServiceMode.py b/engines/android/samsung/ServiceMode.py index d7e65b6..64ef8e0 100755 --- a/engines/android/samsung/ServiceMode.py +++ b/engines/android/samsung/ServiceMode.py @@ -65,6 +65,80 @@ def parse4Gcell(self, string): } return cell + + @Cellslogger + def parse4Gcell_sgs20like(self, string): + ''' + Parse 4G cells information for SGS 20 phone like + in(1): string returned by logcat + out: dict infos + ''' + plmn = None + tac = None + earfcn = None + band = None + bandwidth = None + cid = None + pci = None + cell = {} + for s in string.split(b'\n'): + if b'Band' in s and b'BW' in s: + band, bandwidth = re.match(b'^.*Band:?\s?(\d+)\sBW:?\s?([\d+\w]+)?\s?\_$', s).groups() + bandwidth = bandwidth.replace('MHz', '') + if 'Registered' in s: + plmn = re.match(b'^.*PLMN?\s?:?\s?([\d\-\s]+)', s).group(1).replace(' ', '') + if b'DL & UL Frequency' in s: + earfcn = re.match(b'^.*Frequency:?\s?([\d+\w]+)', s).group(1) + if tac is None and b'TAC' in s: + tac = re.match(b'^.*TAC?\s?:?\s?([\d]+)', s).group(1) + if b'CellID' in s and b'PCI' in s: + cid, pci = re.match(b'^.*ServingCellID:?\s?([\w\d]+)PCI:?\s?([\w\d]+)?\s?\_$', s).groups() + if None not in [plmn, tac, earfcn, band, bandwidth]: + tac = tac.decode('utf-8') + plmn = plmn.decode('utf-8').replace(' ','') + bandwidth = bandwidth.decode('utf-8') + cid2 = "%s-%i" % (cid, int(pci)) + cell[cid2] = { 'PLMN' : plmn, + 'band' : int(band), + 'bandwidth' : bandwidth, + 'eARFCN': int(earfcn), + 'TAC' : tac, + 'type' : '4G', + } + return cell + + + @Cellslogger + def parse3Gcell_sgs20like(self, string): + ''' + Parse 3G cells information SGS20 like + in(1): string returned by logcat + out: dict infos + ''' + plmn = None + cid = None + rx = None + cell = {} + for s in string.split(b'\n'): + if b'MCC' in s: + mcc, mnc = re.match(b'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() + plmn = mcc+mnc + if b'CellId' in s: + cid = re.match(b'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) + if b'uarfcn:' in s: + rx = re.match(b'^.*uarfcn:?\s?(\d+)', s).group(1) + if None not in [rx, cid, plmn]: + cid = cid.decode('utf-8').replace('_','') + plmn = plmn.decode("utf-8") + cid2 = "%s-%i" % (cid, int(rx)) + cell[cid2] = { 'PLMN' : plmn, + 'RX' : int(rx), + 'band': -1, + 'type' : '3G', + } + return cell + + @Cellslogger def parse3Gcell_sgs3like(self, string): ''' @@ -142,6 +216,38 @@ def parse3Gcell(self, string): } return cell + + @Cellslogger + def parse2Gcell_sgs20like(self, string): + ''' + Parse 2G cells information SGS20 like structs + in(1): string returned by logcat + out: dict infos + ''' + plmn = None + cid = None + arfcn = None + cell = {} + for s in string.split(b'\n'): + if b'MCC' in s: + mcc, mnc = re.match(b'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() + plmn = mcc+mnc + if b'CellId' in s: + cid = re.match(b'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) + if b'arfcn' in s: + arfcn = re.match(b'^.*arfcn?\s?:?\s?(\d+)', s).group(1) + if None not in [arfcn, cid, plmn]: + cid = cid.decode('utf-8') + plmn = plmn.decode("utf-8").replace(' ', '') + cid2 = "%s-%i" % (cid, int(arfcn)) + cell[cid2] = { 'PLMN' : plmn, + 'arfcn' : int(arfcn), + 'type' : '2G', + 'cid' : cid, + } + return cell + + @Cellslogger def parse2Gcell(self, string): ''' @@ -193,17 +299,27 @@ def grablogcat(self): if b'Update!' in line: if b'LTE RRC:' in capture: self.parse4Gcell(capture) + elif b'LTE-BASIC' in capture: + self.parse4Gcell_sgs20like(capture) elif b'UMTS :' in capture: self.parse3Gcell_sgs3like(capture) - if b'GSM' in capture: - self.parse2Gcell(capture) + elif b'Serving Cell Info' in capture: + self.parse3Gcell_sgs20like(capture) + elif b'GSM' in capture: + if b'2G-BASIC' in capture: + self.parse2Gcell_sgs20like(capture) + else: + self.parse2Gcell(capture) else: - self.parse3Gcell(capture) + if b'LTE' not in capture: + self.parse3Gcell(capture) capture = b'' capture += line except (KeyboardInterrupt, SystemExit): stop = True stdout_reader.stop() + #except Exception as e: + # print (e) stdout_reader.stop() process.stdout.close() From b4e2ea8a6c5f936cb68a7234fcfb1ae3c8270d1c Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Sat, 11 Sep 2021 01:51:51 +0200 Subject: [PATCH 26/88] Updating README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d5e92a5..0988127 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ For the moment, the tool has only been tested and developed for the following de - Samsung Galaxy S4; - Samsung Galaxy S5; - Samsung Galaxy Note 2 with LTE; +- Samsung Galaxy S20 Moreover, as it's compatible for XGold via Modmobmap's forked of *xgoldmon*, this tool should also be able to work with devices supported by *xgoldmon* as well: - Samsung Galaxy S4 GT-I9500 (this is the version without LTE!) From 817b167d05f9f4a9f13351fd6eb28a218340431b Mon Sep 17 00:00:00 2001 From: Sebastien Dudek Date: Wed, 13 Oct 2021 01:08:54 +0200 Subject: [PATCH 27/88] Add missing index for Modmobjam --- engines/sdr/srslte_pss.py | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sdr/srslte_pss.py b/engines/sdr/srslte_pss.py index 1bc5b1e..5d3aa30 100644 --- a/engines/sdr/srslte_pss.py +++ b/engines/sdr/srslte_pss.py @@ -45,6 +45,7 @@ def parseFifo(self): tmpcell2[cid] = { 'FREQ' : tmpcell['FREQ'], 'PLMN' : "-1", 'type' : "4G", + 'band' : "-1", 'eARFCN' : int(tmpcell['DL_EARFCN']), 'POWER' : tmpcell['POWER'], } From 85738b04c594b8395ab47ebbc92595b424092182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 15 Nov 2022 21:28:02 +0100 Subject: [PATCH 28/88] Updating the install script --- install_all-Ubuntu_20.04.sh => install_all-Ubuntu_22.04.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename install_all-Ubuntu_20.04.sh => install_all-Ubuntu_22.04.sh (100%) diff --git a/install_all-Ubuntu_20.04.sh b/install_all-Ubuntu_22.04.sh similarity index 100% rename from install_all-Ubuntu_20.04.sh rename to install_all-Ubuntu_22.04.sh From f86b03e79f4d620a9472ed2e712992dc27a7d77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 28 Nov 2022 20:13:46 +0100 Subject: [PATCH 29/88] Update installation script --- install_all-Ubuntu_22.04.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index c54259b..6bc4667 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -10,7 +10,7 @@ sudo python3 -m pip install -r requirements.txt echo "[+] Installing GNU Radio dependencies" sudo add-apt-repository ppa:gnuradio/gnuradio-releases sudo apt-get update -gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.8(.*)"|sed 's/ 500//'|sed 's/ //') +gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*)"|sed 's/ 500//'|sed 's/ //') sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.8 installation sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ @@ -22,25 +22,23 @@ python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1 echo "[+] Installing gr-osmosdr package" sudo apt install gr-osmosdr -echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.8" +echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.10" mkdir thirdparty cd thirdparty REMPATH=`pwd` -git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git -echo "[+] Building and installing gr-gsm for GNU Radio 3.8" +git clone https://github.com/bkerler/gr-gsm +echo "[+] Building and installing gr-gsm for GNU Radio 3.10" cd gr-gsm mkdir build cd build -cmake ../ +cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../ make -j$(nproc) sudo make install -sudo ln -s /usr/local/lib/python3/dist-packages/grgsm /usr/lib/python3/dist-packages/ -sudo ln -s /usr/local/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git /usr/lib/x86_64-linux-gnu/libgrgsm.so.1.0.0git cd ../../ echo "[+] Installing SDK tools" -sudo apt install openjdk-14-jdk -wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip -unzip commandlinetools-linux-6609375_latest.zip +sudo apt install openjdk-17-jdk +wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip +unzip platform-tools-latest-linux.zip sudo mkdir -p /opt/Android cd tools ./bin/sdkmanager --sdk_root=/opt/Android --update From 0ca2250b70c8593c59b35bf16941e1ac86e56fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 28 Nov 2022 20:25:37 +0100 Subject: [PATCH 30/88] Updating submodules srsLTE --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 7ee0725..18e973f 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 7ee07253519b17ac5a928d14deac11cdf3295b40 +Subproject commit 18e973f236b92b4ea5f13de4d2fecdbd4b16c0e7 From c81fb2b72af2b1f3e39a5cb8f2441e8746fc49af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 28 Nov 2022 22:05:32 +0100 Subject: [PATCH 31/88] Updating gr-gsm --- install_all-Ubuntu_22.04.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 6bc4667..1bb2aae 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -19,13 +19,20 @@ libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 -echo "[+] Installing gr-osmosdr package" -sudo apt install gr-osmosdr - -echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.10" +echo "[+] Installing gr-osmosdr from source" mkdir thirdparty cd thirdparty REMPATH=`pwd` +#sudo apt install gr-osmosdr +git clone https://github.com/osmocom/gr-osmosdr +cd gr-osmosdr +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../ +make -j$(nproc) +sudo make install +cd $REMPATH +echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.10" git clone https://github.com/bkerler/gr-gsm echo "[+] Building and installing gr-gsm for GNU Radio 3.10" cd gr-gsm From 4f0490cc21b0e61ca0416328584b2c6044abbcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 28 Nov 2022 22:42:06 +0100 Subject: [PATCH 32/88] Updating the scanner for GSM --- engines/sdr/grgsm_scanner.py | 474 ++++++++++++++++++++++++++++++----- 1 file changed, 416 insertions(+), 58 deletions(-) mode change 100755 => 100644 engines/sdr/grgsm_scanner.py diff --git a/engines/sdr/grgsm_scanner.py b/engines/sdr/grgsm_scanner.py old mode 100755 new mode 100644 index d32e254..c706ab1 --- a/engines/sdr/grgsm_scanner.py +++ b/engines/sdr/grgsm_scanner.py @@ -1,13 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/python3 # -*- coding: utf-8 -*- # @file # @author (C) 2015 by Piotr Krysik # @author (C) 2015 by Roman Khassraf -# @adaptation (C) 2020 by Sebastien Dudek (@FlUxIuS) # @section LICENSE # -# GRGSM Scanner Modmobmap edition -# # Gr-gsm is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) @@ -27,6 +24,7 @@ from core.mLog import * from gnuradio import blocks +from gnuradio import network from gnuradio import gr from gnuradio import eng_notation from gnuradio.eng_option import eng_option @@ -35,13 +33,244 @@ from math import pi from optparse import OptionParser -import grgsm +import math +from gnuradio import gsm import numpy import os import osmosdr import pmt import time import sys +import gnuradio.gsm.arfcn as arfcn +import gc + + +class multichannel_receiver(gr.hier_block2): + def __init__(self, arfcns=[], center_freq=935e6, osr=4, tseq=1, wide_samp_rate=2e6): + gr.hier_block2.__init__( + self, "Multi Arfcns GSM Receiver", + gr.io_signature(1, 1, gr.sizeof_gr_complex * 1), + gr.io_signaturev(len(arfcns), len(arfcns), list(map(lambda x: gr.sizeof_gr_complex * 1, arfcns))), + ) + self.message_port_register_hier_out("out_c0") + self.message_port_register_hier_out("out_cx") + + ################################################## + # Parameters + ################################################## + self.arfcns = arfcns + self.center_freq = center_freq + self.osr = osr + self.tseq = tseq + self.wide_samp_rate = wide_samp_rate + ################################################## + # Variables + ################################################## + self.samp_rate = samp_rate = 1e6 + self.fcs = fcs = list(map(lambda x: arfcn.arfcn2downlink(x), arfcns)) + + ################################################## + # Blocks + ################################################## + self.gsm_receiver = gsm.receiver(osr, arfcns, [tseq], False) + self.gsm_clock_offset_control = gsm.clock_offset_control(fcs[0], samp_rate, osr) + self.pfb_arb_resamplers_xxx = [] + self.gsm_inputs = [] + self.blocks_rotators_cc = [] + + for i in range(len(self.fcs)): + resampler = pfb.arb_resampler_ccf( + samp_rate / wide_samp_rate, + taps=None, + flt_size=32) + resampler.declare_sample_delay(0) + self.pfb_arb_resamplers_xxx.append(resampler) + + gsm_input = gsm.gsm_input( + ppm=0, + osr=osr, + fc=fcs[i], + samp_rate_in=samp_rate, + ) + self.gsm_inputs.append(gsm_input) + + blocks_rotator_cc = blocks.rotator_cc(-2 * pi * (fcs[i] - center_freq) / wide_samp_rate) + self.blocks_rotators_cc.append(blocks_rotator_cc) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.gsm_clock_offset_control, 'ctrl'), (gsm_input, 'ctrl_in')) + self.connect((blocks_rotator_cc, 0), (resampler, 0)) + self.connect((gsm_input, 0), (self.gsm_receiver, i)) + self.connect((gsm_input, 0), (self, i)) + self.connect((self, 0), (blocks_rotator_cc, 0)) + self.connect((resampler, 0), (gsm_input, 0)) + + self.msg_connect((self.gsm_receiver, 'measurements'), (self.gsm_clock_offset_control, 'measurements')) + self.msg_connect((self.gsm_receiver, 'C0'), (self, 'out_c0')) + self.msg_connect((self.gsm_receiver, 'CX'), (self, 'out_cx')) + + +class sdcch8_decoder_hopping(gr.top_block): + def __init__(self, arfcns_list=[], ccch_index=2, hsn=5, maio=0, osr=4, ts=1, tseq=0, reclen=5, ppm=0, args=""): + gr.top_block.__init__(self, "Multy arfncs sdcch8 decoder") + + ################################################## + # Parameters + ################################################## + self.arfcns_list = arfcns_list + self.ccch_index = ccch_index + self.hsn = hsn + self.maio = maio + self.osr = osr + self.ts = ts + self.tseq = tseq + + ################################################## + # Variables + ################################################## + self.arfcns = arfcns = list(arfcns_list) + self.fcs = fcs = list(map(arfcn.arfcn2downlink, arfcns)) + self.wide_samp_rate = wide_samp_rate = max(1e6, int(math.ceil((max(fcs) - min(fcs)) * 1.1 / 1e6)) * 1e6) + self.center_freq = center_freq = ((max(fcs) + min(fcs)) / 2) + snippets_main_after_init(self) + ################################################## + # Blocks + ################################################## + self.osmosdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + + str(gsm.device.get_default_args(args))) + + self.osmosdr_source_0.set_sample_rate(wide_samp_rate) + self.osmosdr_source_0.set_center_freq(center_freq, 0) + self.osmosdr_source_0.set_freq_corr(ppm, 0) + + self.osmosdr_source_0.set_dc_offset_mode(2, 0) + self.osmosdr_source_0.set_iq_balance_mode(0, 0) + self.osmosdr_source_0.set_gain_mode(True, 0) + self.osmosdr_source_0.set_bandwidth(0, 0) + self.osmosdr_source_0.set_gain(14, 0) + self.osmosdr_source_0.set_if_gain(40, 0) + self.osmosdr_source_0.set_bb_gain(32, 0) + self.gsm_sdcch8_demapper_0 = gsm.gsm_sdcch8_demapper( + timeslot_nr=ts, + ) + self.gsm_multiarfcns_receiver_0 = multichannel_receiver( + arfcns=[arfcns[ccch_index]] + arfcns[0:ccch_index] + arfcns[(ccch_index + 1):len(arfcns)], + center_freq=center_freq, + osr=osr, + tseq=tseq, + wide_samp_rate=wide_samp_rate, + ) + + self.gsm_extract_cmc_0 = gsm.extract_cmc() + self.gsm_cx_channel_hopper_0 = gsm.cx_channel_hopper(arfcns, maio, hsn) + self.gsm_control_channels_decoder_0 = gsm.control_channels_decoder() + self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex * 1, int(wide_samp_rate * reclen)) + + self.blocks_socket_pdu_0 = network.socket_pdu('UDP_CLIENT', '127.0.0.1', '4729', 10000, False) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) + self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_extract_cmc_0, 'msgs')) + self.msg_connect((self.gsm_cx_channel_hopper_0, 'bursts'), (self.gsm_sdcch8_demapper_0, 'bursts')) + self.msg_connect((self.gsm_multiarfcns_receiver_0, 'out_c0'), (self.gsm_cx_channel_hopper_0, 'CX')) + self.msg_connect((self.gsm_multiarfcns_receiver_0, 'out_cx'), (self.gsm_cx_channel_hopper_0, 'CX')) + self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) + self.connect((self.blocks_head_0, 0), (self.gsm_multiarfcns_receiver_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.blocks_head_0, 0)) + + def get_arfcns_list(self): + return self.arfcns_list + + def set_arfcns_list(self, arfcns_list): + self.arfcns_list = arfcns_list + + def get_ccch_index(self): + return self.ccch_index + + def set_ccch_index(self, ccch_index): + self.ccch_index = ccch_index + + def get_hsn(self): + return self.hsn + + def set_hsn(self, hsn): + self.hsn = hsn + + def get_maio(self): + return self.maio + + def set_maio(self, maio): + self.maio = maio + + def get_osr(self): + return self.osr + + def set_osr(self, osr): + self.osr = osr + self.gsm_multiarfcns_receiver_0.set_osr(self.osr) + + def get_ts(self): + return self.ts + + def set_ts(self, ts): + self.ts = ts + self.gsm_sdcch8_demapper_0.set_timeslot_nr(self.ts) + + def get_tseq(self): + return self.tseq + + def set_tseq(self, tseq): + self.tseq = tseq + self.gsm_multiarfcns_receiver_0.set_tseq(self.tseq) + + def get_arfcns(self): + return self.arfcns + + def set_arfcns(self, arfcns): + self.arfcns = arfcns + self.set_fcs(list(map(arfcn.arfcn2downlink, self.arfcns))) + + def get_fcs(self): + return self.fcs + + def set_fcs(self, fcs): + self.fcs = fcs + self.set_center_freq(((max(self.fcs) + min(self.fcs)) / 2)) + self.set_wide_samp_rate(max(1e6, int(math.ceil((max(self.fcs) - min(self.fcs)) * 1.1 / 1e6)) * 1e6)) + + def get_wide_samp_rate(self): + return self.wide_samp_rate + + def set_wide_samp_rate(self, wide_samp_rate): + self.wide_samp_rate = wide_samp_rate + self.blocks_head_0.set_length(int(self.wide_samp_rate * 30)) + self.gsm_multiarfcns_receiver_0.set_wide_samp_rate(self.wide_samp_rate) + self.osmosdr_source_0.set_sample_rate(self.wide_samp_rate) + + def get_center_freq(self): + return self.center_freq + + def set_center_freq(self, center_freq): + self.center_freq = center_freq + self.gsm_multiarfcns_receiver_0.set_center_freq(self.center_freq) + self.osmosdr_source_0.set_center_freq(self.center_freq, 0) + + +def snipfcn_check_bandwidth(self): + if (self.wide_samp_rate > 20e6): # for hackrf + print("Very wide bandwidth for this arfcns: " + str(self.wide_samp_rate / 1e6) + " MHz") + self.stop() + else: + print("Wide bandwidth: " + str(self.wide_samp_rate / 1e6) + " MHz") + + +def snippets_main_after_init(tb): + snipfcn_check_bandwidth(tb) + # from wideband_receiver import * @@ -72,16 +301,16 @@ def __init__(self, OSR=4, chan_num=0, fc=939.4e6, ppm=0, samp_rate=0.2e6): ################################################## # Blocks ################################################## - self.gsm_receiver_0 = grgsm.receiver(OSR, ([chan_num]), ([])) - self.gsm_input_0 = grgsm.gsm_input( + self.gsm_receiver_0 = gsm.receiver(OSR, ([chan_num]), ([])) + self.gsm_input_0 = gsm.gsm_input( ppm=ppm, osr=OSR, fc=fc, samp_rate_in=samp_rate, ) - self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() - self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate, osr=4) - self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(0) + self.gsm_control_channels_decoder_0 = gsm.control_channels_decoder() + self.gsm_clock_offset_control_0 = gsm.clock_offset_control(fc, samp_rate, osr=4) + self.gsm_bcch_ccch_demapper_0 = gsm.gsm_bcch_ccch_demapper(0) ################################################## # Connections @@ -203,7 +432,7 @@ def get_samp_rate(self): class wideband_scanner(gr.top_block): - def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=24, ppm=0, args=""): + def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=40, ppm=0, args=""): gr.top_block.__init__(self, "Wideband Scanner") self.rec_len = rec_len @@ -214,8 +443,8 @@ def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=24, # if no file name is given process data from rtl_sdr source print("Args=", args) self.rtlsdr_source = osmosdr.source(args="numchan=" + str(1) + " " + - str(grgsm.device.get_default_args(args))) - #self.rtlsdr_source.set_min_output_buffer(int(sample_rate*rec_len)) #this line causes segfaults on HackRF + str(gsm.device.get_default_args(args))) + # self.rtlsdr_source.set_min_output_buffer(int(sample_rate*rec_len)) #this line causes segfaults on HackRF self.rtlsdr_source.set_sample_rate(sample_rate) # capture half of GSM channel lower than channel center (-0.1MHz) @@ -233,28 +462,46 @@ def __init__(self, rec_len=3, sample_rate=2e6, carrier_frequency=939e6, gain=24, self.rtlsdr_source.set_gain_mode(True, 0) self.rtlsdr_source.set_bandwidth(sample_rate, 0) self.rtlsdr_source.set_gain(gain, 0) - self.rtlsdr_source.set_if_gain(32, 0) - self.rtlsdr_source.set_bb_gain(30, 0) + self.rtlsdr_source.set_if_gain(40, 0) + self.rtlsdr_source.set_bb_gain(32, 0) self.head = blocks.head(gr.sizeof_gr_complex * 1, int(rec_len * sample_rate)) # shift again by -0.1MHz in order to align channel center in 0Hz self.blocks_rotator_cc = blocks.rotator_cc(-2 * pi * 0.1e6 / sample_rate) self.wideband_receiver = wideband_receiver(OSR=4, fc=carrier_frequency, samp_rate=sample_rate) - self.gsm_extract_system_info = grgsm.extract_system_info() + self.extract_immediate_assignment = gsm.extract_immediate_assignment(False, True, True) + self.gsm_extract_system_info = gsm.extract_system_info() self.connect((self.rtlsdr_source, 0), (self.head, 0)) self.connect((self.head, 0), (self.blocks_rotator_cc, 0)) self.connect((self.blocks_rotator_cc, 0), (self.wideband_receiver, 0)) self.msg_connect(self.wideband_receiver, 'msgs', self.gsm_extract_system_info, 'msgs') + self.msg_connect(self.wideband_receiver, 'msgs', self.extract_immediate_assignment, 'msgs') def set_carrier_frequency(self, carrier_frequency): self.carrier_frequency = carrier_frequency self.rtlsdr_source.set_center_freq(carrier_frequency - 0.1e6, 0) +class assignment_info(object): + def __init__(self, arfcn, channel, timeslot, tseq, maio, hsn, a5_vers=[]): + self.arfcn = arfcn + self.assignment_channel = channel + self.timeslot = timeslot + self.tseq = tseq + self.maio = maio + self.hsn = hsn + self.a5_vers = a5_vers + + def __str__(self): + return str(self.assignment_channel) + ", Timeslot: " + str(self.timeslot) + ", Training Sequence: " + str( + self.tseq) + ", MAIO: " + str(self.maio) + ", HSN: " + str(self.hsn) + ", A5/1 Version: " + ", ".join( + map(str, list(set(self.a5_vers)))) + + class channel_info(object): - def __init__(self, arfcn, freq, cid, lac, mcc, mnc, ccch_conf, power, neighbours, cell_arfcns): + def __init__(self, arfcn, freq, cid, lac, mcc, mnc, ccch_conf, power, neighbours, cell_arfcns, assignments): self.arfcn = arfcn self.freq = freq self.cid = cid @@ -265,16 +512,22 @@ def __init__(self, arfcn, freq, cid, lac, mcc, mnc, ccch_conf, power, neighbours self.power = power self.neighbours = neighbours self.cell_arfcns = cell_arfcns + self.assignments = assignments def __lt__(self, other): return self.arfcn < other.arfcn - def get_verbose_info(self): - i = " |---- Configuration: %s\n" % self.get_ccch_conf() - i += " |---- Cell ARFCNs: " + ", ".join(map(str, self.cell_arfcns)) + "\n" - i += " |---- Neighbour Cells: " + ", ".join(map(str, self.neighbours)) + "\n" - return i + v = " |---- Configuration: %s\n" % self.get_ccch_conf() + v += " |---- Cell ARFCNs: " + ", ".join(map(str, self.cell_arfcns)) + "\n" + if len(self.assignments) > 0: + v += " |---- DCCHs:\n" + for i in range(0, len(self.assignments)): + v += " |-------- " + "#" + str(i + 1) + " " + str(self.assignments[i]) + "\n" + + v += " |---- Neighbour Cells: " + ", ".join(map(str, self.neighbours)) + "\n" + + return v def get_ccch_conf(self): if self.ccch_conf == 0: @@ -293,6 +546,7 @@ def get_ccch_conf(self): def getKey(self): return self.arfcn + @Cellslogger def attr2dic(self): cell = {} @@ -303,6 +557,7 @@ def attr2dic(self): 'cid' : str(self.cid)} return cell + def __cmp__(self, other): if hasattr(other, 'getKey'): return self.getKey().__cmp__(other.getKey()) @@ -317,20 +572,25 @@ def __str__(self): return "ARFCN: %4u, Freq: %6.1fM, CID: %5u, LAC: %5u, MCC: %3u, MNC: %3u, Pwr: %3i" % ( self.arfcn, self.freq / 1e6, self.cid, self.lac, self.mcc, self.mnc, self.power) -def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): + +def do_scan(samp_rate, band, speed, ppm, gain, args, prn=None, debug=False): signallist = [] + server = network.socket_pdu('UDP_SERVER', '127.0.0.1', '4729', 10000, False) channels_num = int(samp_rate / 0.2e6) - for arfcn_range in grgsm.arfcn.get_arfcn_ranges(band): + for arfcn_range in gsm.arfcn.get_arfcn_ranges(band): first_arfcn = arfcn_range[0] last_arfcn = arfcn_range[1] + print("Try scan CCCH on " + str(first_arfcn) + "-" + str(last_arfcn) + " arfcn`s:") last_center_arfcn = last_arfcn - int((channels_num / 2) - 1) - current_freq = grgsm.arfcn.arfcn2downlink(first_arfcn + int(channels_num / 2) - 1) - last_freq = grgsm.arfcn.arfcn2downlink(last_center_arfcn) + start_freq = gsm.arfcn.arfcn2downlink(first_arfcn + int(channels_num / 2) - 1) + current_freq = start_freq + last_freq = gsm.arfcn.arfcn2downlink(last_center_arfcn) stop_freq = last_freq + 0.2e6 * channels_num while current_freq < stop_freq: - + print("Scanning: {percent:.2f}% done..".format( + percent=(current_freq - start_freq) / (stop_freq - start_freq) * 100)) if not debug: # silence rtl_sdr output: # open 2 fds @@ -340,17 +600,22 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): # put /dev/null fds on 1 and 2 os.dup2(null_fds[0], 1) os.dup2(null_fds[1], 2) - # instantiate scanner and processor - scanner = wideband_scanner(rec_len=6 - speed, + scanner = wideband_scanner(rec_len=30 - speed, sample_rate=samp_rate, carrier_frequency=current_freq, ppm=ppm, gain=gain, args=args) - # start recording scanner.start() scanner.wait() scanner.stop() + if not debug: + # restore file descriptors so we can print the results + os.dup2(save[0], 1) + os.dup2(save[1], 2) + # close the temporary fds + os.close(null_fds[0]) + os.close(null_fds[1]) freq_offsets = numpy.fft.ifftshift( numpy.array(range(int(-numpy.floor(channels_num / 2)), int(numpy.floor((channels_num + 1) / 2)))) * 2e5) @@ -368,36 +633,127 @@ def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = False): mncs = numpy.array(scanner.gsm_extract_system_info.get_mnc()) ccch_confs = numpy.array(scanner.gsm_extract_system_info.get_ccch_conf()) powers = numpy.array(scanner.gsm_extract_system_info.get_pwrs()) - + assignment_arfcns = numpy.array(scanner.extract_immediate_assignment.get_arfcn_ids()) + assignment_tseqs = numpy.array(scanner.extract_immediate_assignment.get_tseqs()) + assignment_maios = numpy.array(scanner.extract_immediate_assignment.get_maios()) + assignment_hsns = numpy.array(scanner.extract_immediate_assignment.get_hsns()) + assignment_timeslots = numpy.array(scanner.extract_immediate_assignment.get_timeslots()) + assignment_channels = numpy.array(scanner.extract_immediate_assignment.get_channel_types()) + cell_arfcn_lists = [] + neighbour_lists = [] for i in range(0, len(chans)): - cell_arfcn_list = scanner.gsm_extract_system_info.get_cell_arfcns(chans[i]) - neighbour_list = scanner.gsm_extract_system_info.get_neighbours(chans[i]) - - info = channel_info(grgsm.arfcn.downlink2arfcn(found_freqs[i]), found_freqs[i], + cell_arfcn_lists.append(scanner.gsm_extract_system_info.get_cell_arfcns(chans[i])) + neighbour_lists.append(scanner.gsm_extract_system_info.get_neighbours(chans[i])) + scanner = None + gc.collect() + for i in range(0, len(chans)): + cell_arfcn_list = cell_arfcn_lists[i] + neighbour_list = neighbour_lists[i] + found_arfcn = gsm.arfcn.downlink2arfcn(found_freqs[i]) + print("\nFound CCCH arfcn: " + str(found_arfcn)) + found_arfcn_assignments = [] + + for a in range(0, len(assignment_arfcns)): + + # print("Assigments: " + str(assignment_arfcns[a]) + "<->" + str(chans[i])) + if assignment_arfcns[a] == chans[i]: + dubl = False + for f in found_arfcn_assignments: + if f.assignment_channel == assignment_channels[a] and \ + f.timeslot == assignment_timeslots[a] and \ + f.tseq == assignment_tseqs[a] and \ + f.maio == assignment_maios[a] and \ + f.hsn == assignment_hsns[a]: + dubl = True + break + if not dubl: + a5_versions = [] + if len(cell_arfcn_list) > 0: + fcs = list(map(arfcn.arfcn2downlink, cell_arfcn_list)) + wide_samp_rate = max(1e6, int(math.ceil((max(fcs) - min(fcs)) * 1.1 / 1e6)) * 1e6) + if wide_samp_rate > 20e6: + # print("Very wide bandwidth for this hopping SDCCH/8 arfcns: " + str(wide_samp_rate/1e6) + " MHz, skip SDCCH/8 scan...") + a5_versions = [ + "?, arfcn`s range too wide: " + str(wide_samp_rate / 1e6) + " MHz"] + else: + try: + # print("Wide bandwidth: " + str(wide_samp_rate/1e6) + " MHz") + # print(", ".join(map(str, cell_arfcn_list))) + # print(found_arfcn) + ccch_index = tuple(cell_arfcn_list).index(found_arfcn) + print("Start SDCCH/8 scanning on " + str(found_arfcn) + " arfcn...") + for t in range(0, 6): + print(str(t + 1) + "`th try..") + if not debug: + # silence rtl_sdr output: + # open 2 fds + null_fds = [os.open(os.devnull, os.O_RDWR) for x in range(2)] + # save the current file descriptors to a tuple + save = os.dup(1), os.dup(2) + # put /dev/null fds on 1 and 2 + os.dup2(null_fds[0], 1) + os.dup2(null_fds[1], 2) + sdcch8_scanner = sdcch8_decoder_hopping(cell_arfcn_list, ccch_index, + assignment_hsns[a], + assignment_maios[a], 4, + assignment_timeslots[a], + assignment_tseqs[a], 30, ppm, + args) + if not debug: + os.dup2(save[0], 1) + os.dup2(save[1], 2) + # close the temporary fds + os.close(null_fds[0]) + os.close(null_fds[1]) + sdcch8_scanner.start() + sdcch8_scanner.wait() + sdcch8_scanner.stop() + a5_versions = sdcch8_scanner.gsm_extract_cmc_0.get_a5_versions() + if len(a5_versions) == 0: + a5_versions = ["?, not found CMC"] + else: + break + # print(", ".join(map(str, a5_versions))) + sdcch8_scanner = None + gc.collect() + except ValueError: + # print("Found arfcn not present in arfcns hopping list, skip SDCCH/8 scan...") + a5_versions = [ + "?, this CCCH is not present in hopping list | possible signal imposition"] + else: + print( + "!! Immidiate assigment got, but SDCCH/8 Channel Description not capture, skip SDCCH/8 scan...") + a5_versions = ["?, SDCCH/8 channel description not capture"] + found_arfcn_assignments.append(assignment_info(found_arfcn, assignment_channels[a], + assignment_timeslots[a], + assignment_tseqs[a], + assignment_maios[a], assignment_hsns[a], + a5_versions)) + if len(found_arfcn_assignments) == 0: + print("Dont capture immediate assignments, skip extract SDCCH/8 info and scan...") + info = channel_info(found_arfcn, found_freqs[i], cell_ids[i], lacs[i], mccs[i], mncs[i], ccch_confs[i], powers[i], - neighbour_list, cell_arfcn_list) + neighbour_list, cell_arfcn_list, found_arfcn_assignments) + + print(info) + print(info.get_verbose_info()) + found_list.append(info) scanner = None - - if not debug: - # restore file descriptors so we can print the results - os.dup2(save[0], 1) - os.dup2(save[1], 2) - # close the temporary fds - os.close(null_fds[0]) - os.close(null_fds[1]) if prn: prn(found_list) signallist.extend(found_list) current_freq += channels_num * 0.2e6 + server = None return signallist + def argument_parser(): parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - bands_list = ", ".join(grgsm.arfcn.get_bands()) + bands_list = ", ".join(gsm.arfcn.get_bands()) parser.add_option("-b", "--band", dest="band", default="GSM900", help="Specify the GSM band for the frequency.\nAvailable bands are: " + bands_list) parser.add_option("-s", "--samp-rate", dest="samp_rate", type="float", default=2e6, @@ -408,11 +764,11 @@ def argument_parser(): help="Set gain [default=%default]") parser.add_option("", "--args", dest="args", type="string", default="", help="Set device arguments [default=%default]." - " Use --list-devices the view the available devices") + " Use --list-devices the view the available devices") parser.add_option("-l", "--list-devices", action="store_true", help="List available SDR devices, use --args to specify hints") - parser.add_option("--speed", dest="speed", type="intx", default=4, - help="Scan speed [default=%default]. Value range 0-5.") + parser.add_option("--speed", dest="speed", type="intx", default=15, + help="Scan speed [default=%default]. Value range 0-29.") parser.add_option("-v", "--verbose", action="store_true", help="If set, verbose information output is printed: ccch configuration, cell ARFCN's, neighbour ARFCN's") parser.add_option("-d", "--debug", action="store_true", @@ -423,31 +779,33 @@ def argument_parser(): """ return parser -def main(options = None): + +def main(options=None): if options is None: (options, args) = argument_parser().parse_args() if options.list_devices: - grgsm.device.print_devices(options.args) + gsm.device.print_devices(options.args) sys.exit(0) - if options.band not in grgsm.arfcn.get_bands(): + if options.band not in gsm.arfcn.get_bands(): parser.error("Invalid GSM band\n") - if options.speed < 0 or options.speed > 5: + if options.speed < 0 or options.speed > 29: parser.error("Invalid scan speed.\n") if (options.samp_rate / 0.2e6) % 2 != 0: parser.error("Invalid sample rate. Sample rate must be an even numer * 0.2e6") - def printfunc(found_list): - for info in sorted(found_list): - print(info) - if options.verbose: - print(info.get_verbose_info()) + # def printfunc(found_list): + # for info in sorted(found_list): + # print(info) + # if options.verbose: + # print(info.get_verbose_info()) print("") do_scan(options.samp_rate, options.band, options.speed, - options.ppm, options.gain, options.args, prn = printfunc, debug = options.debug) + options.ppm, options.gain, options.args, prn=None, debug=options.debug) + if __name__ == '__main__': main() From d73a0fd4c71e1c2e23216b882dedaf2909413c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Mon, 28 Nov 2022 22:55:42 +0100 Subject: [PATCH 33/88] Adding a default device for GRGSM scanner --- utils/logprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/logprocess.py b/utils/logprocess.py index eebf2c1..a468084 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -202,7 +202,7 @@ def scanGRGSM(band): def trigfunc(found_list): for info in sorted(found_list): info.attr2dic() # trigger log - do_scan(2e6, band, 4, 0, 30.0, "", trigfunc, False) + do_scan(2e6, band, 4, 0, 30.0, "id=0", trigfunc, False) def processGRGSM(bands): From eed13b76d6fe411da92a0ae398a5e838837c6cc7 Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Tue, 3 Jan 2023 15:28:52 +0100 Subject: [PATCH 34/88] Fixing issues with the installation script --- install_all-Ubuntu_22.04.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 1bb2aae..7e7d99a 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -10,14 +10,26 @@ sudo python3 -m pip install -r requirements.txt echo "[+] Installing GNU Radio dependencies" sudo add-apt-repository ppa:gnuradio/gnuradio-releases sudo apt-get update -gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*)"|sed 's/ 500//'|sed 's/ //') -sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.8 installation +gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*) 500"|sed 's/ //'|sed 's/ 500//') +sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \ libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ -python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 +python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 \ +libsndfile-dev libtalloc-dev libpcsclite-dev wget unzip + +echo "[+] Installing osmocore" +sudo apt-get install build-essential libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev +git clone https://gitea.osmocom.org/osmocom/libosmocore.git +cd libosmocore/ +autoreconf -i +./configure +make +sudo make install +sudo ldconfig -i +cd .. echo "[+] Installing gr-osmosdr from source" mkdir thirdparty @@ -47,7 +59,7 @@ sudo apt install openjdk-17-jdk wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip unzip platform-tools-latest-linux.zip sudo mkdir -p /opt/Android -cd tools +cd platform-tools ./bin/sdkmanager --sdk_root=/opt/Android --update sudo ./bin/sdkmanager --sdk_root=/opt/Android --install platform-tools echo "[+] Installing dependencies for srsLTE" From d57e1afb4702586604aa62c9a19578fd849a2b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 3 Jan 2023 17:00:04 +0100 Subject: [PATCH 35/88] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0988127..b471a20 100644 --- a/README.md +++ b/README.md @@ -395,3 +395,7 @@ The process could be stopped at any time when killing the process with a keyboar [...] ^C[+] Cells save as cells_1528738901.json ``` + +## Docker image + +To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap-beta From e1ffb74826dfe8ba94b1f93f79089411867efc5e Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Tue, 3 Jan 2023 17:01:09 +0100 Subject: [PATCH 36/88] Fixing an issue with ADB install --- install_all-Ubuntu_22.04.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 7e7d99a..03db5b4 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -59,9 +59,7 @@ sudo apt install openjdk-17-jdk wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip unzip platform-tools-latest-linux.zip sudo mkdir -p /opt/Android -cd platform-tools -./bin/sdkmanager --sdk_root=/opt/Android --update -sudo ./bin/sdkmanager --sdk_root=/opt/Android --install platform-tools +sudo cp -R platform-tools echo "[+] Installing dependencies for srsLTE" sudo apt-get install cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev sudo apt install libsoapysdr-dev From 00d4d2739e32bd0993ee6c137cfb769e9e029332 Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Tue, 3 Jan 2023 18:45:17 +0100 Subject: [PATCH 37/88] Update srsLTE options --- install_all-Ubuntu_22.04.sh | 5 ++++- utils/logprocess.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 03db5b4..eac9fc7 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -18,7 +18,10 @@ python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \ libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 \ -libsndfile-dev libtalloc-dev libpcsclite-dev wget unzip +libsndfile-dev libtalloc-dev libpcsclite-dev wget unzip python3-pip libbladerf-dev \ +libuhd-dev uhd-host + +sudo pip3 install pyserial echo "[+] Installing osmocore" sudo apt-get install build-essential libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev diff --git a/utils/logprocess.py b/utils/logprocess.py index a468084..dc0d1a7 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -63,7 +63,7 @@ def startSrsLTExPSSProcess(cmdprog): for band in bands: commandstring = [mKB.config['SRSLTETOOLS_PATH']+cmdprog, "-b", band] if mKB.config['device_args'] is not None: - commandstring.append("-a") + commandstring.append("-d") commandstring.append(mKB.config['device_args']) p = subprocess.Popen(commandstring, stdout=subprocess.PIPE) p.wait() @@ -88,8 +88,8 @@ def startSrsLTEPSSCollect(): th.start() -def startSrsLTEPSS(): - th = Thread(target=startSrsLTEPSSProcess) +def startSrsLTENPSS(): + th = Thread(target=startSrsLTENPSSProcess) th.daemon = True th.start() startSrsLTENPSSCollect() From 556a630a34b7acb7112bae21836bc840e03bcee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 3 Jan 2023 18:46:59 +0100 Subject: [PATCH 38/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b471a20..84442e5 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ git submodule update --init --recursive To use this feature, please issue the following command: ``` -$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'id=3' +$ sudo python modmobmap.py -m srslte_pss -b 28 -d 'bladerf' [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. From e0f85c9335b2fcc3d1e0d9a2d17af2c2d307eba6 Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Tue, 3 Jan 2023 18:50:03 +0100 Subject: [PATCH 39/88] Changing device name --- modmobmap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modmobmap.py b/modmobmap.py index cfb21c9..6f15bee 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -59,9 +59,9 @@ def phone_actions(args): parser.add_argument('-s', '--sdk', dest='androidsdk', required=False, default='/opt/Android', help='Android SDK path') parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, - help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') + help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') parser.add_argument('-g', '--args', dest='dargs', required=False, default=None, - help='Device args for SDR engines') + help='Device name arg for SDR engines (e.g: bladerf))') parser.add_argument('-f', '--file', dest='file', required=False, default=None, help='File to parse. For the moment it could be used in combination with AT mode host.') args = parser.parse_args() From a3d3aa7dd197ddf35949e57f1cd143a60cf8c055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Tue, 3 Jan 2023 18:51:51 +0100 Subject: [PATCH 40/88] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84442e5..c170990 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ git submodule update --init --recursive To use this feature, please issue the following command: ``` -$ sudo python modmobmap.py -m srslte_pss -b 28 -d 'bladerf' +$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'bladerf' [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. @@ -363,7 +363,7 @@ The `g` parameters is not mandatory and is used mainly to select the right devic For NB-IoT scanning, you can use the `srslte_npss` option as follows: ``` -$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'id=3' +$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'bladerf' [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. From ee2481abb499c8dae1bac0e94297ec50e6ca85bc Mon Sep 17 00:00:00 2001 From: Grzegorz Wypych Date: Sat, 18 Feb 2023 21:32:52 +0100 Subject: [PATCH 41/88] Update README.md Fix readme for srsLTE --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c170990..d3c2ced 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ git submodule update --init --recursive To use this feature, please issue the following command: ``` -$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'bladerf' +$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'driver=bladerf' [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. From 93f6aac2e9d7060fd06d7def8a359cbb500e2f9e Mon Sep 17 00:00:00 2001 From: Grzegorz Wypych Date: Sat, 18 Feb 2023 21:33:35 +0100 Subject: [PATCH 42/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3c2ced..74b9d0a 100644 --- a/README.md +++ b/README.md @@ -363,7 +363,7 @@ The `g` parameters is not mandatory and is used mainly to select the right devic For NB-IoT scanning, you can use the `srslte_npss` option as follows: ``` -$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'bladerf' +$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'driver=bladerf' [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. From 5a0f0cf51a8acde36e2d5b5c01e7395770c400ac Mon Sep 17 00:00:00 2001 From: h0rac Date: Sat, 18 Feb 2023 22:23:17 +0100 Subject: [PATCH 43/88] fix srsLTE modules - multiple issues --- core/mLog.py | 16 ++++++++-------- utils/logprocess.py | 25 +++++++++++++++++++------ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/core/mLog.py b/core/mLog.py index 1c9ac17..1a3e728 100755 --- a/core/mLog.py +++ b/core/mLog.py @@ -27,19 +27,19 @@ def wrapped(*args, **kwargs): if id_ not in kb.data['SM_cells'] and id_ is not None: kb.data['SM_cells'][id_] = v if kb.config['verbose'] == True: - string2print = "[+] New cell detected [CellID/PCI-DL_freq (%s)]" % id_ - string2print += "\n\r Network type=%s" % v['type'] - string2print += "\n\r PLMN=%s" % v['PLMN'] + string2print = "[+] New cell detected [CellID/PCI-DL_freq ({})]".format(id_) + string2print += "\n\r Network type={}".format(v['type']) + string2print += "\n\r PLMN={}".format(v['PLMN']) if 'band' in v: - string2print += "\n\r Band=%i" % v['band'] + string2print += "\n\r Band={}".format(v['band']) if '4G' in v['type']: - string2print += "\n\r Downlink EARFCN=%i" % v['eARFCN'] + string2print += "\n\r Downlink EARFCN={}".format(v['eARFCN']) elif '3G' in v['type']: - string2print += "\n\r Downlink UARFCN=%i" % v['RX'] + string2print += "\n\r Downlink UARFCN={}".format(v['RX']) if 'TX' in v: - string2print += "\n\r Uplink UARFCN=%i" % v['TX'] + string2print += "\n\r Uplink UARFCN={}".format(v['TX']) elif '2G' in v['type']: - string2print += "\n\r ARFCN=%i" % v['arfcn'] + string2print += "\n\r ARFCN={}".format(v['arfcn']) print (bcolors.OKGREEN+string2print+bcolors.ENDC) return result return wrapped diff --git a/utils/logprocess.py b/utils/logprocess.py index dc0d1a7..d8569ad 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -55,6 +55,7 @@ def startXgoldmodCollect(): def startSrsLTExPSSProcess(cmdprog): + global state import subprocess state = True bands = mKB.config['bands'].split(",") @@ -63,10 +64,9 @@ def startSrsLTExPSSProcess(cmdprog): for band in bands: commandstring = [mKB.config['SRSLTETOOLS_PATH']+cmdprog, "-b", band] if mKB.config['device_args'] is not None: - commandstring.append("-d") + commandstring.append("-a") commandstring.append(mKB.config['device_args']) - p = subprocess.Popen(commandstring, stdout=subprocess.PIPE) - p.wait() + p = subprocess.run(commandstring) except (KeyboardInterrupt, SystemExit): state = False cells = kb.data['SM_cells'] @@ -82,6 +82,7 @@ def startSrsLTEPSSProcess(): def startSrsLTEPSSCollect(): + print("STARTED COLLECT") srs = srslte_pss() th = Thread(target=srs.parseFifo) th.daemon = True @@ -94,6 +95,7 @@ def startSrsLTENPSS(): th.start() startSrsLTENPSSCollect() state = True + th.join() while state: try: pass @@ -102,13 +104,15 @@ def startSrsLTENPSS(): cells = kb.data['SM_cells'] saveCells(cells) - +import signal def startSrsLTEPSS(): + #global th, state th = Thread(target=startSrsLTEPSSProcess) th.daemon = True th.start() startSrsLTEPSSCollect() - state = True + state=True + th.join() while state: try: pass @@ -117,6 +121,15 @@ def startSrsLTEPSS(): cells = kb.data['SM_cells'] saveCells(cells) +def signal_handler(sig, frame): + global th, state + print('Keyboard interrupt received, stopping srsLTE PSS...') + state = False + cells = kb.data['SM_cells'] + saveCells(cells) + sys.exit(0) + +signal.signal(signal.SIGINT, signal_handler) def startSrsLTEPSSCollect(): srs = srslte_pss() @@ -248,7 +261,7 @@ def load_operators(): if len(operators) > 0 or operators is not None: print (bcolors.WARNING+"Found %i operators in cache, do you want to reuse them?:\n\t%s"+bcolors.ENDC % (len(operators), str(operators))) answ = input('(Y)es or (N)o?') - if answ.lower() is 'y': + if answ.lower() == 'y': return operators f.close() except: From 94f848720f476a975633dd051afb8a84b3b9abf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 09:54:54 +0100 Subject: [PATCH 44/88] Updating contribution --- engines/android/generic/RILd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/android/generic/RILd.py b/engines/android/generic/RILd.py index 31200c7..96c7a25 100644 --- a/engines/android/generic/RILd.py +++ b/engines/android/generic/RILd.py @@ -3,7 +3,7 @@ # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): -# )synacktiv.com> wrote this file. As long as you retain this notice you +# )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) # ---------------------------------------------------------------------------- From 5a6f59da3adb256e80de3ee1f8ed4555ef17e516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 09:56:44 +0100 Subject: [PATCH 45/88] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74b9d0a..2235a74 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,10 @@ Requirements ------------- Here are the following requirements: -- Python 2 or 3; +- Python 3; - Last Android SDK to run ADB: https://developer.android.com/studio/#downloads; - A compatible mobile phone; -- GNU Radio 3.8 with gr-gsm to scan GSM stations with Software-Defined Radio +- GNU Radio 3.10 with gr-gsm to scan GSM stations with Software-Defined Radio - A valid/invalid SIM card (just in case to provide an IMSI number). Ubuntu installation From 92b189d318ac6c6e3f1ba6806e23786e97041901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 10:01:02 +0100 Subject: [PATCH 46/88] Adding contributor name to srs module --- engines/sdr/srslte_pss.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/sdr/srslte_pss.py b/engines/sdr/srslte_pss.py index 5d3aa30..e2654d9 100644 --- a/engines/sdr/srslte_pss.py +++ b/engines/sdr/srslte_pss.py @@ -6,6 +6,9 @@ # )penthertz.com> wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return FlUxIuS ;) +# +# We'd like to thank our contributors for maintening this code: +# - @h0rac (Grzegorz Wypych) from PWNSec.pl # ---------------------------------------------------------------------------- from __future__ import print_function From c6b894666294e6ac339e0689458fcee7f07609a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 10:03:55 +0100 Subject: [PATCH 47/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2235a74..72df37c 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Here are the following requirements: Ubuntu installation --------------------- -A `install_all-Ubuntu_20.04.sh` script installing all dependencies for all engines is available in the root directory. +A `install_all-Ubuntu_22.04.sh` script installing all dependencies for all engines is available in the root directory. For other distributions, please adapt this script base on listed dependencies. From baa8a8cb0d04783e690f766e42f6b61f4734d607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 10:59:28 +0100 Subject: [PATCH 48/88] Supporting Soapy devices --- engines/sdr/srslte_pss.py | 2 +- install_all-Ubuntu_22.04.sh | 2 +- utils/logprocess.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/engines/sdr/srslte_pss.py b/engines/sdr/srslte_pss.py index e2654d9..e929259 100644 --- a/engines/sdr/srslte_pss.py +++ b/engines/sdr/srslte_pss.py @@ -50,7 +50,7 @@ def parseFifo(self): 'type' : "4G", 'band' : "-1", 'eARFCN' : int(tmpcell['DL_EARFCN']), - 'POWER' : tmpcell['POWER'], + 'POWER' : tmpcell['POWER'].split("\n")[0], } self.go2logs(tmpcell2) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index eac9fc7..b375d83 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -19,7 +19,7 @@ libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0 \ libsndfile-dev libtalloc-dev libpcsclite-dev wget unzip python3-pip libbladerf-dev \ -libuhd-dev uhd-host +libuhd-dev uhd-host librtlsdr-dev sudo pip3 install pyserial diff --git a/utils/logprocess.py b/utils/logprocess.py index d8569ad..90f859f 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -64,8 +64,11 @@ def startSrsLTExPSSProcess(cmdprog): for band in bands: commandstring = [mKB.config['SRSLTETOOLS_PATH']+cmdprog, "-b", band] if mKB.config['device_args'] is not None: + splitted_arg = mKB.config['device_args'].split(':') + commandstring.append("-d") + commandstring.append(splitted_arg[0]) commandstring.append("-a") - commandstring.append(mKB.config['device_args']) + commandstring.append(splitted_arg[1]) p = subprocess.run(commandstring) except (KeyboardInterrupt, SystemExit): state = False From c3e2b8477c1c9228131de69c6395df3143c391e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:02:39 +0100 Subject: [PATCH 49/88] Updating srsLTE commit --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 18e973f..0b5ebbe 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 18e973f236b92b4ea5f13de4d2fecdbd4b16c0e7 +Subproject commit 0b5ebbea0e978aa80cec140ac6d90f3006f3382f From e9bdb02799627ecdc70f9e84cb0a81a02629610b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:10:09 +0100 Subject: [PATCH 50/88] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72df37c..d2575cb 100644 --- a/README.md +++ b/README.md @@ -306,10 +306,10 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 ARFCN=978 ``` -Using Modmobmap with srsLTE +Using Modmobmap with srsRAN ------------------------------ -Modmodmap can be used with `srsLTE` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. +Modmodmap can be used with `srsRAN` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: @@ -320,7 +320,7 @@ git submodule update --init --recursive To use this feature, please issue the following command: ``` -$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'driver=bladerf' +$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'soapy:id=1' # you need to precise the driver, and id of the device that way [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. @@ -363,7 +363,7 @@ The `g` parameters is not mandatory and is used mainly to select the right devic For NB-IoT scanning, you can use the `srslte_npss` option as follows: ``` -$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'driver=bladerf' +$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'soapy:id=1' # you need to precise the driver, and id of the device that way [INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 [INFO] [LOGGING] Fastpath logging disabled at runtime. From 8566d35dcba346e8a470f155044430238d00761a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:23:36 +0100 Subject: [PATCH 51/88] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index d2575cb..1321748 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,14 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 Using Modmobmap with srsRAN ------------------------------ + +Supported drivers: + +* uhd +* bladerf +* soapy + + Modmodmap can be used with `srsRAN` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: From de710cf51bb329af1404f11af73bc384e16421bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:25:44 +0100 Subject: [PATCH 52/88] Update README.md --- README.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1321748..1f3b9d6 100644 --- a/README.md +++ b/README.md @@ -328,16 +328,21 @@ git submodule update --init --recursive To use this feature, please issue the following command: ``` -$ sudo python modmobmap.py -m srslte_pss -b 28 -g 'soapy:id=1' # you need to precise the driver, and id of the device that way - -[INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 -[INFO] [LOGGING] Fastpath logging disabled at runtime. -[...] - -Found Rafael Micro R820T tuner +python3 modmobmap.py -m srslte_pss -b 28 -g 'soapy:id=1' +Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_soapy.so libsrsran_rf_blade.so libsrsran_rf_zmq.so +Inactive RF plugins: +Opening RF device... +Supported RF device list: UHD soapy bladeRF zmq file +[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5 Found Rafael Micro R820T tuner -[INFO] Using format CF32. - +Soapy has found device #0: driver=SpectranV6, label=SpectranV6 RTSA HTTP Stream, manufacturer=HB9FXQ, product=SpectranV6 RTSA HTTP Stream, serial=SPECTRAN-V6-00000000000, +Soapy has found device #1: available=Yes, driver=rtlsdr, label=Generic RTL2832U OEM :: 00000001, manufacturer=Realtek, product=RTL2838UHIDIR, rtl=0, serial=00000001, tuner=Rafael Micro R820T, +Selecting Soapy device: 1 +[...] + Network type=4G + PLMN=-1 + Band=-1 + Downlink EARFCN=9233 [+] New cell detected [CellID/PCI-DL_freq (2-9383)] Network type=4G PLMN=-1 From 16eb6b138aa0d3f858d1b77cddfd855b6e94bb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:26:48 +0100 Subject: [PATCH 53/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f3b9d6..cbf3c2f 100644 --- a/README.md +++ b/README.md @@ -335,7 +335,7 @@ Opening RF device... Supported RF device list: UHD soapy bladeRF zmq file [INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5 Found Rafael Micro R820T tuner -Soapy has found device #0: driver=SpectranV6, label=SpectranV6 RTSA HTTP Stream, manufacturer=HB9FXQ, product=SpectranV6 RTSA HTTP Stream, serial=SPECTRAN-V6-00000000000, +[...] Soapy has found device #1: available=Yes, driver=rtlsdr, label=Generic RTL2832U OEM :: 00000001, manufacturer=Realtek, product=RTL2838UHIDIR, rtl=0, serial=00000001, tuner=Rafael Micro R820T, Selecting Soapy device: 1 [...] From 21ee39bf1feb59688ead5903aaa45b6a67aba78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:32:52 +0100 Subject: [PATCH 54/88] Updating submodules srsLTE commit --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 0b5ebbe..199c607 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 0b5ebbea0e978aa80cec140ac6d90f3006f3382f +Subproject commit 199c6076e8c59c2fbdf755799db7640d8ce83eee From 2692b2046f79546fa04a97117cb69d08bcd5d47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:46:30 +0100 Subject: [PATCH 55/88] Update README.md --- README.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cbf3c2f..25eb7b4 100644 --- a/README.md +++ b/README.md @@ -310,13 +310,6 @@ Using Modmobmap with srsRAN ------------------------------ -Supported drivers: - -* uhd -* bladerf -* soapy - - Modmodmap can be used with `srsRAN` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: @@ -373,6 +366,30 @@ Selecting Soapy device: 1 The `g` parameters is not mandatory and is used mainly to select the right device to scan the Synchronization Signals. +To find the right device with Soapy, you can type the following command: + +``` +###################################################### +## Soapy SDR -- the SDR abstraction library ## +###################################################### + +[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5 +Found device 0 + driver = SpectranV6 + label = SpectranV6 RTSA HTTP Stream + manufacturer = HB9FXQ + product = SpectranV6 RTSA HTTP Stream + serial = SPECTRAN-V6-00000000000 + +Found device 1 + backend = libusb + device = 0x01:0x13 + driver = bladerf + instance = 0 + label = BladeRF #0 [bd7fffbf..d5958b06] + serial = bd7fffbf8efb4de4ba08d94bd5958b06 +``` + For NB-IoT scanning, you can use the `srslte_npss` option as follows: ``` From 48290ef43ce4447c5e4f749890e829bf347b35f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 11:48:07 +0100 Subject: [PATCH 56/88] Updating args infos --- modmobmap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmobmap.py b/modmobmap.py index 6f15bee..05d8088 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -61,7 +61,7 @@ def phone_actions(args): parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') parser.add_argument('-g', '--args', dest='dargs', required=False, default=None, - help='Device name arg for SDR engines (e.g: bladerf))') + help='Device name arg for SDR engines (e.g: soapy:id=0))') parser.add_argument('-f', '--file', dest='file', required=False, default=None, help='File to parse. For the moment it could be used in combination with AT mode host.') args = parser.parse_args() From f21c3f261def393f0961b586b9a377bbb2d82d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 12:06:21 +0100 Subject: [PATCH 57/88] Including the band number on PSS scans --- engines/sdr/srslte_pss.py | 2 +- thirdparty/srsLTE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/sdr/srslte_pss.py b/engines/sdr/srslte_pss.py index e929259..c298ade 100644 --- a/engines/sdr/srslte_pss.py +++ b/engines/sdr/srslte_pss.py @@ -48,7 +48,7 @@ def parseFifo(self): tmpcell2[cid] = { 'FREQ' : tmpcell['FREQ'], 'PLMN' : "-1", 'type' : "4G", - 'band' : "-1", + 'band' : tmpcell['BAND'], 'eARFCN' : int(tmpcell['DL_EARFCN']), 'POWER' : tmpcell['POWER'].split("\n")[0], } diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 199c607..8479ae4 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 199c6076e8c59c2fbdf755799db7640d8ce83eee +Subproject commit 8479ae47917b7b646ddeb3a9a7f662eea450954d From 5f4382cba9ee02ac0b9a9530e2ce2bc42da21799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 12:15:56 +0100 Subject: [PATCH 58/88] Update README.md --- README.md | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 25eb7b4..c6a0a2f 100644 --- a/README.md +++ b/README.md @@ -332,34 +332,31 @@ Found Rafael Micro R820T tuner Soapy has found device #1: available=Yes, driver=rtlsdr, label=Generic RTL2832U OEM :: 00000001, manufacturer=Realtek, product=RTL2838UHIDIR, rtl=0, serial=00000001, tuner=Rafael Micro R820T, Selecting Soapy device: 1 [...] +[+] New cell detected [CellID/PCI-DL_freq (447-9230)] Network type=4G PLMN=-1 - Band=-1 - Downlink EARFCN=9233 -[+] New cell detected [CellID/PCI-DL_freq (2-9383)] - Network type=4G - PLMN=-1 - Downlink EARFCN=9383 -[+] New cell detected [CellID/PCI-DL_freq (95-9461)] - Network type=4G - PLMN=-1 - Downlink EARFCN=9461 -[+] New cell detected [CellID/PCI-DL_freq (259-9591)] - Network type=4G - PLMN=-1 - Downlink EARFCN=9591 -[+] New cell detected [CellID/PCI-DL_freq (259-9592)] + Band=28 + Downlink EARFCN=9230 +[ 21/449]: EARFCN 9231 Freq. 760.10 MHz looking for PSS. +[+] New cell detected [CellID/PCI-DL_freq (303-9231)] Network type=4G PLMN=-1 - Downlink EARFCN=9592 -[+] New cell detected [CellID/PCI-DL_freq (1-9593)] + Band=28 + Downlink EARFCN=9231 +[ 22/449]: EARFCN 9232 Freq. 760.20 MHz looking for PSS. +[+] New cell detected [CellID/PCI-DL_freq (0-9233)] Network type=4G PLMN=-1 - Downlink EARFCN=9593 -[+] New cell detected [CellID/PCI-DL_freq (1-9594)] + Band=28 + Downlink EARFCN=9233 +[ 24/449]: EARFCN 9234 Freq. 760.40 MHz looking for PSS +... +Found CELL ID 105. 25 PRB, 2 ports +[+] New cell detected [CellID/PCI-DL_freq (105-9235)] Network type=4G PLMN=-1 - Downlink EARFCN=9594 + Band=28 + Downlink EARFCN=9235 [...] ^C[+] Cells save as cells_1595446203.json ``` From 8200859ce049e896bacc5b5626e722b81de52c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 12:16:04 +0100 Subject: [PATCH 59/88] Create README.md From 371d30c1e523ffdac6579bbd4e8e6fb0f2de7069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 12:28:32 +0100 Subject: [PATCH 60/88] Update README.md --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c6a0a2f..83fe9d7 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,12 @@ $ python modmobmap.py -m grgsm -b GSM-R,GSM900 Using Modmobmap with srsRAN ------------------------------ +Supported drivers: + +* uhd +* bladerf +* soapy + Modmodmap can be used with `srsRAN` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. @@ -318,8 +324,14 @@ Before running the engine, make sure all dependencies are installed. You can ref git submodule update --init --recursive ``` -To use this feature, please issue the following command: +To launch the tool with USRP, or bladeRF, you can choose or not to specify the driver as follows: + +``` +$ python3 modmobmap.py -m srslte_pss -b 28 -g 'driver=usrp' +``` + +With Soapy, use this format of command instead precising the `id` of the device to avoid picking a random device (e.g, sound device...): ``` python3 modmobmap.py -m srslte_pss -b 28 -g 'soapy:id=1' Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_soapy.so libsrsran_rf_blade.so libsrsran_rf_zmq.so From 160863ff84cdaf717128ca7a21c3d987a8f54236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 12:28:41 +0100 Subject: [PATCH 61/88] Restoring bladeRF and USRP driver selection --- utils/logprocess.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/utils/logprocess.py b/utils/logprocess.py index 90f859f..029bd27 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -64,11 +64,15 @@ def startSrsLTExPSSProcess(cmdprog): for band in bands: commandstring = [mKB.config['SRSLTETOOLS_PATH']+cmdprog, "-b", band] if mKB.config['device_args'] is not None: - splitted_arg = mKB.config['device_args'].split(':') - commandstring.append("-d") - commandstring.append(splitted_arg[0]) - commandstring.append("-a") - commandstring.append(splitted_arg[1]) + if 'soapy' in mKB.config['device_args']: + splitted_arg = mKB.config['device_args'].split(':') + commandstring.append("-d") + commandstring.append(splitted_arg[0]) + commandstring.append("-a") + commandstring.append(splitted_arg[1]) + else: # TODO handle id of multiple devices connected on USB + commandstring.append("-a") + commandstring.append(mKB.config['device_args']) p = subprocess.run(commandstring) except (KeyboardInterrupt, SystemExit): state = False From a3bf826dca269fb3d8fb8ca77b85476b61d93775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 13:28:24 +0100 Subject: [PATCH 62/88] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83fe9d7..11c6b7e 100644 --- a/README.md +++ b/README.md @@ -272,12 +272,20 @@ Note that retrieving results from AT+COPS command could take a lot of time and s Using Modmobmap with GRGSM ------------------------------ +Drivers supported: + +* bladerf +* uhd +* rtlsdr +* redpitaya +* soapy + Modmodmap can be used with `gr-gsm` to retrieve GSM cells' information with a Software-Defined Radio device compatible with OSMOSDR. To use this feature, please issue the following command: ``` -$ python modmobmap.py -m grgsm -b GSM-R,GSM900 +$ python modmobmap.py -m grgsm -b GSM-R,GSM900 -g rtlsdr => Switching to GSM-R band [+] New cell detected [CellID/PCI-DL_freq (****)] Network type=2G From 34cf269a12bdd01da4526b028a0c2d241124e6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 13:32:23 +0100 Subject: [PATCH 63/88] Fixing device selection on GRGSM module --- utils/logprocess.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/logprocess.py b/utils/logprocess.py index 029bd27..524eaa2 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -222,7 +222,10 @@ def scanGRGSM(band): def trigfunc(found_list): for info in sorted(found_list): info.attr2dic() # trigger log - do_scan(2e6, band, 4, 0, 30.0, "id=0", trigfunc, False) + device_args = "" + if mKB.config['device_args'] is not None: + device_args = mKB.config['device_args'] + do_scan(2e6, band, 4, 0, 30.0, device_args, trigfunc, False) def processGRGSM(bands): From d0904e20f44a20b83d31d92ab0150ca1c5df4ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 14:46:20 +0100 Subject: [PATCH 64/88] Fixing issues with GRGSM --- engines/sdr/grgsm_scanner.py | 2 +- utils/logprocess.py | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engines/sdr/grgsm_scanner.py b/engines/sdr/grgsm_scanner.py index c706ab1..5fb2f7b 100644 --- a/engines/sdr/grgsm_scanner.py +++ b/engines/sdr/grgsm_scanner.py @@ -551,7 +551,7 @@ def getKey(self): def attr2dic(self): cell = {} cid2 = str(self.cid) + '_' + str(self.arfcn) - cell[self.cid] = {'PLMN' : str(self.mcc)+str(self.mnc), + cell[cid2] = {'PLMN' : str(self.mcc)+str(self.mnc), 'arfcn' : int(self.arfcn), 'type' : '2G', 'cid' : str(self.cid)} diff --git a/utils/logprocess.py b/utils/logprocess.py index 524eaa2..dad4690 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -20,10 +20,19 @@ from threading import Thread import argparse import json - +import signal kb = mKB() +def signal_handler(sig, frame): + global th, state + print('Keyboard interrupt received, stopping cellmapping and saving results...') + state = False + cells = kb.data['SM_cells'] + saveCells(cells) + sys.exit(0) + +signal.signal(signal.SIGINT, signal_handler) def statesmv(func, msg=None, wait=10, arg=None): if msg is not None: @@ -111,7 +120,6 @@ def startSrsLTENPSS(): cells = kb.data['SM_cells'] saveCells(cells) -import signal def startSrsLTEPSS(): #global th, state th = Thread(target=startSrsLTEPSSProcess) @@ -128,16 +136,6 @@ def startSrsLTEPSS(): cells = kb.data['SM_cells'] saveCells(cells) -def signal_handler(sig, frame): - global th, state - print('Keyboard interrupt received, stopping srsLTE PSS...') - state = False - cells = kb.data['SM_cells'] - saveCells(cells) - sys.exit(0) - -signal.signal(signal.SIGINT, signal_handler) - def startSrsLTEPSSCollect(): srs = srslte_pss() th = Thread(target=srs.parseFifo) @@ -161,6 +159,7 @@ def printInfo(string): def saveCells(obj): import time + repr(obj) jscells = json.dumps(obj, indent=4, sort_keys=True) name = "cells_%d.json" % float(time.time()) f = open("%s" % name, 'w+') @@ -250,9 +249,10 @@ def processGRGSM(bands): "=> Switching to %s band" % band, arg=band) except (KeyboardInterrupt, SystemExit): state = False - kb = mKB() - cells = kb.data['SM_cells'] - saveCells(cells) + break + kb = mKB() + cells = kb.data['SM_cells'] + saveCells(cells) def processManualMCCMN(string): From 2302bd0963197eac1afe6b4e4f1a31a58f9c8d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 15:28:22 +0100 Subject: [PATCH 65/88] Fixing issues with Samsung mobile phones on TTY --- modmobmap.py | 9 +++++++++ utils/logprocess.py | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/modmobmap.py b/modmobmap.py index 05d8088..37dfb99 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -13,6 +13,15 @@ SRSLTE_PATH = "thirdparty/srsLTE/" # thirdparty project + +FILES_TO_REMOVE = ["celllog.fifo"] + +def cleaning_file(): + import os + for f in FILES_TO_REMOVE: + os.remove(f) + + def phone_actions(args): cops = None if args.networks is not None: diff --git a/utils/logprocess.py b/utils/logprocess.py index dad4690..20185d2 100644 --- a/utils/logprocess.py +++ b/utils/logprocess.py @@ -159,7 +159,6 @@ def printInfo(string): def saveCells(obj): import time - repr(obj) jscells = json.dumps(obj, indent=4, sort_keys=True) name = "cells_%d.json" % float(time.time()) f = open("%s" % name, 'w+') @@ -187,8 +186,9 @@ def processOperatorAT(operators): "=> Switching back to auto-mode", arg=2) except (KeyboardInterrupt, SystemExit): state = False - cells = kb.data['SM_cells'] - saveCells(cells) + break + cells = kb.data['SM_cells'] + saveCells(cells) def processOperatorADB(operators): @@ -210,9 +210,9 @@ def processOperatorADB(operators): "=> Switching back to auto-mode", arg=2) except (KeyboardInterrupt, SystemExit): state = False - kb = mKB() - cells = kb.data['SM_cells'] - saveCells(cells) + break + cells = kb.data['SM_cells'] + saveCells(cells) process = sm.grablogcat() From bf3bef50e9264881d1206f7e7a9a81d5f0855431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 16:36:35 +0100 Subject: [PATCH 66/88] Updating GNU Radio installation case in the install script --- install_all-Ubuntu_22.04.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index b375d83..0d5faf6 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -8,8 +8,27 @@ sudo python3 -m pip install --upgrade pip sudo python3 -m pip install -r requirements.txt echo "[+] Installing GNU Radio dependencies" -sudo add-apt-repository ppa:gnuradio/gnuradio-releases -sudo apt-get update +installedgnuradio_version=$(dpkg -s gnuradio|egrep -i "Version: 3.10(.*)") + +install_latest_gnuradio() { + sudo add-apt-repository ppa:gnuradio/gnuradio-releases + sudo apt-get update + gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*) 500"|sed 's/ //'|sed 's/ 500//') + sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation +} + +if [ -z "$installedgnuradio_version" ] +then + while true; do + read -p "GNU Radio 3.10 doesn't appear to be installed, do you wish to install this program? " yn + case $yn in + [Yy]* ) install_latest_gnuradio; break;; + [Nn]* ) exit;; + * ) echo "Please answer [Y]yes or [N]no.";; + esac + done +fi + gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*) 500"|sed 's/ //'|sed 's/ 500//') sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation From 658eaeb9de2071e62f6a8031e1a00f02a40e3d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 17:24:01 +0100 Subject: [PATCH 67/88] Fixing Android SDK default path --- modmobmap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmobmap.py b/modmobmap.py index 37dfb99..91dcb9f 100755 --- a/modmobmap.py +++ b/modmobmap.py @@ -65,7 +65,7 @@ def phone_actions(args): help='Networks in MCCMNC format splitted with commas') parser.add_argument('-o', '--cached_operator', dest='operators', required=False, default=False, action='store_true', help='Use operator in cache to speed up the passive scan.') - parser.add_argument('-s', '--sdk', dest='androidsdk', required=False, default='/opt/Android', + parser.add_argument('-s', '--sdk', dest='androidsdk', required=False, default='thirdparty/platform-tools', help='Android SDK path') parser.add_argument('-a', '--at', dest='atmode', required=False, default=None, help='AT access mode. If host put something like "/dev/ttyUSBxx. By default it uses ADB."') From 192ded7cd39442bde9f5d561c34ceccdd00e05f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 18:10:35 +0100 Subject: [PATCH 68/88] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11c6b7e..2ab88da 100644 --- a/README.md +++ b/README.md @@ -443,6 +443,8 @@ The process could be stopped at any time when killing the process with a keyboar ^C[+] Cells save as cells_1528738901.json ``` -## Docker image +## Docker image (in case of apocalypse) -To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap-beta +To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap + +You can now use the `latest_with_e200` which is compatible with the ANTSDR E200. From 19bf3c8cbb37719a1003149851bc88334fc1f4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 18:11:16 +0100 Subject: [PATCH 69/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ab88da..cf1e57b 100644 --- a/README.md +++ b/README.md @@ -443,7 +443,7 @@ The process could be stopped at any time when killing the process with a keyboar ^C[+] Cells save as cells_1528738901.json ``` -## Docker image (in case of apocalypse) +## Docker image (in case of Apocalypse) To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap From c23bcd9d7abecb0fed198f1d609e4cf5a5a8c647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 18:17:29 +0100 Subject: [PATCH 70/88] Adding ANTSDR E200 installation option --- install_all-Ubuntu_22.04.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 0d5faf6..1242fb1 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -17,6 +17,23 @@ install_latest_gnuradio() { sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation } +install_antsdr_uhd() { + sudo apt-get install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool \ + g++ git inetutils-tools libboost-all-dev libncurses5 libncurses5-dev libusb-1.0-0 libusb-1.0-0-dev \ + libusb-dev python3-dev python3-mako python3-numpy python3-requests python3-scipy python3-setuptools \ + python3-ruamel.yaml + git clone https://github.com/MicroPhase/antsdr_uhd.git + cd antsdr_uhd + cd host/ + mkdir build + cd build + cmake ../ + make -j$(nproc) + sudo make install + sudo ldconifg + cd ../../ +} + if [ -z "$installedgnuradio_version" ] then while true; do @@ -40,6 +57,15 @@ python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1 libsndfile-dev libtalloc-dev libpcsclite-dev wget unzip python3-pip libbladerf-dev \ libuhd-dev uhd-host librtlsdr-dev +while true; do + read -p "Do you which to install the UHD version of ANTSDR (YES), or the original one [NO]? " yn + case $yn in + [Yy]* ) install_antsdr_uhd; break;; + [Nn]* ) sudo apt install libuhd-dev uhd-host librtlsdr-dev; break;; + * ) echo "Please answer [Y]yes or [N]no.";; + esac +done + sudo pip3 install pyserial echo "[+] Installing osmocore" @@ -94,7 +120,7 @@ sudo apt-get install bladerf soapysdr-module-bladerf #hack rf support: sudo apt-get install hackrf soapysdr-module-hackrf #usrp support: -sudo apt-get install uhd-host uhd-soapysdr soapysdr-module-uhd +sudo apt-get install uhd-soapysdr soapysdr-module-uhd #miri SDR support: sudo apt-get install miri-sdr soapysdr-module-mirisdr #rf space support: From 42d2c0c42b400522e5eda7f38ce719df51613277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 18:31:14 +0100 Subject: [PATCH 71/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf1e57b..8817278 100644 --- a/README.md +++ b/README.md @@ -447,4 +447,4 @@ The process could be stopped at any time when killing the process with a keyboar To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap -You can now use the `latest_with_e200` which is compatible with the ANTSDR E200. +You can now use the `latest_with_e200` tag which is compatible with the ANTSDR E200. From 49bf29c980852b76cf9dad053e3c045f3135bb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Sun, 19 Feb 2023 18:43:45 +0100 Subject: [PATCH 72/88] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8817278..afcca94 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Modmobmap is also able to scan LTE cells by wrapping srsLTE tools. The engine su * BladeRF * HackRF * RFSpace +* ANTSDR E200 (with the right UHD installation) * and so on. Requirements From 5a45fb123147e05557b56353c4c52eec0dd72e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D0=BC=D0=B0=D0=BD=20=D0=A1=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2?= Date: Fri, 24 Mar 2023 01:47:40 +0300 Subject: [PATCH 73/88] Added downlink only 38 and 40 TDD bands --- utils/eu_arfcn_calc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/eu_arfcn_calc.py b/utils/eu_arfcn_calc.py index 440bb95..9cdd8de 100755 --- a/utils/eu_arfcn_calc.py +++ b/utils/eu_arfcn_calc.py @@ -214,6 +214,14 @@ 'NUL_Offset' : 27760, 'UP_range' : (27760,27809), }, + 38 : { 'FDL_Low' : 2570, + 'NDL_Offset' : 37750, + 'DL_range' : (37750,38249), + }, + 40 : { 'FDL_Low' : 2300, + 'NDL_Offset' : 38650, + 'DL_range' : (38650,39649), + }, 65 : { 'FDL_Low' : 2110, 'NDL_Offset' : 65536, 'DL_range' : (65536,66435), From fe807d637d984c129da3b0ee8419dc8b3ef4b892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D0=BC=D0=B0=D0=BD=20=D0=A1=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2?= Date: Fri, 24 Mar 2023 02:19:51 +0300 Subject: [PATCH 74/88] Added calculate freq using LTE TDD bands in earfcn2freq function --- utils/eu_arfcn_calc.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/utils/eu_arfcn_calc.py b/utils/eu_arfcn_calc.py index 440bb95..36f65a9 100755 --- a/utils/eu_arfcn_calc.py +++ b/utils/eu_arfcn_calc.py @@ -455,10 +455,15 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None): out: tuple (float downlink_freq, float uplink_freq) ''' NDL_Offset = table_earfcn[band]['NDL_Offset'] - NUL_Offset = table_earfcn[band]['NUL_Offset'] - duplex_spacing = abs(table_earfcn[band]['FDL_Low']-table_earfcn[band]['FUL_Low']) + if table_earfcn[band].__contains__('NUL_Offset'): + NUL_Offset = table_earfcn[band]['NUL_Offset'] + if table_earfcn[band].__contains__('FUL_Low'): + ful_low = table_earfcn[band]['FUL_Low'] + else: + ful_low = 0 + duplex_spacing = abs(table_earfcn[band]['FDL_Low']-ful_low) FDL_Low = table_earfcn[band]['FDL_Low'] - FUL_Low = table_earfcn[band]['FUL_Low'] + FUL_Low = ful_low downlink_freq = uplink_freq = None if dl_earfcn is not None: downlink_freq = FDL_Low + 0.1 * (dl_earfcn-NDL_Offset) @@ -468,6 +473,10 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None): uplink_freq = downlink_freq - duplex_spacing elif downlink_freq is None and uplink_freq is not None: downlink_freq = downlink_freq + duplex_spacing + + if FUL_Low == 0: + uplink_freq = 0 + return (downlink_freq, uplink_freq) if __name__ == "__main__": From 7d97382bff2fc4a9352d8e9f1d8b5a949810d69e Mon Sep 17 00:00:00 2001 From: Mohammad Aghazahiri <33659303+mohmmadd@users.noreply.github.com> Date: Sat, 25 Nov 2023 09:24:56 +0330 Subject: [PATCH 75/88] Update eu_arfcn_calc.py --- utils/eu_arfcn_calc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/eu_arfcn_calc.py b/utils/eu_arfcn_calc.py index 9cdd8de..a2ac456 100755 --- a/utils/eu_arfcn_calc.py +++ b/utils/eu_arfcn_calc.py @@ -23,7 +23,7 @@ 'DL_range' : (0,599), 'FUL_Low' : 1920, 'NUL_Offset' : 18000, - 'UP_range' : (1800,18599), + 'UP_range' : (18000,18599), }, 2 : { 'FDL_Low' : 1930, 'NDL_Offset' : 600, From 6ef804cc24ae5570cf440c19a01036d84420f75b Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Wed, 26 Nov 2025 15:39:46 +0100 Subject: [PATCH 76/88] Updating thirdparty dependency --- .gitmodules | 7 ++++--- thirdparty/srsLTE | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 64ada83..5053454 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ -[submodule "thirdparty/srsLTE"] - path = thirdparty/srsLTE - url = https://github.com/PentHertz/srsLTE.git +[submodule "thirdparty/srsRAN"] + path = thirdparty/srsLTE + url = https://github.com/FlUxIuS/srsRAN_4G.git + branch = modmobmap diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 8479ae4..1fab3df 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 8479ae47917b7b646ddeb3a9a7f662eea450954d +Subproject commit 1fab3df863f66fdb6c3b34f1b39e745dbcb12d5e From f94966d86c7e64d4456ea0add1a6d63801c7a4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:04:49 +0100 Subject: [PATCH 77/88] Update install_all-Ubuntu_22.04.sh --- install_all-Ubuntu_22.04.sh | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index 1242fb1..f920010 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -4,19 +4,9 @@ echo "[+] Retrieving submodules" git submodule update --init --recursive echo "[+] Installing Python3 requirements" -sudo python3 -m pip install --upgrade pip -sudo python3 -m pip install -r requirements.txt +sudo apt install -y python3-pip echo "[+] Installing GNU Radio dependencies" -installedgnuradio_version=$(dpkg -s gnuradio|egrep -i "Version: 3.10(.*)") - -install_latest_gnuradio() { - sudo add-apt-repository ppa:gnuradio/gnuradio-releases - sudo apt-get update - gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*) 500"|sed 's/ //'|sed 's/ 500//') - sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation -} - install_antsdr_uhd() { sudo apt-get install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool \ g++ git inetutils-tools libboost-all-dev libncurses5 libncurses5-dev libusb-1.0-0 libusb-1.0-0-dev \ @@ -46,10 +36,9 @@ then done fi -gnuradioversion=$(sudo apt policy gnuradio|egrep -i "3.10(.*) 500"|sed 's/ //'|sed 's/ 500//') -sudo apt-get install gnuradio=$gnuradioversion # forcing GNU Radio 3.10 installation +sudo apt-get install gnuradio gnuradio-dev -y -sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ +sudo apt install -y git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \ libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \ liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \ @@ -66,11 +55,10 @@ while true; do esac done -sudo pip3 install pyserial +sudo pip3 install pyserial --break-system-packages echo "[+] Installing osmocore" -sudo apt-get install build-essential libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev -git clone https://gitea.osmocom.org/osmocom/libosmocore.git +sudo apt -y install build-essential libosmocore libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev cd libosmocore/ autoreconf -i ./configure @@ -84,7 +72,7 @@ mkdir thirdparty cd thirdparty REMPATH=`pwd` #sudo apt install gr-osmosdr -git clone https://github.com/osmocom/gr-osmosdr +git clone https://github.com/PentHertz/gr-osmosdr.git cd gr-osmosdr mkdir build cd build @@ -93,7 +81,7 @@ make -j$(nproc) sudo make install cd $REMPATH echo "[+] Downloading gr-gsm for Python3 and GNU Radio 3.10" -git clone https://github.com/bkerler/gr-gsm +git clone https://github.com/FlUxIuS/gr-gsm.git echo "[+] Building and installing gr-gsm for GNU Radio 3.10" cd gr-gsm mkdir build @@ -103,7 +91,7 @@ make -j$(nproc) sudo make install cd ../../ echo "[+] Installing SDK tools" -sudo apt install openjdk-17-jdk +sudo apt install -y openjdk-25-jdk wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip unzip platform-tools-latest-linux.zip sudo mkdir -p /opt/Android From bcead479cdd37df4353d4ba4cd84d424569f604e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:11:37 +0100 Subject: [PATCH 78/88] Update install_all-Ubuntu_22.04.sh --- install_all-Ubuntu_22.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index f920010..db0eec7 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -58,7 +58,7 @@ done sudo pip3 install pyserial --break-system-packages echo "[+] Installing osmocore" -sudo apt -y install build-essential libosmocore libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev +sudo apt -y install build-essential libosmocore libosmocore-dev libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev cd libosmocore/ autoreconf -i ./configure From 5fabcf07b8932ef55f1caa9ae98a788b5a01f3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:21:48 +0100 Subject: [PATCH 79/88] Update install_all-Ubuntu_22.04.sh --- install_all-Ubuntu_22.04.sh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_22.04.sh index db0eec7..5ed4a67 100755 --- a/install_all-Ubuntu_22.04.sh +++ b/install_all-Ubuntu_22.04.sh @@ -24,18 +24,6 @@ install_antsdr_uhd() { cd ../../ } -if [ -z "$installedgnuradio_version" ] -then - while true; do - read -p "GNU Radio 3.10 doesn't appear to be installed, do you wish to install this program? " yn - case $yn in - [Yy]* ) install_latest_gnuradio; break;; - [Nn]* ) exit;; - * ) echo "Please answer [Y]yes or [N]no.";; - esac - done -fi - sudo apt-get install gnuradio gnuradio-dev -y sudo apt install -y git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \ @@ -59,16 +47,6 @@ sudo pip3 install pyserial --break-system-packages echo "[+] Installing osmocore" sudo apt -y install build-essential libosmocore libosmocore-dev libtool libtalloc-dev libsctp-dev shtool autoconf automake git-core pkg-config make gcc gnutls-dev libusb-1.0-0-dev libmnl-dev -cd libosmocore/ -autoreconf -i -./configure -make -sudo make install -sudo ldconfig -i -cd .. - -echo "[+] Installing gr-osmosdr from source" -mkdir thirdparty cd thirdparty REMPATH=`pwd` #sudo apt install gr-osmosdr @@ -117,6 +95,7 @@ sudo apt-get install soapysdr-module-rfspace sudo apt-get install airspy soapysdr-module-airspy echo "[+] Installaing srsLTE for Modmobmap" cd $REMPATH +ls cd srsLTE mkdir build cd build From 60297ab200cacd38282eeb9f5833f7c3d119ff99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:26:30 +0100 Subject: [PATCH 80/88] Update ServiceMode.py raw bytes parsing fix --- engines/android/samsung/ServiceMode.py | 70 +++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/engines/android/samsung/ServiceMode.py b/engines/android/samsung/ServiceMode.py index 64ef8e0..ed255a4 100755 --- a/engines/android/samsung/ServiceMode.py +++ b/engines/android/samsung/ServiceMode.py @@ -35,20 +35,20 @@ def parse4Gcell(self, string): for s in string.split(b'\r\n'): if b'LTE' in s: if b'Band' in s: - band = re.match(b'^.*Band?:?\s?(\d+)', s).group(1) + band = re.match(rb'^.*Band?:?\s?(\d+)', s).group(1) elif b'BAND' in s and b'BW' in s: - band, bandwidth = re.match(b'^.*BAND:?\s?(\d+)\sBW:?\s?([\d+\w]+)?\s?\_$', s).groups() + band, bandwidth = re.match(rb'^.*BAND:?\s?(\d+)\sBW:?\s?([\d+\w]+)?\s?\_$', s).groups() if b'MCC-MNC' in s: if b'TAC' in s: - plmn, tac = re.match(b'^.*MCC-MNC?\s?:?\s?([\d\-]+)\,?\s?TAC:?\s?(\d+)?\s?\_$', s).groups() + plmn, tac = re.match(rb'^.*MCC-MNC?\s?:?\s?([\d\-]+)\,?\s?TAC:?\s?(\d+)?\s?\_$', s).groups() elif b'MeG': - plmn = re.match(b'^.*MCC-MNC?\s?:?\s?([\d\-\s]+)', s).group(1) + plmn = re.match(rb'^.*MCC-MNC?\s?:?\s?([\d\-\s]+)', s).group(1) if b'Earfcn_dl:' in s: - earfcn, pci = re.match(b'^.*Earfcn_dl:?\s?(\d+),?\s?PCI:?\s?(\d+)?\s?\_', s).groups() + earfcn, pci = re.match(rb'^.*Earfcn_dl:?\s?(\d+),?\s?PCI:?\s?(\d+)?\s?\_', s).groups() if b'LTE DL BW' in s: - bandwidth = re.match(b'^.*BW?\s?:?\s?([\d\w]+)', s).group(1) + bandwidth = re.match(rb'^.*BW?\s?:?\s?([\d\w]+)', s).group(1) if tac is None and b'TAC' in s: - tac = re.match(b'^.*TAC?\s?:?\s?([\d]+)', s).group(1) + tac = re.match(rb'^.*TAC?\s?:?\s?([\d]+)', s).group(1) if None not in [plmn, tac, earfcn, band, bandwidth, pci]: tac = tac.decode('utf-8') plmn = plmn.decode('utf-8').replace(' ','') @@ -83,16 +83,16 @@ def parse4Gcell_sgs20like(self, string): cell = {} for s in string.split(b'\n'): if b'Band' in s and b'BW' in s: - band, bandwidth = re.match(b'^.*Band:?\s?(\d+)\sBW:?\s?([\d+\w]+)?\s?\_$', s).groups() - bandwidth = bandwidth.replace('MHz', '') - if 'Registered' in s: - plmn = re.match(b'^.*PLMN?\s?:?\s?([\d\-\s]+)', s).group(1).replace(' ', '') + band, bandwidth = re.match(rb'^.*Band:?\s?(\d+)\sBW:?\s?([\d+\w]+)?\s?\_$', s).groups() + bandwidth = bandwidth.replace(b'MHz', b'') + if b'Registered' in s: + plmn = re.match(rb'^.*PLMN?\s?:?\s?([\d\-\s]+)', s).group(1).replace(b' ', b'') if b'DL & UL Frequency' in s: - earfcn = re.match(b'^.*Frequency:?\s?([\d+\w]+)', s).group(1) + earfcn = re.match(rb'^.*Frequency:?\s?([\d+\w]+)', s).group(1) if tac is None and b'TAC' in s: - tac = re.match(b'^.*TAC?\s?:?\s?([\d]+)', s).group(1) + tac = re.match(rb'^.*TAC?\s?:?\s?([\d]+)', s).group(1) if b'CellID' in s and b'PCI' in s: - cid, pci = re.match(b'^.*ServingCellID:?\s?([\w\d]+)PCI:?\s?([\w\d]+)?\s?\_$', s).groups() + cid, pci = re.match(rb'^.*ServingCellID:?\s?([\w\d]+)PCI:?\s?([\w\d]+)?\s?\_$', s).groups() if None not in [plmn, tac, earfcn, band, bandwidth]: tac = tac.decode('utf-8') plmn = plmn.decode('utf-8').replace(' ','') @@ -121,12 +121,12 @@ def parse3Gcell_sgs20like(self, string): cell = {} for s in string.split(b'\n'): if b'MCC' in s: - mcc, mnc = re.match(b'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() + mcc, mnc = re.match(rb'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() plmn = mcc+mnc if b'CellId' in s: - cid = re.match(b'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) + cid = re.match(rb'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) if b'uarfcn:' in s: - rx = re.match(b'^.*uarfcn:?\s?(\d+)', s).group(1) + rx = re.match(rb'^.*uarfcn:?\s?(\d+)', s).group(1) if None not in [rx, cid, plmn]: cid = cid.decode('utf-8').replace('_','') plmn = plmn.decode("utf-8") @@ -154,15 +154,15 @@ def parse3Gcell_sgs3like(self, string): cell = {} for s in string.split(b'\r\n'): if b'Band' in s: - band = re.match(b'^.*Band?:?\s?(\d+)', s).group(1) + band = re.match(rb'^.*Band?:?\s?(\d+)', s).group(1) if b'Reg PLMN' in s: - plmn = re.match(b'^.*Reg PLMN?\s?([\d\-]+)', s).group(1) + plmn = re.match(rb'^.*Reg PLMN?\s?([\d\-]+)', s).group(1) if b'CELL_ID' in s: - cid = re.match(b'^.*CELL_ID:?\s?(\S+)', s).group(1) + cid = re.match(rb'^.*CELL_ID:?\s?(\S+)', s).group(1) if b'CH DL:' in s: - tx = re.match(b'^.*CH DL:?\s?(\d+)', s).group(1) + tx = re.match(rb'^.*CH DL:?\s?(\d+)', s).group(1) if b', UL:' in s: - rx = re.match(b'^.*\,\sUL:?\s?(\d+)', s).group(1) + rx = re.match(rb'^.*\,\sUL:?\s?(\d+)', s).group(1) if None not in [tx, rx, cid, plmn, band]: cid = cid.decode('utf-8').replace('_','') plmn = plmn.decode("utf-8").replace(' ', '') @@ -190,20 +190,20 @@ def parse3Gcell(self, string): cell = {} for s in string.split(b'\r\n'): if b'Band' in s: - band = re.match(b'^.*Band?:?\s?(\d+)', s).group(1) + band = re.match(rb'^.*Band?:?\s?(\d+)', s).group(1) if b'PLMN:' in s: - plmn = re.match(b'^.*PLMN:?\s?([\d\-]+)?\s?\_$', s).group(1) + plmn = re.match(rb'^.*PLMN:?\s?([\d\-]+)?\s?\_$', s).group(1) elif b'MCC-MNC :' in s: try: - plmn = re.match(b'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) + plmn = re.match(rb'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) except: plmn = None if b'CID:' in s: - cid = re.match(b'^.*CID:?\s?(\S+)?\s?_$', s).group(1) + cid = re.match(rb'^.*CID:?\s?(\S+)?\s?_$', s).group(1) if b' TX:' in s: - tx = re.match(b'^.*TX:?\s?(\d+)', s).group(1) + tx = re.match(rb'^.*TX:?\s?(\d+)', s).group(1) if b' RX:' in s: - rx = re.match(b'^.*RX:?\s?(\d+)', s).group(1) + rx = re.match(rb'^.*RX:?\s?(\d+)', s).group(1) if None not in [tx, rx, cid, plmn, band]: cid = cid.decode('utf-8') plmn = plmn.decode("utf-8").replace(' ', '') @@ -230,12 +230,12 @@ def parse2Gcell_sgs20like(self, string): cell = {} for s in string.split(b'\n'): if b'MCC' in s: - mcc, mnc = re.match(b'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() + mcc, mnc = re.match(rb'^.*MCC?\s?:?\s?(\d+)?\s?MNC?\s?:?\s?(\d+)?\s?\_$', s).groups() plmn = mcc+mnc if b'CellId' in s: - cid = re.match(b'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) + cid = re.match(rb'^.*CellId?\s?:?\s?([\w\d]+)', s).group(1) if b'arfcn' in s: - arfcn = re.match(b'^.*arfcn?\s?:?\s?(\d+)', s).group(1) + arfcn = re.match(rb'^.*arfcn?\s?:?\s?(\d+)', s).group(1) if None not in [arfcn, cid, plmn]: cid = cid.decode('utf-8') plmn = plmn.decode("utf-8").replace(' ', '') @@ -261,13 +261,13 @@ def parse2Gcell(self, string): cell = {} for s in string.split(b'\r\n'): if b'PLMN:' in s: - plmn = re.match(b'^.*PLMN:?\s?([\d\-]+)?\s?\_$', s).group(1) + plmn = re.match(rb'^.*PLMN:?\s?([\d\-]+)?\s?\_$', s).group(1) elif b'MCC-MNC :' in s: - plmn = re.match(b'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) + plmn = re.match(rb'^.*MCC-MNC\s:?\s?([\d\-\s]+)?\s?\_$', s).group(1) if b'CID:' in s: - cid = re.match(b'^.*CID:?\s?(\S+)?\s?_$', s).group(1) + cid = re.match(rb'^.*CID:?\s?(\S+)?\s?_$', s).group(1) if b' Tra:' in s: - arfcn = re.match(b'^.*Tra:?\s?(\d+)', s).group(1) + arfcn = re.match(rb'^.*Tra:?\s?(\d+)', s).group(1) if None not in [arfcn, cid, plmn]: cid = cid.decode('utf-8') plmn = plmn.decode("utf-8").replace(' ', '') From 79e86bfd066a2c068b6b109e10b46d5eead6cd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:31:22 +0100 Subject: [PATCH 81/88] Update ADBshell.py --- engines/android/generic/ADBshell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/android/generic/ADBshell.py b/engines/android/generic/ADBshell.py index 1f1e4e4..4cd5362 100644 --- a/engines/android/generic/ADBshell.py +++ b/engines/android/generic/ADBshell.py @@ -90,7 +90,7 @@ def getDevfile(self): process = self.run_adbcmdshell('getprop rild.libargs') devfile = process.stdout.readline().split(b'/dev/') if len(devfile) >= 2: - m = re.match(b'([\d\w]+)', devfile[1]) + m = re.match(rb'([\d\w]+)', devfile[1]) if m is not None: devfile = b'/dev/' + devfile[1].replace(b'\r\n', b'') else: From 8816a04e4c2f9b3569523aec0598f60e00d5ea3f Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Wed, 26 Nov 2025 16:32:57 +0100 Subject: [PATCH 82/88] Moving script install name --- install_all-Ubuntu_22.04.sh => install_all-Ubuntu_24.04.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename install_all-Ubuntu_22.04.sh => install_all-Ubuntu_24.04.sh (100%) diff --git a/install_all-Ubuntu_22.04.sh b/install_all-Ubuntu_24.04.sh similarity index 100% rename from install_all-Ubuntu_22.04.sh rename to install_all-Ubuntu_24.04.sh From d152e9afa8c5bd6d5d798e75cddfeb070c850c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 16:33:52 +0100 Subject: [PATCH 83/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afcca94..a5b941b 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Here are the following requirements: Ubuntu installation --------------------- -A `install_all-Ubuntu_22.04.sh` script installing all dependencies for all engines is available in the root directory. +A `install_all-Ubuntu_24.04.sh` script installing all dependencies for all engines is available in the root directory. For other distributions, please adapt this script base on listed dependencies. From f81473b0b68f695838b7b22354bf984e35c061df Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Wed, 26 Nov 2025 16:41:06 +0100 Subject: [PATCH 84/88] Fixing new clone --- .gitmodules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5053454..ae1ebf8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,5 @@ [submodule "thirdparty/srsRAN"] path = thirdparty/srsLTE url = https://github.com/FlUxIuS/srsRAN_4G.git - branch = modmobmap + branch = modmobmap + update = merge From 44238d4bec4513f46f06793eeeb4be88e381c1a0 Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Wed, 26 Nov 2025 16:45:03 +0100 Subject: [PATCH 85/88] Update srsRAN submodule to latest modmobmap branch --- thirdparty/srsLTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/srsLTE b/thirdparty/srsLTE index 1fab3df..b5b7110 160000 --- a/thirdparty/srsLTE +++ b/thirdparty/srsLTE @@ -1 +1 @@ -Subproject commit 1fab3df863f66fdb6c3b34f1b39e745dbcb12d5e +Subproject commit b5b7110d42d0be32398fe6ae9e627a69863887b4 From 1d628f8589e768cf28983af58981b78798629960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 17:32:32 +0100 Subject: [PATCH 86/88] Update README.md --- README.md | 720 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 369 insertions(+), 351 deletions(-) diff --git a/README.md b/README.md index a5b941b..a989be2 100644 --- a/README.md +++ b/README.md @@ -1,451 +1,469 @@ -Modmobmap -========== +# 📡 Modmobmap -Modmobmap is a tool aimed to retrieve information on cellular networks. -As shown in the first [presentation made at BeeRump 2018](https://www.rump.beer/2018/slides/modmobmap.pdf), this tool is able to retrieve information of 2G, 3G, 4G, and more cellular network types with minimum requirement: only phone with ServiceMode. +
-For the moment, the tool has only been tested and developed for the following devices: -- Samsung Galaxy S3 via [xgoldmon (Modmobmap's edition)](https://github.com/FlUxIuS/xgoldmon); -- Samsung Galaxy S4; -- Samsung Galaxy S5; -- Samsung Galaxy Note 2 with LTE; -- Samsung Galaxy S20 +**Mobile Network Intelligence & Mapping Tool** -Moreover, as it's compatible for XGold via Modmobmap's forked of *xgoldmon*, this tool should also be able to work with devices supported by *xgoldmon* as well: -- Samsung Galaxy S4 GT-I9500 (this is the version without LTE!) -- Samsung Galaxy Nexus GT-I9250 (has to be rooted!) -- Samsung Galaxy S2 GT-I9100 -- Samsung Galaxy Note 2 GT-N7100 +*Retrieve comprehensive information on 2G/3G/4G/5G cellular networks with minimal equipment* -Note that all devices should be rooted. In any other case, you will have to use the DFR technique by hand! +[![Python](https://img.shields.io/badge/Python-3.x-blue.svg)](https://www.python.org/) +[![License](https://img.shields.io/badge/License-BEER--WARE-yellow.svg)](LICENSE) +[![Docker](https://img.shields.io/badge/Docker-Available-2496ED?logo=docker)](https://hub.docker.com/r/penthertz/modmobmap) +[![Platform](https://img.shields.io/badge/Platform-Linux-lightgrey.svg)](https://www.linux.org/) -Also: Patches, or engines, for other devices are very much welcomed! ;) +[Features](#-key-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-usage-examples) • [Docker](#-docker-deployment) -But this is not finished yet, Modmobmap include a GRGSM scanner to scan GSM cells with SDR. Compatible SDR devices are the same as those compatible with `gr-osmosdr` as follows: +
-* FunCube Dongle through libgnuradio-fcd -* FUNcube Dongle Pro+ through gr-fcdproplus -* sysmocom OsmoSDR Devices through libosmosdr -* Nuand LLC bladeRF through libbladeRF library -* Great Scott Gadgets HackRF through libhackrf -* Ettus USRP Devices through Ettus UHD library -* Fairwaves UmTRX through Fairwaves' fork of Ettus' UHD library -* RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option) -* RTL2832U based DVB-T dongles through librtlsdr -* RTL-TCP spectrum server (see librtlsdr project) -* MSi2500 based DVB-T dongles through libmirisdr -* SDRplay RSP through SDRplay API library -* AirSpy R820t dongles through libairspy +--- -Modmobmap is also able to scan LTE cells by wrapping srsLTE tools. The engine supports several SDR devices: +## 🎯 Overview -* USRP -* BladeRF -* HackRF -* RFSpace -* ANTSDR E200 (with the right UHD installation) -* and so on. +Modmobmap is a comprehensive cellular network reconnaissance tool designed for security researchers, RF engineers, and penetration testers. Originally presented at [BeeRump 2018](https://www.rump.beer/2018/slides/modmobmap.pdf), it combines multiple techniques to map and analyze mobile networks using both commercial smartphones and Software-Defined Radio (SDR) devices. -Requirements -------------- +### 🔥 Key Features -Here are the following requirements: -- Python 3; -- Last Android SDK to run ADB: https://developer.android.com/studio/#downloads; -- A compatible mobile phone; -- GNU Radio 3.10 with gr-gsm to scan GSM stations with Software-Defined Radio -- A valid/invalid SIM card (just in case to provide an IMSI number). + + + + + + + + + +
-Ubuntu installation ---------------------- +**📱 Smartphone-Based Scanning** +- Samsung Galaxy devices (S3-S20) +- ServiceMode interface support +- XGold modem compatibility +- Real-time cell information -A `install_all-Ubuntu_24.04.sh` script installing all dependencies for all engines is available in the root directory. + -For other distributions, please adapt this script base on listed dependencies. +**📻 SDR Integration** +- GNU Radio GSM scanning +- srsRAN LTE/NB-IoT support +- Multi-band analysis +- Passive reconnaissance -How to use ----------- +
-The tool is provided with quick help that shows you the required argument as follows: +**🌐 Network Coverage** +- 2G/GSM networks +- 3G/UMTS systems +- 4G/LTE cells +- NB-IoT detection + + +**💾 Data Management** +- JSON export format +- Real-time logging +- Cell database +- Operator caching + +
+ +--- + +## 🛠️ Supported Hardware + +### 📱 Mobile Devices (Rooted Required) + +
+✅ Tested & Confirmed + +- **Samsung Galaxy S3** (via [xgoldmon](https://github.com/FlUxIuS/xgoldmon)) +- **Samsung Galaxy S4** (GT-I9500) +- **Samsung Galaxy S5** +- **Samsung Galaxy Note 2** (LTE version) +- **Samsung Galaxy S20** +- **Samsung Galaxy Nexus** (GT-I9250, rooted) +- **Samsung Galaxy S2** (GT-I9100) + +> 💡 **Note:** All devices must be rooted. For non-rooted devices, manual DFR technique required. + +
+ +### 📻 SDR Devices (via gr-osmosdr & UHD) + +
+🎛️ Compatible SDR Hardware + +| Device | Driver | GSM | LTE | Notes | +|--------|--------|-----|-----|-------| +| **RTL-SDR** | rtlsdr/soapy | ✅ | ✅ | Budget option | +| **HackRF One** | hackrf | ✅ | ✅ | Wide frequency range | +| **BladeRF** | bladerf | ✅ | ✅ | High performance | +| **USRP (all models)** | uhd | ✅ | ✅ | Professional grade | +| **ANTSDR E200** | uhd | ✅ | ✅ | Requires proper UHD setup | +| **AirSpy** | airspy | ✅ | ❌ | GSM only | +| **SDRplay RSP** | sdrplay | ✅ | ❌ | GSM only | +| **FunCube Dongle** | fcd | ✅ | ❌ | GSM only | + +
+ +--- + +## 🚀 Installation + +### Prerequisites + +```bash +# Core dependencies +- Python 3.x +- Android SDK (for ADB) +- GNU Radio 3.10+ with gr-gsm +- Valid/invalid SIM card (for IMSI) ``` -python modmobmap.py -h -usage: modmobmap.py [-h] [-m MODULE] [-n NETWORKS] [-o] [-s ANDROIDSDK] - [-a ATMODE] [-f FILE]Before running the engine, make sure all dependencies are installed. You can refer to the installation script - -Mobile network mapping tool with cheap equipments - -optional arguments: - -h, --help show this help message and exit - -m MODULE, --module MODULE - Module to use (e.g: "servicemode" by default) - -n NETWORKS, --networks NETWORKS - Networks in MCCMNC format splitted with commas - -o, --cached_operator - Use operator in cache to speed up the passive scan - -s ANDROIDSDK, --sdk ANDROIDSDK - Android SDK path - -a ATMODE, --at ATMODE - AT access mode. If host put something like - "/dev/ttyUSBxx. By default it uses ADB." - -f FILE, --file FILE File to parse. For the moment it could be used in - combination with AT mode host. + +### 🐧 Ubuntu 24.04 Quick Install + +```bash +# Clone repository with submodules +git clone --recursive https://github.com/FlUxIuS/modmobmap.git +cd modmobmap + +# Run automated installation script +sudo ./install_all-Ubuntu_24.04.sh + +# Update submodules (if needed) +git submodule update --init --recursive --remote ``` -Assuming the Android SDK is installed in */opt/Android*, the tool can be quickly started as follows: +### 🔧 Manual Installation + +
+Click to expand manual installation steps +```bash +# 1. Install Python dependencies +pip3 install -r requirements.txt + +# 2. Install Android SDK +# Download from: https://developer.android.com/studio/#downloads +export ANDROID_SDK_ROOT=/path/to/android-sdk + +# 3. Install GNU Radio & gr-gsm +sudo apt-get install gnuradio gr-gsm + +# 4. Build srsRAN (for LTE scanning) +cd thirdparty/srsLTE +mkdir build && cd build +cmake ../ +make -j$(nproc) +sudo make install +``` + +
+ +--- + +## 🎯 Quick Start + +### 🔰 Basic Scanning (Smartphone) + +```bash +# Auto-detect operators and scan all available networks +sudo python3 modmobmap.py + +# Specify Android SDK location (if not in default path) +sudo python3 modmobmap.py -s /opt/Android/sdk +``` + +**Expected Output:** ``` -$ sudo python modmobmap.py => Requesting a list of MCC/MNC. Please wait, it may take a while... Found 2 operator(s) -{u'20810': u'F SFR', u'20820': u'F-Bouygues Telecom'} -[+] Unregistered from current PLMN -[+] New cell detected [CellID/PCI-DL_freq (4XXX-81)] +{'20810': 'F SFR', '20820': 'F-Bouygues Telecom'} + +[+] New cell detected [CellID/PCI-DL_freq (4XXX-81)] Network type=2G PLMN=208-10 ARFCN=81 -[+] New cell detected [CellID/PCI-DL_freq (6XXXXXX-2950)] - Network type=3G - PLMN=208-20 - Band=8 - Downlink UARFCN=2950 - Uplink UARFCN=2725 -[+] New cell detected [CellID/PCI-DL_freq (3XX-6300)] + +[+] New cell detected [CellID/PCI-DL_freq (3XX-6300)] Network type=4G PLMN=208-10 Band=20 Downlink EARFCN=6300 -[+] New cell detected [CellID/PCI-DL_freq (3XX-2825)] - Network type=4G - PLMN=208-10 - Band=7 - Downlink EARFCN=2825 -[+] New cell detected [CellID/PCI-DL_freq (3XX-1675)] - Network type=4G - PLMN=208-10 - Band=3 - Downlink EARFCN=1675 -[...] ``` -Note: If the Android SDK is installed anywhere else, you can use the *-s* parameter to specify its directory. +### ⚡ Speed Up Scanning (Cached Operators) -Speed-up the passive scan ---------------------------- - -When looking for operators, an AT command is sent to the modem. If you want to speed-up the scanning, you can hardcoded the operators to the following file `cache/operators.json`: - -``` +Create `cache/operators.json`: +```json { "20801": "Orange", - "20810": "F SFR", + "20810": "F SFR", "20815": "Free", "20820": "F-Bouygues Telecom" } ``` -Only the MCC/MNC codes are important. Then you can re-launch the tool as follows: - -``` -$ sudo python modmobmap.py -o -=> Requesting a list of MCC/MNC. Please wait, it may take a while... -Found 4 operators in cache, you choose to reuse them. -Found 4 operator(s) -{u'20810': u'F SFR', u'20820': u'F-Bouygues Telecom', u'20815': u'Free', u'20801': u'Orange'} -[+] Unregistered from current PLMN -[+] New cell detected [CellID/PCI-DL_freq (XXXX-10614)] - Network type=3G - PLMN=208-10 - Band=1 - Downlink UARFCN=10614 - Uplink UARFCN=9664 -[...] -[+] New cell detected [CellID/PCI-DL_freq (XXX-3501)] - Network type=4G - PLMN=208-20 - Band=8 - Downlink EARFCN=3501 -[...] -[+] Unregistered from current PLMN -=> Changing MCC/MNC for: 20815 -[+] New cell detected [CellID/PCI-DL_freq (XXX-2825)] - Network type=4G - PLMN=208-15 - Band=7 - Downlink EARFCN=2825 -[...] -=> Changing MCC/MNC for: 20801 -[+] New cell detected [CellID/PCI-DL_freq (XXXXX-3011)] - Network type=3G - PLMN=208-1 - Band=8 - Downlink UARFCN=3011 - Uplink UARFCN=2786 -[...] +Run with cache: +```bash +sudo python3 modmobmap.py -o ``` -Note we have been able to detect other cells the AT command *AT+COPS* did not return. +### 🎯 Target Specific Operators -A complete list of MCC and MNC codes could be retrieved anywhere on the internet and in Wikipedia: https://en.wikipedia.org/wiki/Mobile_country_code +```bash +# Focus on Orange (MCC/MNC: 20801) +sudo python3 modmobmap.py -n 20801 -Focusing some operators ------------------------- +# Multiple operators +sudo python3 modmobmap.py -n 20801,20810,20815 +``` -It is possible to tell *Modmobmap* to focus only on specific operators with the *-m* argument: +> 📚 **MCC/MNC Lookup:** [Wikipedia Mobile Country Codes](https://en.wikipedia.org/wiki/Mobile_country_code) -``` -$ sudo python modmobmap.py -n 20801 -=> Manual MCC/MNC processing... -Found 1 operator(s) -{'20801': '20801'} -[...] -=> Changing MCC/MNC for: 20801 -[+] New cell detected [CellID/PCI-DL_freq (XXX-1675)] - Network type=4G - PLMN=208-01 - Band=3 - Downlink EARFCN=1675 -[+] New cell detected [CellID/PCI-DL_freq (XXXXX-3011)] - Network type=3G - PLMN=208-1 - Band=8 - Downlink UARFCN=3011 - Uplink UARFCN=2786 -=> Changing network type for 3G only -[+] New cell detected [CellID/PCI-DL_freq (XXXXX-2950)] - Network type=3G - PLMN=208-1 - Band=8 - Downlink UARFCN=2950 - Uplink UARFCN=2725 -``` +--- -Using Modmobmap with xgoldmon ------------------------------- +## 📖 Usage Examples -With XGold modems, the use of xgoldmon will be required. But for now, only the fork for *Modmobmap* works to retrieve exact information of cells via the DIAG interface and could be downloaded at: https://github.com/FlUxIuS/xgoldmon +### 🔵 Method 1: ServiceMode (Samsung Devices) -Then after compiling, the tool *xgoldmon* could be started using the *-m* parameter like this: +The default and most straightforward method: +```bash +sudo python3 modmobmap.py -m servicemode ``` -sudo ./xgoldmon -t s3 -m /dev/ttyACM1 -``` -This will create a FIFO file that will be requested by Modmobmap later: +### 🟢 Method 2: XGoldmon (XGold Modems) + +For devices with XGold chipsets (S3, S4, Nexus): +**Terminal 1 - Start xgoldmon:** +```bash +cd /path/to/xgoldmon +sudo ./xgoldmon -t s3 -m /dev/ttyACM1 +# Creates celllog.fifo ``` -$ ls -celllog.fifo Makefile screenshot-mtsms-while-in-a-call.png xgoldmon + +**Terminal 2 - Run Modmobmap:** +```bash +sudo python3 modmobmap.py \ + -f /path/to/xgoldmon/celllog.fifo \ + -m xgoldmod \ + -a /dev/ttyACM0 \ + -o ``` -Then we can start running *Modmobmap* as follows by specifying the AT serial interface (*/dev/ttyACM0*) and the FIFO file created by *xgoldmon* (*/celllog.fifo -m xgoldmod -a /dev/ttyACM0 -o -=> Requesting a list of MCC/MNC. Please wait, it may take a while... -Found 4 operators in cache, you choose to reuse them. -Found 4 operator(s) -{'20801': 'Orange', '20810': 'F SFR', '20815': 'Free', '20820': 'F-Bouygues Telecom'} -[+] New cell detected [CellID/PCI-DL_freq (0x7XXXX-65535)] - Network type=3G - PLMN=208-1 - Downlink UARFCN=65535 - Uplink UARFCN=2850 -[+] Unregistered from current PLMN -[+] New cell detected [CellID/PCI-DL_freq (0x7XXXX-3011)] - Network type=3G - PLMN=208-1 - Downlink UARFCN=3011 - Uplink UARFCN=2786 -[...] -[+] Unregistered from current PLMN -=> Changing MCC/MNC for: 20810 -[+] New cell detected [CellID/PCI-DL_freq (0x3XXXXX-3075)] - Network type=3G - PLMN=208-10 - Downlink UARFCN=3075 - Uplink UARFCN=2850 -[...] - ``` -Note that retrieving results from AT+COPS command could take a lot of time and sometime would need to restart the tool. If the tool is blocked on the operator retrieving step, please use cached or targeted operators' features instead. +**Available GSM Bands:** +- `GSM850` (824-849 MHz) +- `GSM-R` (876-880 MHz, Railway) +- `GSM900` (890-915 MHz) +- `DCS1800` (1710-1785 MHz) +- `PCS1900` (1850-1910 MHz) -Using Modmobmap with GRGSM ------------------------------- +### 🔴 Method 4: LTE Scanning (SDR - srsRAN) -Drivers supported: +Scan LTE cells using srsRAN: -* bladerf -* uhd -* rtlsdr -* redpitaya -* soapy +```bash +# USRP scanning LTE Band 28 +python3 modmobmap.py -m srslte_pss -b 28 -g 'driver=usrp' -Modmodmap can be used with `gr-gsm` to retrieve GSM cells' information with a Software-Defined Radio device compatible with OSMOSDR. +# BladeRF scanning Band 7 +python3 modmobmap.py -m srslte_pss -b 7 -g 'driver=bladerf' -To use this feature, please issue the following command: +# RTL-SDR via Soapy (specify device ID!) +python3 modmobmap.py -m srslte_pss -b 20 -g 'soapy:id=1' +# Multiple bands +python3 modmobmap.py -m srslte_pss -b 3,7,20,28 -g 'driver=usrp' ``` -$ python modmobmap.py -m grgsm -b GSM-R,GSM900 -g rtlsdr -=> Switching to GSM-R band -[+] New cell detected [CellID/PCI-DL_freq (****)] - Network type=2G - PLMN=**** - ARFCN=978 -[+] New cell detected [CellID/PCI-DL_freq (*****)] - Network type=2G - PLMN=20820 - ARFCN=983 -[+] New cell detected [CellID/PCI-DL_freq (*****)] - Network type=2G - PLMN=20820 - ARFCN=1014 -[+] New cell detected [CellID/PCI-DL_freq (*****)] - Network type=2G - PLMN=20810 - ARFCN=79 -[+] New cell detected [CellID/PCI-DL_freq (****)] - Network type=2G - PLMN=20810 - ARFCN=86 -=> Switching to GSM900 band -[+] New cell detected [CellID/PCI-DL_freq (*****)] - Network type=2G - PLMN=20820 - ARFCN=978 -``` -Using Modmobmap with srsRAN ------------------------------- +### 🟣 Method 5: NB-IoT Scanning + +Detect Narrowband IoT cells: -Supported drivers: +```bash +sudo python3 modmobmap.py -m srslte_npss -b 20 -g 'soapy:id=1' +``` -* uhd -* bladerf -* soapy +--- +## 🔍 Finding Your SDR Device -Modmodmap can be used with `srsRAN` to retrieve LTE cells with a Software-Defined Radio device compatible with UHD, and Soapy drivers like the RTL-SDR. +### List Soapy Devices +```bash +SoapySDRUtil --find +``` -Before running the engine, make sure all dependencies are installed. You can refer to the installation script to install all appropriate dependencies. Also make sure that all submodules are pulled from the repository: +**Example Output:** +``` +Found device 0 + driver = rtlsdr + label = Generic RTL2832U OEM :: 00000001 + serial = 00000001 +Found device 1 + driver = bladerf + label = BladeRF #0 [bd7fffbf..d5958b06] + serial = bd7fffbf8efb4de4ba08d94bd5958b06 ``` -git submodule update --init --recursive + +### List UHD Devices +```bash +uhd_find_devices ``` +--- -To launch the tool with USRP, or bladeRF, you can choose or not to specify the driver as follows: +## 💾 Data Export -``` -$ python3 modmobmap.py -m srslte_pss -b 28 -g 'driver=usrp' -``` +Results are automatically saved when you stop the scan (`Ctrl+C`): -With Soapy, use this format of command instead precising the `id` of the device to avoid picking a random device (e.g, sound device...): +```bash +[+] Cells save as cells_1595446203.json ``` -python3 modmobmap.py -m srslte_pss -b 28 -g 'soapy:id=1' -Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_soapy.so libsrsran_rf_blade.so libsrsran_rf_zmq.so -Inactive RF plugins: -Opening RF device... -Supported RF device list: UHD soapy bladeRF zmq file -[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5 -Found Rafael Micro R820T tuner -[...] -Soapy has found device #1: available=Yes, driver=rtlsdr, label=Generic RTL2832U OEM :: 00000001, manufacturer=Realtek, product=RTL2838UHIDIR, rtl=0, serial=00000001, tuner=Rafael Micro R820T, -Selecting Soapy device: 1 -[...] -[+] New cell detected [CellID/PCI-DL_freq (447-9230)] - Network type=4G - PLMN=-1 - Band=28 - Downlink EARFCN=9230 -[ 21/449]: EARFCN 9231 Freq. 760.10 MHz looking for PSS. -[+] New cell detected [CellID/PCI-DL_freq (303-9231)] - Network type=4G - PLMN=-1 - Band=28 - Downlink EARFCN=9231 -[ 22/449]: EARFCN 9232 Freq. 760.20 MHz looking for PSS. -[+] New cell detected [CellID/PCI-DL_freq (0-9233)] - Network type=4G - PLMN=-1 - Band=28 - Downlink EARFCN=9233 -[ 24/449]: EARFCN 9234 Freq. 760.40 MHz looking for PSS -... -Found CELL ID 105. 25 PRB, 2 ports -[+] New cell detected [CellID/PCI-DL_freq (105-9235)] - Network type=4G - PLMN=-1 - Band=28 - Downlink EARFCN=9235 -[...] -^C[+] Cells save as cells_1595446203.json + +### JSON Output Format + +```json +{ + "3XX-6300": { + "PLMN": "208-10", + "band": 20, + "bandwidth": "10MHz", + "eARFCN": 6300, + "PCI": "3XX", + "TAC": "XXXX", + "type": "4G" + } +} ``` -The `g` parameters is not mandatory and is used mainly to select the right device to scan the Synchronization Signals. +--- -To find the right device with Soapy, you can type the following command: +## 🐳 Docker Deployment -``` -###################################################### -## Soapy SDR -- the SDR abstraction library ## -###################################################### +### Pre-built Image (Recommended) -[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5 -Found device 0 - driver = SpectranV6 - label = SpectranV6 RTSA HTTP Stream - manufacturer = HB9FXQ - product = SpectranV6 RTSA HTTP Stream - serial = SPECTRAN-V6-00000000000 +```bash +# Pull latest image +docker pull penthertz/modmobmap:latest_with_e200 -Found device 1 - backend = libusb - device = 0x01:0x13 - driver = bladerf - instance = 0 - label = BladeRF #0 [bd7fffbf..d5958b06] - serial = bd7fffbf8efb4de4ba08d94bd5958b06 +# Run with device access +docker run -it --privileged \ + -v /dev/bus/usb:/dev/bus/usb \ + penthertz/modmobmap:latest_with_e200 \ + python3 modmobmap.py -m grgsm -b GSM900 -g rtlsdr ``` -For NB-IoT scanning, you can use the `srslte_npss` option as follows: +### Build Your Own +```bash +# Clone and build +git clone --recursive https://github.com/FlUxIuS/modmobmap.git +cd modmobmap +docker build -t modmobmap:local . + +# Run +docker run -it --privileged -v /dev:/dev modmobmap:local ``` -$ sudo python modmobmap.py -m srslte_npss -b 20 -g 'soapy:id=1' # you need to precise the driver, and id of the device that way -[INFO] [UHD] linux; GNU C++ version 9.2.1 20191008; Boost_106700; UHD_4.0.0.0-531-g5fb585c3 -[INFO] [LOGGING] Fastpath logging disabled at runtime. - -Found Rafael Micro R820T tuner -Found Rafael Micro R820T tuner -[INFO] Using format CF32. -[R82XX] PLL not locked! -[+] New cell detected [CellID/PCI-DL_freq (1-6200)] - Network type=4G - PLMN=-1 - Downlink EARFCN=6200 -[+] New cell detected [CellID/PCI-DL_freq (1-6203)] - Network type=4G - PLMN=-1 - Downlink EARFCN=6203 -[+] New cell detected [CellID/PCI-DL_freq (446-6400)] - Network type=4G - PLMN=-1 - Downlink EARFCN=6400 -[...] + +> 🔐 **Security Note:** `--privileged` flag required for USB/hardware access + +--- + +## 📊 Command Reference + +```bash +python3 modmobmap.py [OPTIONS] + +Required Options: + -m, --module MODULE Scanning module: servicemode|xgoldmod|grgsm|srslte_pss|srslte_npss + +Optional Parameters: + -n, --networks NETWORKS Target MCC/MNC codes (comma-separated) + -o, --cached_operator Use cached operators for faster scanning + -s, --sdk PATH Android SDK path (default: auto-detect) + -a, --at DEVICE AT serial device (e.g., /dev/ttyUSB0) + -f, --file FILE FIFO file for xgoldmon integration + -b, --bands BANDS Frequency bands to scan (SDR modes) + -g, --args ARGS SDR device arguments (driver, gain, etc.) + +Examples: + # Basic smartphone scan + sudo python3 modmobmap.py + + # GSM scan with RTL-SDR + python3 modmobmap.py -m grgsm -b GSM900 -g rtlsdr + + # LTE scan targeting Band 7 + python3 modmobmap.py -m srslte_pss -b 7 -g 'driver=usrp' + + # Cached operators, specific network + sudo python3 modmobmap.py -n 20810 -o ``` -Saving results ---------------- +--- + +## 🤝 Contributing + +We welcome contributions! Here's how you can help: + +- 🐛 **Bug Reports:** Open an issue with details +- 🔧 **Device Support:** Add parsers for new phones +- 📡 **SDR Engines:** Integrate new hardware/software +- 📚 **Documentation:** Improve guides and examples + +--- + +## 📞 Support & Community -The process could be stopped at any time when killing the process with a keyboard interrupt signal. Then results will be automatically saved in a JSON file as follows: +- 🐦 **Twitter:** [@Penthertz](https://twitter.com/penthertz) +- 🌐 **Website:** [penthertz.com](https://www.penthertz.com) + +--- + +## 📜 License ``` -[...] -^C[+] Cells save as cells_1528738901.json +---------------------------------------------------------------------------- +"THE BEER-WARE LICENSE" (Revision 42): + wrote this file. As long as you retain +this notice you can do whatever you want with this stuff. If we meet some +day, and you think this stuff is worth it, you can buy me a beer in return. + FlUxIuS ;) +---------------------------------------------------------------------------- ``` -## Docker image (in case of Apocalypse) +--- + +## 🙏 Acknowledgments + +- Original presentation: [BeeRump 2018](https://www.rump.beer/2018/slides/modmobmap.pdf) +- [gr-gsm](https://github.com/ptrkrysik/gr-gsm) by Piotr Krysik +- [srsRAN](https://github.com/srsran/srsRAN) by Software Radio Systems +- [xgoldmon](https://github.com/2b-as/xgoldmon) by 2b-as + +--- + +
+ +**Made with ☕ & 📡 by the Penthertz Team** -To avoid any issue installing the whole project, we have also a Docker container available at this address: https://hub.docker.com/r/penthertz/modmobmap +⭐ Star us on GitHub if this project helped you! -You can now use the `latest_with_e200` tag which is compatible with the ANTSDR E200. +
From 0a31f442d73c082734341d48beafee11579798f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dudek?= Date: Wed, 26 Nov 2025 17:38:32 +0100 Subject: [PATCH 87/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a989be2..ff920bf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Mobile Network Intelligence & Mapping Tool** -*Retrieve comprehensive information on 2G/3G/4G/5G cellular networks with minimal equipment* +*Retrieve comprehensive information on 2G/3G/4G/and soon 5G cellular networks with minimal equipment* [![Python](https://img.shields.io/badge/Python-3.x-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/License-BEER--WARE-yellow.svg)](LICENSE) From 02a0b1e53138b944f09fa046ca91f83440177816 Mon Sep 17 00:00:00 2001 From: FlUxIuS Date: Tue, 16 Dec 2025 12:51:17 +0100 Subject: [PATCH 88/88] Fixing path for ADB --- engines/android/generic/ADBshell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/android/generic/ADBshell.py b/engines/android/generic/ADBshell.py index 4cd5362..53b9893 100644 --- a/engines/android/generic/ADBshell.py +++ b/engines/android/generic/ADBshell.py @@ -71,7 +71,7 @@ def _buildcommand(self, command): adbpath = None if self.androidsdkpath is not None: if 'linux' in sys.platform.lower(): - adbpath = self.androidsdkpath + '/platform-tools/adb' + adbpath = self.androidsdkpath + '/adb' if adbpath is None: raise ADBError('platform') commandstring = [adbpath, 'shell']