http.send(b_string) code, msg, headers = http.getreply() bytes = http.file.read() (a, b, errorCode, latitude, longitude, c, d, e) = unpack(">hBiiiiih", bytes) lat = latitude / 1000000.0 lon = longitude / 1000000.0 print "[+] Coordinates : %f:%f" % (lat, lon) if not BTS.if_already_mapped(lat, lon): try: bts = BTS.create(op=op, lat=lat, lon=lon, cid=cid, mcc=mcc, mnc=mnc, lac=lac, date=date) except Exception as err: print "Error : %s" % err else: print "[!] Already in database" # SYSTEM INFORMATION TYPE 4 elif "Inform : [06 1c" in out: print '\n', gammuProcess.stdout.readline().rstrip().lstrip() print gammuProcess.stdout.readline().rstrip().lstrip() print out # else:
c = hex(divmod(mnc,100)[1])[2:].zfill(8) + hex(divmod(mnc,100)[0])[2:].zfill(8) string = (a + b + c + "FFFFFFFF00000000").decode("hex") r = urllib.urlopen("http://www.google.com/glm/mmap",string).read().encode("hex") if len(r) > 14: lon, lat = float(int(r[14:22], 16)) / 1000000, float(int(r[22:30], 16)) / 1000000 print "[+] Coordinates : %f:%f" % (lon, lat) if not BTS.if_already_mapped(lon, lat): try: bts = BTS.create( op=op, lon=lon, lat=lat, cid=cid, mcc=mcc, mnc=mnc, lac=lac, date=date ) except Exception as err: print "Error : %s" % err else: print "[!] Already in database" elif "Inform : [06 1c" in out: # SYSTEM INFORMATION TYPE 4 print '\n', gammuProcess.stdout.readline().rstrip().lstrip() print gammuProcess.stdout.readline().rstrip().lstrip() print out # else: