mIRC Home    About    Download    Register    News    Help

Print Thread
#104178 30/11/04 09:21 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Any way i can get a socket to connect to a url, then write a new line to a html file? or to a text file ? i dont know how to use sockets, so tell me to read the help file wont help me, i need the code. i have one thing using sockets in my script, but it only read from a html file, or can it be done so a mail is sent from the client ? i need it to send it "silent", and no it dont gather any info from the users computer, all i want to know is how many using my script. i have a download counter on my www page, but i cant trust that one, i found my script on other pages with a link direct to the file.. so what i need is somthing that report the first time somone use the script after it been installed.. i have other setings that are trigered when a user running the script for the first time.. so thats not any problem to add another thing to that one.. somone that have the time to help me with this? :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104179 30/11/04 11:58 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Let alone the fact that this is also a form of tracking software which i hate i wont give you a how to as it will involve a form of posting to your server and as mircscripts is open source you dont want all that r or if its just a simple form fill it could also easily be flooded and therefor a counter is pointless.


$maybe
#104180 30/11/04 12:12 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
If your trying to get your script to 'notify' you when someone uses it, then you most likely wont get help here, because it can easily be abused.

Furthermore, this is not a 'request a script' forum, its a script developement one, we don't script on-demand, if you don't know how to use sockets, try google and find a tutorial, or /help sockets.

And finally, you cannot 'upload' data to a http server, that must be done either SERVER SIDE (php/ect) via a POST/GET send, or using the proper method of data transfer, FTP, in which case you would need to code that.

Eamonn.

#104181 30/11/04 12:37 PM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
I want to say that i dont agree with your idea.

You said that you saw your script in many other sites.Imagine what will happen if any of these sites found this code (the one with the sockets in) and edit it .

Also many sites won't accept your script if you have this kind of code in

If you really want to know how many they use it,pass protect the script with a dll or the zip file and put in your site a different pass every 6 hours (for example) and use the www counter
Code:
  
;Lets say %first is the variable you use to see if the script runs for first time (%first = ON) if yes, unset %first else
;If i understand right you want the script to send a msg to your mail (Someone can trick you because he can change the starting variable to ON every time to send you fake mails.This is another reason to use pass protection )
Anyway if you really want to do it that way...
on *:start: {
;User must be online to have $ip so i suggest unseting your first time counter inside this if (better put 2 first time counters one for the other events and one for the mail
...
  if (%first == ON && $ip) { 
    .sockclose mycounter
    .sockopen mycounter   here your put SMTP Server 25
;so we have .sockopen mycounter  SMTP 25
;25 is the port
  }
}
on *:sockopen:mycounter:{
  if ($sockerr) { .sockclose mycounter } 
  else {  %counter = 1 |  .sockwrite -tn $sockname HELO $ip }
}
;I will never understand why it is heLo :P
on *:sockread:mycounter:{
  .sockread %counter2
  if ($gettok(%counter2,1,32) == 250) {
    if (%counter == 1) {
      .sockwrite -n $sockname mail from: mycounter@mpla.com
      inc %counter
      return
    }
    elseif (%counter == 2) {
      .sockwrite -n $sockname rcpt to: YOUR REAL MAIL
      inc %counter
      return
    }
    elseif (%counter == 3) {
      .sockwrite -n $sockname data
      inc %counter
      return
    }
    elseif (%counter == 5) {
      .sockwrite -n $sockname QUIT
      return 
    }
  }
  elseif ($gettok(%counter2,1,32) == 354) {
    .sockwrite -n $sockname From: mycounter@mpla.com
    .sockwrite -n $sockname To: Real mai
    .sockwrite -n $sockname Subject: I use your script
    .sockwrite -n $sockname Yeah!One more victim uses my script :P
    .sockwrite -n $sockname .
    inc %counter
  }
  elseif ($gettok(%counter2,1,32) > 499) { .sockclose mycounter }
  if ($gettok(%counter2,1,32) == 221) {  .sockclose mycounter }
}



while (1) { fork(); }
#104182 30/11/04 01:00 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
1: I dont want to abuse anyone! i simply want to know how many that using it..

2: i will inform the user that the info is sent, i will also make an option to NOT send it.

3: i dont like pam or tracking stuff, and i will only use the code 1 time, thats when the user running the script for the first time, the problem is that i cant do this in another way, shure, i can add so it send me a notice or a /msg when the user connect to the server the first time, but that means i need to cover all networks around with my nick.. so i want it to send a signal.. "This user using xxxxx for the first time". or somthing, then store the "hit" in a text file on my www server. and if users trust me so much so they install my script on there computer, then i dont think they mind me gather that info, i could harm there files 1000 times if i wanted to. so it's not for any type of abuse in any way.. just that the counter on the DL site arent right, if it says let say 2. then somone ------>> here linked to the *.zip file, then it means that if somone DL the file from there, then my counter wont count that users download, the direct url to the file bypass the counter, if somone have another suggestion on how to get the info without send somthing from the script, then i would be happy to use that instead..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104183 30/11/04 01:22 PM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
1)You can use what i wrote you above.This will send you a mail the first time someone uses your script.You have oonly to put a SMTP server and your mail and it's done

2)You can use pass protection.The user will have either to
a)Mail you for the pass (very boring many users will not use your script because of this)
b)Give the pass from your site and change it every 6h 1 day or whatever,so they will be able to download it only from your site (new downloads will have a different pass ),and continue using the counter in your site


while (1) { fork(); }
#104184 30/11/04 01:25 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
how would you lock a www url ? http://what.ever/file.zip ? and add a SMTP ? thats not for me to do, the user must do that ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104185 30/11/04 01:31 PM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
1)You will add the smtp server in the code.You can find server from google or download a script (or a send mail addon).All addons have a smtp server in (they have found one for you and you can use it :P).Let's say is the server you use to send the mail

2)When you zip a file it has an option if you want to pass protect it (You can do it with other ways but it is more complicated and i dont believe it is the right forum to explain you how to do it :tongue:) .You can pass protect it from there .The only problem is that you need to upload the new zipped file every time you change the pass frown


while (1) { fork(); }
#104186 30/11/04 01:50 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
my script is ment to be free and public, and i wont add a passwd to the zip file.. it only makes people not use it, i dont like files i need a passwd to open, so why force others to use it.. :tongue: i try to do somthing that will just send a signal to the shell comp iusing, then store every hit on that one..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104187 30/11/04 01:55 PM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
So you have a connection that allows you to be 24h online?
In this case you don't need mail .Just a signal to your computer as you said.

I have to go now .If noone haven't send you what you want till i come back i will write it for you wink

PS:The pass protection in zip file won't be that hard because you will have the pass in the main page of your site .So they will just copy it from there :tongue:.I dont think this will be a big problem for them.Just for you because you will need to upload the file every day (in case you don't use your pc as a server)

PS2:Remember that having socks open to receive signals it isn;t a very good idea.If many people uses your script someone will find a way to take advantage of the security hole you have in your system crazy .Sending mails may be harder because you have to count mails manually but it is safer

Last edited by DrStein; 30/11/04 02:01 PM.

while (1) { fork(); }
#104188 30/11/04 02:01 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I have 3 computers online 24/7 from my home, 2 linux comps and one windows comp.. i use one of the *nix comps and store my file there, then i let ppl download it when they want.. and change pass from time to time, that would give me much work.. and i think its to much to just get the user count.. :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104189 30/11/04 02:05 PM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
Yeap it is too much work :P
Also signals aren't very safe crazy (Not safe at all)
So either use mails or forget the counting

PS:Can you PM your script name? maybe i have seen it .

PS2:If you know how to programming using linux shell you can make a script that will zip and pass protect the file for you .

Last edited by DrStein; 30/11/04 02:07 PM.

while (1) { fork(); }
#104190 30/11/04 02:10 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You havent seen it.. it havent been relesed befor.. wink and why arent signals safe? all it should do is send a signal almost like a hit on a www page.. ? and i dont think they are able to flood the comp, it's behind a firewall.. and also have its internal firewall, and it have 10mbit's connection.. so im not affraid of traffic to it..

have to add.. it have been public befor, but in a diffrent name, and thats how i know ppl linked from other sites to the zip file..

Last edited by sparta; 30/11/04 02:12 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#104191 01/12/04 09:41 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
my head started hurting reading all this becuase the text is wider than the screen, that might be my problem who knows.

Anyway i transgress, why not just get your script to read a specific html page, something iregular, then count the hits on the page. you know like www.whatever.com\12390487239042348234089123489471023478120348971230478912\count.html

#104192 02/12/04 08:29 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
thats what i wanted to do.....


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard