Tuesday, July 21, 2009

Everybody else is doing it....

Pastebin: the constant stream of people's mysql credentials.

Posted by Anonymous on Sat 18 Jul 01:54 (modification of post by
  1.         db, error = mysql.connect("[CENSORED]servers.co.uk","killerss_youarem","aBiGJbuelZnKQxP87AUWYlBj9AG6in","killerss_you")
  2. local host = "[CENSORED]servers.co.uk"
  3. local username = "killerss_youarem"
  4. local password = "aBiGJbuelZnKQxP87AUWYlBj9AG6in"
  5. local database = "killerss_you"
  6. local port = 3306
  7.  
  8. local persistant = true
  9.  
  10. require( "mysql" )
  11.  
  12. local db
  13.  
  14. fucntion DoQuery(query, type)
  15.         local result, isok, err = mysql.query(db, query, type or mysql.QUERY_NUMERIC)
  16.        
  17.         if not isok and err == "" then isok = true end -- false positive
  18.        
  19.         if not isok then
  20.                 Error(tostring(err))
  21.                 return nil
  22.         end
  23.                
  24.         return result
  25. end
  26.  
  27. function Connect()
  28.         if db then return db end -- Still connected
  29.        
  30.         db, err = mysql.connect(host, username, password, database, port)
  31.         if db == 0 then
  32.                 Error(tostring(err))
  33.                 db = nil
  34.                 return
  35.         end
  36.        
  37.         return db
  38. end
  39.  
  40. function Disconnect(force)
  41.         if not db then return end -- Already disconnected
  42.         if persistent and not force then return end -- Don't disconnect persistent
  43.        
  44.         local succ, err = mysql.disconnect(db)
  45.         if not succ then
  46.                 error(tostring(err))
  47.         end
  48.        
  49.         db = nil
  50. end
  51. hook.Add("ShutDown", "SQLDisconnect", function() disconnect(true) end) -- Force closed on shutdown
blog comments powered by Disqus