mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
ok, i've been fighting with my http server for a looong time now. it works perfectly fine when i use a proxy server, and doesn't when i don't. i couldn't figure out for the life of me why, so finally i use a packet sniffer and found the only difference. the one with the proxy adds a crlf at the end. i don't know if it is against the http rfc to do this (though i should know, i've read the thing over and over now..), but i don't think any browser i tested successfully sent a crlf after the post data.

here is the output in mirc

without proxy:

POST /die/--WEBBOT-SELF-- HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-gsarcade-launch, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://ed209.bounceme.net:444/die/bitch.html
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: ed209.bounceme.net:444
Content-Length: 48
Proxy-Connection: Keep-Alive
Pragma: no-cache

with proxy:

POST /die/--WEBBOT-SELF-- HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-gsarcade-launch, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://ed209.bounceme.net:444/die/bitch.html
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: ed209.bounceme.net:444
Content-Length: 50
Proxy-Connection: Keep-Alive
Pragma: no-cache
T3=networkhere&T2=sniffmyass&T1=password&B1=Submit


ok, now for a raw output of the packets:

without a proxy:
Code:
0001  00 C0 49 CD 50 2C 00 04 5A 87 69 39 08 00 45 00    .ÀIÍP,..Z‡i9..E.
0002  02 90 67 AB 40 00 80 06 CE 5C C0 A8 00 02 44 A8    .g«@.€.Î\À¨..D¨
0003  BD 0D 08 3C 01 BC AA 98 B7 F6 AA 99 54 A5 50 18    ½..<.¼ª˜·öª™T¥P.
0004  FA F0 3D A1 00 00 50 4F 53 54 20 2F 64 69 65 2F    úð=¡..POST /die/
0005  2D 2D 57 45 42 42 4F 54 2D 53 45 4C 46 2D 2D 20    --WEBBOT-SELF-- 
0006  48 54 54 50 2F 31 2E 31 0D 0A 41 63 63 65 70 74    HTTP/1.1..Accept
0007  3A 20 69 6D 61 67 65 2F 67 69 66 2C 20 69 6D 61    : image/gif, ima
0008  67 65 2F 78 2D 78 62 69 74 6D 61 70 2C 20 69 6D    ge/x-xbitmap, im
0009  61 67 65 2F 6A 70 65 67 2C 20 69 6D 61 67 65 2F    age/jpeg, image/
000A  70 6A 70 65 67 2C 20 61 70 70 6C 69 63 61 74 69    pjpeg, applicati
000B  6F 6E 2F 78 2D 67 73 61 72 63 61 64 65 2D 6C 61    on/x-gsarcade-la
000C  75 6E 63 68 2C 20 61 70 70 6C 69 63 61 74 69 6F    unch, applicatio
000D  6E 2F 76 6E 64 2E 6D 73 2D 70 6F 77 65 72 70 6F    n/vnd.ms-powerpo
000E  69 6E 74 2C 20 61 70 70 6C 69 63 61 74 69 6F 6E    int, application
000F  2F 76 6E 64 2E 6D 73 2D 65 78 63 65 6C 2C 20 61    /vnd.ms-excel, a
0010  70 70 6C 69 63 61 74 69 6F 6E 2F 6D 73 77 6F 72    pplication/mswor
0011  64 2C 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 78    d, application/x
0012  2D 73 68 6F 63 6B 77 61 76 65 2D 66 6C 61 73 68    -shockwave-flash
0013  2C 20 2A 2F 2A 0D 0A 52 65 66 65 72 65 72 3A 20    , */*..Referer: 
0014  68 74 74 70 3A 2F 2F 65 64 32 30 39 2E 62 6F 75    http://ed209.bou
0015  6E 63 65 6D 65 2E 6E 65 74 3A 34 34 34 2F 64 69    nceme.net:444/di
0016  65 2F 62 69 74 63 68 2E 68 74 6D 6C 0D 0A 41 63    e/bitch.html..Ac
0017  63 65 70 74 2D 4C 61 6E 67 75 61 67 65 3A 20 65    cept-Language: e
0018  6E 2D 75 73 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79    n-us..Content-Ty
0019  70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F    pe: application/
001A  78 2D 77 77 77 2D 66 6F 72 6D 2D 75 72 6C 65 6E    x-www-form-urlen
001B  63 6F 64 65 64 0D 0A 41 63 63 65 70 74 2D 45 6E    coded..Accept-En
001C  63 6F 64 69 6E 67 3A 20 67 7A 69 70 2C 20 64 65    coding: gzip, de
001D  66 6C 61 74 65 0D 0A 55 73 65 72 2D 41 67 65 6E    flate..User-Agen
001E  74 3A 20 4D 6F 7A 69 6C 6C 61 2F 34 2E 30 20 28    t: Mozilla/4.0 (
001F  63 6F 6D 70 61 74 69 62 6C 65 3B 20 4D 53 49 45    compatible; MSIE
0020  20 36 2E 30 3B 20 57 69 6E 64 6F 77 73 20 4E 54     6.0; Windows NT
0021  20 35 2E 31 29 0D 0A 48 6F 73 74 3A 20 65 64 32     5.1)..Host: ed2
0022  30 39 2E 62 6F 75 6E 63 65 6D 65 2E 6E 65 74 3A    09.bounceme.net:
0023  34 34 34 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E    444..Content-Len
0024  67 74 68 3A 20 35 30 0D 0A 43 6F 6E 6E 65 63 74    gth: 50..Connect
0025  69 6F 6E 3A 20 4B 65 65 70 2D 41 6C 69 76 65 0D    ion: Keep-Alive.
0026  0A 43 61 63 68 65 2D 43 6F 6E 74 72 6F 6C 3A 20    .Cache-Control: 
0027  6E 6F 2D 63 61 63 68 65 0D 0A 0D 0A 54 33 3D 6E    no-cache....T3=n
0028  65 74 77 6F 72 6B 68 65 72 65 26 54 32 3D 73 6E    etworkhere&T2=sn
0029  69 66 66 6D 79 61 73 73 26 54 31 3D 70 61 73 73    iffmyass&T1=pass
002A  77 6F 72 64 26 42 31 3D 53 75 62 6D 69 74          word&B1=Submit


with proxy:
Code:
0001  00 C0 49 CD 50 2C 00 04 5A 87 69 39 08 00 45 00    .ÀIÍP,..Z‡i9..E.
0002  02 92 B8 8D 40 00 80 06 7D 78 C0 A8 00 02 44 A8    .’¸@.€.}xÀ¨..D¨
0003  BD 0D 08 71 01 BC AF C0 D8 46 AF C1 87 69 50 18    ½..q.¼¯ÀØF¯Á‡iP.
0004  FA F0 D2 FB 00 00 50 4F 53 54 20 2F 64 69 65 2F    úðÒû..POST /die/
0005  2D 2D 57 45 42 42 4F 54 2D 53 45 4C 46 2D 2D 20    --WEBBOT-SELF-- 
0006  48 54 54 50 2F 31 2E 31 0D 0A 41 63 63 65 70 74    HTTP/1.1..Accept
0007  3A 20 69 6D 61 67 65 2F 67 69 66 2C 20 69 6D 61    : image/gif, ima
0008  67 65 2F 78 2D 78 62 69 74 6D 61 70 2C 20 69 6D    ge/x-xbitmap, im
0009  61 67 65 2F 6A 70 65 67 2C 20 69 6D 61 67 65 2F    age/jpeg, image/
000A  70 6A 70 65 67 2C 20 61 70 70 6C 69 63 61 74 69    pjpeg, applicati
000B  6F 6E 2F 78 2D 67 73 61 72 63 61 64 65 2D 6C 61    on/x-gsarcade-la
000C  75 6E 63 68 2C 20 61 70 70 6C 69 63 61 74 69 6F    unch, applicatio
000D  6E 2F 76 6E 64 2E 6D 73 2D 70 6F 77 65 72 70 6F    n/vnd.ms-powerpo
000E  69 6E 74 2C 20 61 70 70 6C 69 63 61 74 69 6F 6E    int, application
000F  2F 76 6E 64 2E 6D 73 2D 65 78 63 65 6C 2C 20 61    /vnd.ms-excel, a
0010  70 70 6C 69 63 61 74 69 6F 6E 2F 6D 73 77 6F 72    pplication/mswor
0011  64 2C 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 78    d, application/x
0012  2D 73 68 6F 63 6B 77 61 76 65 2D 66 6C 61 73 68    -shockwave-flash
0013  2C 20 2A 2F 2A 0D 0A 52 65 66 65 72 65 72 3A 20    , */*..Referer: 
0014  68 74 74 70 3A 2F 2F 65 64 32 30 39 2E 62 6F 75    http://ed209.bou
0015  6E 63 65 6D 65 2E 6E 65 74 3A 34 34 34 2F 64 69    nceme.net:444/di
0016  65 2F 62 69 74 63 68 2E 68 74 6D 6C 0D 0A 41 63    e/bitch.html..Ac
0017  63 65 70 74 2D 4C 61 6E 67 75 61 67 65 3A 20 65    cept-Language: e
0018  6E 2D 75 73 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79    n-us..Content-Ty
0019  70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F    pe: application/
001A  78 2D 77 77 77 2D 66 6F 72 6D 2D 75 72 6C 65 6E    x-www-form-urlen
001B  63 6F 64 65 64 0D 0A 41 63 63 65 70 74 2D 45 6E    coded..Accept-En
001C  63 6F 64 69 6E 67 3A 20 67 7A 69 70 2C 20 64 65    coding: gzip, de
001D  66 6C 61 74 65 0D 0A 55 73 65 72 2D 41 67 65 6E    flate..User-Agen
001E  74 3A 20 4D 6F 7A 69 6C 6C 61 2F 34 2E 30 20 28    t: Mozilla/4.0 (
001F  63 6F 6D 70 61 74 69 62 6C 65 3B 20 4D 53 49 45    compatible; MSIE
0020  20 36 2E 30 3B 20 57 69 6E 64 6F 77 73 20 4E 54     6.0; Windows NT
0021  20 35 2E 31 29 0D 0A 48 6F 73 74 3A 20 65 64 32     5.1)..Host: ed2
0022  30 39 2E 62 6F 75 6E 63 65 6D 65 2E 6E 65 74 3A    09.bounceme.net:
0023  34 34 34 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E    444..Content-Len
0024  67 74 68 3A 20 35 30 0D 0A 43 6F 6E 6E 65 63 74    gth: 50..Connect
0025  69 6F 6E 3A 20 4B 65 65 70 2D 41 6C 69 76 65 0D    ion: Keep-Alive.
0026  0A 43 61 63 68 65 2D 43 6F 6E 74 72 6F 6C 3A 20    .Cache-Control: 
0027  6E 6F 2D 63 61 63 68 65 0D 0A 0D 0A 54 33 3D 6E    no-cache....T3=n
0028  65 74 77 6F 72 6B 68 65 72 65 26 54 32 3D 73 6E    etworkhere&T2=sn
0029  69 66 66 6D 79 61 73 73 26 54 31 3D 70 61 73 73    iffmyass&T1=pass
002A  77 6F 72 64 26 42 31 3D 53 75 62 6D 69 74 0D 0A    word&B1=Submit..


is there any way around this? i have thought and thought of ways to force internet explorer add another line (one that i wouldn't use or something) at the end... or maybe even force mirc into reading that last line no matter how much it doesn't want to, but i can't figure out how frown.

i also read the help file, and couldn't find any documentation about this, so any help you could provide would be very much so appreciated.

well, that's my bug report... i've tested several times, and the results are 100% the same... do not deviate at all.

thanks


"The only foolish question is that which is not ask by a fool"
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
You might try looking in the help File

/help /sockread

/sockread [-fn] [numbytes] <%var|&binvar>
If you specify the -f switch with a %var variable, this forces mIRC to fill the %var variable with whatever text is in the receive buffer, even if it doesn't end in a CRLF.


Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Are you using /sockread with a %variable and no -f switch (or binvars with just the -n switch)? If you are, then that's why.

From the mIRC helpfile:
/sockread [-fn] [numbytes] <%var|&binvar>

If you specify a %var variable, a line of text ending with a Carriage Return/LineFeed is read into %var. The $crlf are stripped off (this may result in %var being $null if the line only consisted of $crlf).

If you specify the -f switch with a %var variable, this forces mIRC to fill the %var variable with whatever text is in the receive buffer, even if it doesn't end in a $crlf.

The -n switch allows you to read a $crlf terminated line into a &binvar. If the incoming line does not contain a $crlf, no bytes will be read into &binvar, unless you specify the -f switch, which forces the read (same as when reading into %vars).


You might like to try binvars, or the -f switch.

Last edited by Collective; 18/01/04 01:28 AM.
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
ok, for smartasses who think i'm a newb, i'll go ahead and post my code

Code:
on *:sockread:ed209a.*: {
  sockread -f %x
  echo %x
  if (T3=* iswm %x) {
    sendloginpage %x
  }
  if (GET isin %x) {
    sendpage $gettok(%x,2,32)
  }
}


"The only foolish question is that which is not ask by a fool"
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
btw... that wasn't directed at you there collective, you were a bit nicer about it, heh


"The only foolish question is that which is not ask by a fool"
Joined: Dec 2002
Posts: 155
S
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
Note: A single /sockread may not be enough to read the entire buffer. You should keep reading until $sockbr (bytes read) is set to zero. This is far faster than letting mIRC re-trigger the event. If your script doesn't read the whole buffer, the on sockread event is re-triggered if:
a) you were reading into a &binvar.
b) you were reading into a %var and there is still a $crlf terminated line in the buffer waiting to be read.

Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
thanks for the tid-bit there strider... i didn't really understand that, but it may have fixed it...

