mIRC Home    About    Download    Register    News    Help

Print Thread
Login Script #162060 14/10/06 07:58 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Hi again, I tried to make a login script, using sockets, I also tried to replace all of the stuff that was in this script, but, I couldn't get it to work, I was wondering, since FiberOPtics made this script, if anyone could help me with this:
Site = http://forum.xbconnect.com
If you would like me to register a nick, then, I'd love to do it, please try and help me if you can.
also, if you know how to rewrite the other script, then please do so, thanks.
Help highly appreciated.


-Kurdish_Assass1n
Re: Login Script #162061 15/10/06 01:26 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
here's what I have so far, I'm at the login screen, but, I don't know how to actually login, I have a username and a password, but, don't know how to login, please help.
Code:
alias xforums { sockopen xbcforum forum.xbconnect.com 80 }

on *:SOCKOPEN:xbcforum: {
  if ($sockerr) { echo -a ERROR: $v1 }
  sockwrite -n $sockname GET /showpost.php?p=97496&postcount=1 HTTP/1.1
  sockwrite -n $sockname Accept: */*
  sockwrite -n $sockname Host: forum.xbconnect.com
  sockwrite -n $sockname
}

on *:sockread:xbcforum: {
  var %xbcforum
  sockread %xbcforum
  [color:red];don't know what to do for this script, please help!![/color]
}



-Kurdish_Assass1n
Re: Login Script #162062 15/10/06 07:42 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
That forum looks to be the same forum (vBulletin) as the one that I posted code for here

So the login process should be the same. All code you need is in that post, although of course you'll need to change the hostname, referer etc.


Gone.
Re: Login Script #162063 16/10/06 02:43 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
sorry FiberOPtics, I tried to do it, but, I just couldn't get it to work, is it possible that you could replace them for me, only if you choose to, I don't know much about sockets, so, sorry again.

-----------------
Website: http://forum.xbconnect.com
Vbulletin
forum: /showpost.php?p=97496&postcount=1 (trying to get info from that post)
Port #: 80
PLEASE if anyone can help, I'd appreciate it, thanks again.


-Kurdish_Assass1n
Re: Login Script #162064 04/11/06 06:05 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
If you have a generic username and password I can fiddle with I may be able to get something working. If you don't want it public, feel free to PM me the information using the forums.

It's not a simple task, but not too complex either. You just have to manage a session, cookies, and send the correct headers.


-KingTomato
Re: Login Script #162065 04/11/06 09:50 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ahh, a reply! laugh, KingTomato, the problem with that is that I am sort of an admin on that forum, and, what I'm getting the information (sockets) from, it's something that a normal user can't look at without being an admin. is there any other way we can do this? I'll look at some way where I can make you an account, and, i'll see what I can do, I'll reply back in maybe a couple of days or less laugh

Last edited by Kurdish_Assass1n; 04/11/06 09:55 PM.

-Kurdish_Assass1n
Re: Login Script #162066 05/11/06 05:27 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Well, I made a user account myself. Feel free to delete it when you feel this has accomplished your goal as I will no longer be needing it. This will connect initially, log you in, then track your session information. Every visit to th epage, it will resend your information to keep you logged in.

You must change the portions marked in red, and can (but don't have to) change the two values under them. To login, use /xbc_login. Once logged in, it will automatically load the index for you (see the second sockclose event). To visit that page you wanted use /xbc_revisit /showpost.php?p=97496&postcount=1 and then the page will be retrieved and stored in index.html in the mirc directory, as well as in the &data binvar in the sockclose event. You can play with it from there (processing, parsing, etc).

If I've left anything out, or you need more help (as always) feel free to post on the forums and myself or another individual will assist you.

Code:
; -----------------------------------------------------------------------------
; http://forums.xbconnect.com
; --
; http://forums.mirc.com/showflat.php?Cat=0&Number=171884&page=&vc=1
; -----------------------------------------------------------------------------

[color:red]; Name of the user logging in[/color]
alias -l xbc_username { return BotForTesting }

[color:red]; Password for the user[/color]
alias -l xbc_password { return testingbot }

; Hash table to store information
alias -l xbc_table { return xbc_info }

; Hash file
alias -l xbc_hfile { return xbc.hsh }

; -----------------------------------------------------------------------------
; mIRC Events
; -----------------------------------------------------------------------------

on *:LOAD: {
  if ($version < 6.2) /echo -s Older version of mIRC Found--Not tested with $version (Recommends v6.2)

  if (!$hget($xbc_table)) /hmake $xbc_table 10
  if ($isfile($xbc_hfile)) /hload $xbc_table $xbc_hfile
}

on *:START: {
  if (!$hget($xbc_table)) /hmake $xbc_table 10
  if ($isfile($xbc_hfile)) /hload $xbc_table $xbc_hfile  
}

on *:EXIT: {
  if ($hget($xbc_table)) {
    /hsave -o $xbc_table $xbc_hfile
    /hfree $xbc_table
  }
}

on *:UNLOAD: {
  if ($hget($xbc_table)) /hfree $xbc_table
  if ($isFile($xbc_hfile)) .remove $xbc_hfile
}

; -----------------------------------------------------------------------------
; Initial Login
; -----------------------------------------------------------------------------

alias xbc_login {
  var %sock = xbc_login1

  if ($sock(%sock)) .sockclose %sock

  ; clear login session
  if ($hget($xbc_table)) {
    /hfree $xbc_table
    /hmake $xbc_table 10
  }

  .sockopen %sock forum.xbconnect.com 80
}

on *:SOCKOPEN:xbc_login1: {
  if ($sockerr) {
    /echo -s XBC Socket Error Could not connect (# $+ $sock($sockname).wserr $+ ) $sock($sockname).wsmsg
  }
  else {
    var %post = vb_login_username= $+ $xbc_username $+ $&
      & $+ cookieuser=1 $+ $&
      & $+ vb_login_password= $+ $xbc_password $+ $&
      & $+ do=login $+ $&
      & $+ vb_login_md5password= $+ $&
      & $+ vb_login_md5password_utf=

    /sockwrite -n $sockname POST /login.php?do=login HTTP/1.1
    /sockwrite -n $sockname Host: forum.xbconnect.com
    /sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; en-US) mIRC/ $+ $version
    /sockwrite -n $sockname Accept: text/html, text/xml, */*;q=0.5
    /sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
    /sockwrite -n $sockname Keep-Alive: 300
    /sockwrite -n $sockname Connection: keep-alive
    /sockwrite -n $sockname Referer: http://forum.xbconnect.com/
    /sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
    /sockwrite -n $sockname Content-Length: $len(%post)
    /sockwrite -n $sockname $crlf
    /sockwrite -tn $sockname %post
    /sockmark $sockname 1
  }
}

on *:SOCKREAD:xbc_login1: {
  var %read

  if ($sock($sockname).mark) {
    /sockread %read
    if (!%read) /sockmark $sockname
    else {
      if (Set-Cookie:* iswm %read) {
        var %cookie = $gettok($gettok(%read,2-,32),1,59)
        var %c_name = $gettok(%cookie,1,$asc(=)), %c_value = $gettok(%cookie,2-,$asc(=))
        /hadd -m $xbc_table %c_name %c_value
      }
    }
  }
  else {
    /sockread -n &read
    ; if you want to parse this or whatever, do so here. This is page content, not header information
  }
}

on *:SOCKCLOSE:xbc_login1: {
  /echo -s XBC Closed! Logging in to main page...

  /xbc_visit
}

; -----------------------------------------------------------------------------
; Revisit using sessions
; -----------------------------------------------------------------------------

; use as just play /xbc_visit to get the main index page, or include the path
; of the page (less the domaine itself) to visit that page. e.g.
;
; /xbc_visit
;   visits main page (index)
; /xbc_visit /showpost.php?p=97496&postcount=1
;   visits post number 97496 (notice the http://www... is gone, / must remain)
;
; http://forum.xbconnect.com/showpost.php?p=97496&postcount=1
; \_____ Domain Name ______/\________ File Path ____________/
alias xbc_visit {
  var %sock = xbc_login2

  if ($hget($xbc_table,xbcbbuserid) && $hget($xbc_table,xbcbbpassword)) {
    if ($sock(%sock)) .sockclose %sock

    .sockopen %sock forum.xbconnect.com 80
    if ($1-) { /sockmark %sock $1- }
    else { /sockmark %sock $+(/?s=,$hget($xbc_table,xbcbbsessionhash),&) }
  }
  else {
    /echo -s XBC Error: No session established
  }
}

alias xbc_cookies {
  var %i = $hget($xbc_table,0).item
  while (%i) {
    var %c_name = $hget($xbc_table,%i).item, %c_value = $hget($xbc_table,%c_name)
    var %cookies = %cookies $+(%c_name,=,%c_value,$iif(%i > 1,;))
    /dec %i
  }
  return %cookies
}

on *:SOCKOPEN:xbc_login2: {
  if ($sockerr) {
    /echo -s XBC Socket Error Could not connect (# $+ $sock($sockname).wserr $+ ) $sock($sockname).wsmsg
  }
  else {
    /sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
    /sockwrite -n $sockname Host: forum.xbconnect.com
    /sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; en-US) mIRC/ $+ $version
    /sockwrite -n $sockname Accept: text/html, text/xml, */*;q=0.5
    /sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
    /sockwrite -n $sockname Keep-Alive: 300
    /sockwrite -n $sockname Connection: keep-alive
    /sockwrite -n $sockname Referer: http://forum.xbconnect.com/
    /sockwrite -n $sockname Cookie: $xbc_cookies
    /sockwrite -n $sockname $crlf
    /sockmark $sockname 1
  }
  .remove index.html
}

on *:SOCKREAD:xbc_login2: {
  var %read

  if ($sock($sockname).mark) {
    /sockread %read
    if (!%read) /sockmark $sockname
  }
  else {
    /sockread &read
    /bwrite index.html -1 -1 &read
  }
}

on *:SOCKCLOSE:xbc_login2: {
  /echo -s XBC Closed! Main page gathered!

  /bread index.html 1 $file(index.html).size &data
  ;.remove index.html

  /echo -s XBC Page contents read in to & $+ data variable
}


-KingTomato
Re: Login Script #162067 18/11/06 10:05 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
wow KingTomato, Thanks a LOT, I certainly will try this when I get on later, and, hopefully i won't have any problems, but, if I do, I will once again post back :P, just saw this post now. lol


-Kurdish_Assass1n
Re: Login Script #162068 18/11/06 11:20 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, lol, I already have a problem :|, Here's what i'm trying to do, the word 'Injector' is on that one page, but, this isn't working for me, i don't think I put it in the right place, here's what I have:
Code:
on *:SOCKREAD:xbc_login2: {
  var %read

  if ($sock($sockname).mark) {
    /sockread %read
    if (!%read) /sockmark $sockname
  }
  else {
    /sockread &read
    /bwrite index.html -1 -1 &read
  }
  [color:red]if (*Injector* iswm %read) { echo -a INJECTOR Found! }[/color]
}

I replaced the red part with just echo -a %read, and, I got this, so, i doubt that I put it in the right place, would anyone tell me where to
put it?
Quote:

XBC Closed! Logging in to main page...
HTTP/1.1 200 OK
Connection: close
Date: Sat, 18 Nov 2006 23:19:34 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/4.4.3-dev
Content-Type: text/html; charset=ISO-8859-1
Cache-Control: private
Pragma: private
XBC Closed! Main page gathered!
XBC Page contents read in to &data variable


-Kurdish_Assass1n