
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 2.02 KB | hits: 20 | expires: Never
class RelayController < ApplicationController
require 'socksify'
require 'uri'
require 'net/http'
def expiry
username = params[:username]
password = params[:password]
@return = valid_expiry_date(username.to_s, password.to_s)
end
def anti_hack
username = params[:username]
password = params[:password]
@return = valid_expiry_date(username.to_s, password.to_s)
end
def change_password
username = params[:username]
password = params[:password]
newpassword = params[:newpassword]
@return = valid_expiry_date(username.to_s, password.to_s, newpassword.to_s)
end
private
def change_password(username, password, newpassword)
TCPSocket::socks_server = "127.0.0.1"
TCPSocket::socks_port = 9050
reply = Net::HTTP.get URI.parse("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=setaccountdetails_v1&type=prem&login=" + username + "&password=" + password + "&newpassword=" + newpassword)
if reply == "OK"
return "done"
else
return "false"
end
end
def rsantihack_disable(username, password)
TCPSocket::socks_server = "127.0.0.1"
TCPSocket::socks_port = 9050
reply = Net::HTTP.get URI.parse("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login=" + username + "&password=" + password)
account = reply[169..171]
if account == 0
return true
else
return false
end
end
def valid_expiry_date(username, password)
random = Digest::SHA1.hexdigest([Time.now, rand].join)
random = random[10..20]
TCPSocket::socks_server = "127.0.0.1"
TCPSocket::socks_port = 9050
reply = Net::HTTP.get URI.parse("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login=" + username + "&password=" + password)
account = Time.at(reply[105..115].to_i)
if (Time.now + 2419200) <= account
return true
else
return false
end
end
end