[Ruby] - Simple pastebin watcher

Download | Vote Up (0) | Vote Down (0)
#!/usr/bin/ruby

# Quand on s'ennuit...
# Voilà un petit bout de code qui check les derniers paste sur 
# pastebin.com à la recherche de mots clés (que vous pouvez définir 
# comme des regex). J'en ai pré-ajouté quelques uns, 
# tout à fait pertinents.
# Amusez vous bien.

require 'open-uri'

keywords = ['hacking', 'hacked', 'vuln', 'injection', 'leak', 'premium', 'hwc', 'I <3 kallimero']
logged = '_'
while fr0g = 'gay'
        sleep 2
        page = open("http://pastebin.com/").read
        links = page.scan(/<a href="\/([a-z0-9]+)">.+?<\/a><span>/i)
        links.each do |link|
                page = open("http://pastebin.com/raw.php?i=#{link}").read
                keywords.each do |keyword|
                        if page.match(/#{keyword}/) and not logged.match(/_#{link}/)
                                puts "MATCHED #{keyword}... http://pastebin.com/raw.php?i=#{link}"
                                logged = logged + "#{link}_"
                        end
                end
        end
end

Groucho


Be the first to give feedback !

Please login to comment !