User Control Panel
Advertisements
HELP US, HELP YOU!
Author
Message
thesaboteur Newbie Joined: 05 Apr 2005Posts: 24
Posted: Tue Apr 05, 2005 6:18 am Post subject:
You may contact me via yahoo at 'ibeinvisible' You'll need to edit the 2 lines that say edit this. (user/pass) Tested on mac osx 10.3 perl 5.8.6 Code: <br />#!/usr/bin/perl<br /><br />#Im really new at trying to program, and perl, so I know this looks horrible.<br />#This follows what's at http://www.st3v3n.com/ycht.aspx I couldn't figure out data length bytes.<br />#If anyone knows what im missing and can help me out that would be great.<br />#This doesn't work very well and it's setup like this mainly to be simple and to help me learn.<br />#maybe some of you will find it usefull.<br />#maybe some of you can tell me what I did wrong as well :)<br /><br />use IO::Socket::INET;<br />use LWP::UserAgent;<br /><br />my $ua = LWP::UserAgent->new;<br />$ua->agent("Mozilla/4.0");<br />#my $username = MYUSERNAME; #edit this<br />my $x01 = '\x01';<br /><br />my $req = HTTP::Request->new(POST => 'http://edit.yahoo.com');<br />$req->content_type('application/x-www-form-urlencoded');<br />#$req->content('.src=chat&login=MYUSERNAME&passwd=MYPASSWORD&n=1'); #edit this<br /><br />print "sent HTTP::Request\n";<br /><br />my $res = $ua->request($req);<br /><br />#Yeah I know this is bad to.<br /><br />open(COOKIE, ">ychtcookie.txt") || die "Can't open ychtcookie.txt\n"; <br />print COOKIE $res->content || die "Couldn't write to ychtcookie.txt\n";<br />close(COOKIE) || die "Can't close ychtcookie.txt\n";<br />open(COOKIE, "ychtcookie.txt") || die "Can't open ychtcookie.txt\n";<br /><br />while (<COOKIE>) {<br /> if ($_ =~ "Set-Cookie: B=") {<br /> $b = $_;<br /> $b =~ s/(Set-Cookie:)\s//; <br /> $b =~ /(.*?)\s/;<br /> $b = $1;<br /> print "$b\n";<br /> }elsif ($_ =~ "Set-Cookie: F=") {<br /> $f = $_;<br /> $f =~ s/(Set-Cookie:)\s//;<br /> $f =~ /(.*?)\s/;<br /> $f = $1;<br /> print "$f\n";<br /> }elsif ($_ =~ "Set-Cookie: Y=") {<br /> $y = $_;<br /> $y =~ s/(Set-Cookie:)\s//;<br /> $y =~ /(.*?)\s/;<br /> $y = $1;<br /> print "$y\n";<br /> }elsif ($_ =~ "Set-Cookie: T=") {<br /> $t = $_;<br /> $t =~ s/(Set-Cookie:)\s//;<br /> $t =~ /(.*?)\s/;<br /> $t = $1;<br /> print "$t\n";<br /> }elsif ($_ =~ "Set-Cookie: I=") {<br /> $i = $_;<br /> $i =~ s/(Set-Cookie:)\s//;<br /> $i =~ /(.*?)\s/;<br /> $i = $1;<br /> print "$i\n";<br /> }else{ <br /> }<br />}<br /><br />print "We got cookies gonna try to login to chat now!\n"; <br />my $yahoo = IO::Socket::INET->new(PeerAddr => 'jcs.chat.dcn.yahoo.com',<br /> PeerPort => '8001',<br /> Proto => 'tcp')<br />or die "Couldn't connect to jcs.chat.dcn.yahoo.com:8001: $@\n";<br /><br />my $joinuse01 = join('', $username,$x01);<br />print "This is joinuse01 $joinuse01\n";<br />$cookiesum = join(' ', $b,$f,$y,$t,$i);<br />$lencalc = join('', $joinuse01,$cookiesum);<br />print "This is lencalc $lencalc\n";<br />$blen3 = length($lencalc);<br />my $blen = do { use bytes; length $lencalc; };<br />print "This is blen '$blen' \n";<br />$blen1 = $blen / 256;<br />print "$blen1\n";<br />$blen2 = $blen % 256;<br />print "$blen2\n";<br />print "this is length $blen3\n";<br />$size = length($username) + length($cookiesum) + length($x01);<br />print "this is size $size\n";<br /><br />$hex = &dec2hex($blen1);<br />print "decimal $blen1 = '$hex'\n";<br />sub dec2hex($) { return sprintf("%lx", $_[0]) }<br /><br /><br />$hex = &dec2hex($blen2);<br />print "decimal $blen2 = '$hex'\n";<br />sub dec2hex($) { return sprintf("%lx", $_[0]) }<br /><br /><br /><br /><br /><br /><br />#I couldn't figure out how to make the length in hex it's the last 2 before lencalc "\x01\xa5"<br />print $yahoo "YCHT'\x00\x00\x01\x7d\x00\x00\x00\x01\x00\x00\x01\xa5'$lencalc";<br />print "\n";<br /><br />while (<$yahoo>) {<br />$answer = <$yahoo>;<br />print $answer;<br />}<br />[CODE]<br />
Back to top
mattaustin Sentinel Joined: 19 Jul 2004Posts: 556 Location: Los Angeles, CA votes : 1
Posted: Tue Apr 05, 2005 6:44 am Post subject:
i am currently working on a perl toturial for this protocal, and i wrote the module you may want to have a look at, but if you have any quesions message me yahoo: mattrrnu msn: matt[at]msndev.com _________________ [ matt ]
Back to top
thesaboteur Newbie Joined: 05 Apr 2005Posts: 24
Posted: Fri Apr 08, 2005 9:00 am Post subject:
I finally have YCHT working Im gonna work on a module and stuff now.
Back to top
superman06 Newbie Joined: 07 May 2006Posts: 1
Posted: Sun May 07, 2006 5:51 pm Post subject:
hello what are im going to put if im going to edit the code and which file should i put this.... thanks..
Back to top