Author Topic: question:Cracking Huawei 3G ,4G modems  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

Offline Clone

  • Peasant
  • *
  • Posts: 50
  • Cookies: 2
  • Always trying to find the value of x
    • View Profile
question:Cracking Huawei 3G ,4G modems
« on: March 14, 2014, 12:24:30 am »
Huawei modem:


A phone provider acting as an ISP gives you access to internet via a huawei modem.The technology used is similar to taking a phne call or better using a phone to browse the internet.The ISP can restrict bandwidth so how do you overcome the restrictions? I know you can unlock the modem.
Code: (Python) [Select]
import hashlib, getopt, sys
 
 
def usage():
    print "Options: -i*, --imei=*      IMEI of the device"
    print ""
    print "Example: huawei-unlock.py --imei=351234567891239"
    print ""
 
def testIMEIChecksum(digits):
    _sum = 0
    alt = False
    for d in reversed(digits):
        assert 0 <= d <= 9
        if alt:
            d *= 2
        if d > 9:
            d -= 9
        _sum += d
        alt = not alt
    return (_sum % 10) == 0
 
def checkIMEI(imei):
    digits = []
    if len(imei) != 15:
        print "IMEI too short/long"
        return False
    for i in imei:
        digits.append(int(i))
    if not testIMEIChecksum(digits):
        print "IMEI checksum invalid"
        return False
    return True
 
def getCode(imei, salt):
    digest = hashlib.md5((imei+salt).lower()).digest()
    code = 0
    for i in range(0,4):
        code += (ord(digest[i])^ord(digest[4+i])^ord(digest[8+i])^ord(digest[12+i])) << (3-i)*8
    code &= 0x1ffffff
    code |= 0x2000000
    return code
 
def main():
    info()
        try:   
                opts, args = getopt.getopt(sys.argv[1:], "hi:", ["help", "imei="])
        except getopt.GetoptError, err:
                print str(err) # will print something like "option -a not recognized"
                usage()
                sys.exit(2)
 
    imei = ""
    interactive = False
 
        for o, a in opts:
                if o in ("-i", "--imei"):
                        imei = a
                elif o in ("-h", "--help"):
                        usage()
                        sys.exit()
 
    if imei == "":
        imei = raw_input("Please enter the IMEI of the device: ")
        interactive = True
 
    if checkIMEI(imei):
        print "Unlock Code: %d" % (getCode(imei, hashlib.md5("hwe620datacard").hexdigest()[8:24]))
        print "Flash Code:  %d" % (getCode(imei, hashlib.md5("e630upgrade").hexdigest()[8:24]))
        print "done."
 
    if interactive:
        raw_input()
     
if __name__ == "__main__":
    main()

code so that it uses different sim cards or a variety of ISP but  how woul you hack the modem to increase bandwith or in other words how can i crack the modem deeper to letting it intercept signals and shit   
« Last Edit: March 14, 2014, 12:30:50 am by Clone »
One who walks the line between light and dark, with no ties to either side. No morals or emotions clouding their judgment,able to accomplish tasks and solve problems in the most efficient and logical way.