Posted by admin on August 11, 2009 – 1:25 am
Author: slac3dork
site: http://snippet.c0de.me
summary: Php code to get server and execution environment information. Based on $_SERVER php manual.
<?php
/**
_________ .__ .____ _______
/ _____/ ____ |__|_____ | | \ _ \ ____
\_____ \ / \| \____ \| | / /_\ \ / ___\
/ \ | \ | |_> > |__\ \_/ \/ /_/ >
/_______ /___| /__| __/|_______ \_____ /\___ /
\/ \/ |__| \/ \//_____/
http://snippet.c0de.me
slac3dork@gmail.com
*/
/**
* PHP Server and Execution Environment Information
* Coded By slac3dork
* Special Thanks to Myrddin and Jeffwk who are giving me inspiration.
*/
echo '<h2><p align="center">Server And Execution Environment Information</p></h2>';
echo '<table border="3" align="center">';
foreach ($_SERVER as $key => $value) {
if (!$value) {
$value = '-';
}
echo '<tr>';
echo '<td>'.$key.'</td>'.'<td>'.$value.'</td>';
echo '</tr>';
}
echo '</table>';
?>

Posted by admin on August 8, 2009 – 3:23 pm
Filed under ruby
Tagged as API, attribute, class, cli, code, command line, command line argument, cURL, cURL like, http, method, net/http, NET::HTTP.post_form, option parse, optparse, rb, ruby, simple, simple cURL, snippet, status, Tweeby, tweet, twitter, twitter API, update, URI.parse
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Tweeby, a cURL alternative only to update twitter status. Just for fun. Tested on Linux.
#!/usb/bin/ruby
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
require 'optparse'
require 'net/http'
class Tweeby
def initialize
puts '-------------------------------------------------------'
puts '[+] Tweeby - cURL alternative to update twitter status'
puts '[+] Tweeby.rb - http://snippet.c0de.me'
puts '[+] Author: slac3dork'
puts "-------------------------------------------------------\n\n"
end
def parseOptions
begin
options = {}
opts = OptionParser.new
opts.banner = "Usage: ./tweeby.rb -u your_username -p your_password -s your_status\nExample: ./tweeby.rb -u myuser -p mypassword -s 'this is my status'"
opts.on('-u your_username', '--user your_username', 'your_username = Your Twitter username') do |u|
@username = u
end
opts.on('-p your_password', '--password your_password', 'your_password = Your Twitter password') do |p|
@passwd = p
end
opts.on('-s your_status', '--status your_status', 'your_status = Your Twitter status message') do |s|
@status = s
end
opts.on('-v', '--verbose', 'Run verbosely') do |v|
@verbose = v
end
opts.parse!
if (!(@username and @passwd and @status))
puts opts
exit(1)
end
rescue OptionParser::ParseError
puts opts
exit(1)
end
end
def sendTweet
begin
puts '[+] Starting Tweeby...'
tweet = Net::HTTP.post_form(
URI.parse("http://#{@username}:#{@passwd}@twitter.com/statuses/update.xml"),
{"status"=>"#{@status}"})
if @verbose
puts tweet.body
else
puts '[+] Your status has been updated'
end
puts '[+] Done...'
rescue Exception
puts '[-] Error while tweeting, check your username, password, and internet connection'
end
end
end
# main
twitter = Tweeby.new
twitter.parseOptions
twitter.sendTweet

Posted by admin on August 6, 2009 – 10:13 am
Filed under ruby
Tagged as argument, ARGV, cli, close, close file, command line argument, convert, converter, domain, domain name, exception, file, http, ip, ip address, open, open file, open-uri, open-uri exception, OpenURI::HTTPError, ruby, snippet, Timeout::Error, uri, url
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Reverse IP tool. Ruby code to get domain name from ip address and save all results to ip2domain_result.txt. This script need internet connection and create connection to http://www.ip-adress.com/reverse_ip/. Tested on Linux.
Usage: ruby ip2domain.rb <domain_name> or ./ip2domain.rb <domain_name>
#!/usb/bin/ruby
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
require 'open-uri'
if ARGV.size < 1
puts '[-] Usage ./ip2domain.rb <ip_address>'
exit 1
end
puts '-----------------------------------------------'
puts '[+] Reverse IP tool'
puts '[+] ip2domain.rb'
puts '[+] Author: slac3dork'
puts "-----------------------------------------------\n\n"
begin
status = false
filename = 'ip2domain_result.txt'
ip_addr = ARGV[0]
domain_file = File.new("#{filename}", "w")
open("http://www.ip-adress.com/reverse_ip/#{ip_addr}") {|page|
page.each_line {|line|
if (line =~ /.*<\/td>/)
domain_name = "#{line.slice(/\S.*/).slice(/([a-z0-9_-]+[\.]{1})+[a-z]{2,}/)}"
if (domain_name != '')
if (domain_file)
puts "[+] #{domain_name}"
domain_file.puts("#{domain_name}")
else
puts 'Unable to open file'
exit(1)
end
if (!status)
status = true
end
end
end
}
}
domain_file.close
if (!status)
puts '[-] Not found. Check your IP address.'
else
puts '--> All domain name results has been saved to ip2domain_result.txt'
end
rescue OpenURI::HTTPError => error_msg
puts "[-] Ups! Got bad status code: #{error_msg}. Try again"
rescue Timeout::Error
puts '[-] oops! Timeout bro, check your internet connection'
rescue Exception => e
puts "#{e.message}"
end