i will try it out with a different method. thanks though, it atleast help lead me in the right direction


"The only foolish question is that which is not ask by a fool"
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
yea, that seems to have fixed it... guess i'm the dumbass, lol

thanks for that strider.

nobodi: pls dont assume i don't read the help file... i (as many others) may not understand "all" of it, but i do read it.


"The only foolish question is that which is not ask by a fool"
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I'm sure Nobodi had no intention of being patronising or to anger you in any way, he probably thought that you missed something in the help file and thought that what he posted would be of use to you. Unfortunately, because 75%+ of people that post here do not actually read the help file, or browse the Forums in search of threads that cover the topic, we automatically assume that the person hasn't read it, or has missed something.

Remember that we do give up our free time to be here and help others in any way that we can, and all help should be appreciated, without us being called smartasses etc.

I'm glad you got your problem sorted though smile Happy chatting!

Regards,


Mentality/Chris
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
eh, sorry -- i understand. i used to help here a lot, but i lost my username/password, so i gotta start fresh, heh

finding help in mirc scripting is a bit annoying though, because every time i ask the first thing they do is tell me to look at the help file. well, naturally, that is also the first thing i do when i run across a problem. same goes for people who swear by telling everyone that all their questions can be found in google. if i could find it in google, i wouldn't be asking it, because i always check that first too.

guess that's just me, i understand there are plenty of people out there that don't read the help file, but just as places expect a specific question, i am hoping to in return get a more specific answer.

i think the particular reason i was annoyed is because i clearly stated in my post "i have read the help file".


"The only foolish question is that which is not ask by a fool"

Link Copied to Clipboard