Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- print 'Connecting...'
- cnx = mysql.connector.connect(user='root', database='matovt', password='')
- cursor = cnx.cursor()
- print "Selecting..."
- records = {}
- cursor.execute("SELECT `id`,`shasum`, `permalink` FROM virustotals", ())
- for (id, shasum, permalink) in cursor:
- start = permalink.find("file/")
- end = permalink.find("/analysis")
- sha256 = permalink[(start + 5):end]
- records[id] = sha256
- for id in records.keys():
- print "Updating (", id, ", ", records[id], ", ", len(records[id]), ")"
- x = cursor.execute('UPDATE `virustotals` SET `shasum` = %s WHERE `id` = %s', (records[id], id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement