Sign in to follow this  
Followers 0
ConsultingJoe

IP logging with AU3 and PHP

6 posts in this topic

Ok, First off, this is the start to my new CommandMe script that I will post in a new topic when I get more done on it. Anyways this might be very good to use for any script.

EXAMPLE:

View Log: http://zerocool60544.t35.com/logging/commandlog.html

Clear Log: http://zerocool60544.t35.com/logging/sendc....php?clearlog=1

Add Log: THE LINK FOR ADD LOG Same as entering:

http://zerocool60544.t35.com/logging/sendcommand.php?id=<TR><TD>877</TD><TD>13:55:49 - 18/02/2006</TD><TD>war_driver</TD><TD>WARDRIVER</TD><TD>172.136.240.103</TD></TR>

What you need to do:

  • Upload the PHP script to a free webserver that supports PHP hosting, I use www.t35.com
  • change the info in the au3 to point to your php where ever it may be
  • Then just run the script and check the log file (commandlog.html)
you can add items or them out but you need to know html tags for tables

<TR> = Starts a row

</TR> = Ends a row

<TD> = Starts a column

</TD> = Ends a column

If you are running the php and script for the first time you need to use the clearlog command first to format the table

The PHP script basicly forwards the text that it recieves to a html file.

The command:

username.t35.com/sendcommand.php?clearlog=1

this will clear the html and write the heading of the table

The command: username.t35.com/sendcommand.php?<TR><TD>THEDATE</TD><TD>127.0.0.1</TD></TR>

this would write the "THEDATE" in the first column and "127.0.0.1" to the second column

But don't use this look at the au3 script for how the table is setup

-----PHP SCRIPT Name: sendcommand.php

CODE
<?php

if($_GET["clearlog"]==1){

$fp = fopen("commandlog.html", "w");

fwrite($fp, "<TABLE BORDER='4' CELLPADDING='2' CELLSPACING='2' WIDTH='100%'>");

fwrite($fp, "<TR>");

fwrite($fp, "<TD><center><B><H4>ID</B></H4></center></TD>");

fwrite($fp, "<TD><center><B><H4>TIME AND DATE</B></H4></center></TD>");

fwrite($fp, "<TD><center><B><H4>USER NAME</B></H4></center></TD>");

fwrite($fp, "<TD><center><B><H4>COMPUTER NAME</B></H4><c/enter></TD>");

fwrite($fp, "<TD><center><B><H4>PUBLIC IP</B></H4></center></TD>");

fwrite($fp, "</TR>");

fclose($fp);

}

$fp = fopen("commandlog.html", "a");

fwrite($fp, "\n".$_GET['id']);

fclose($fp);

php?>

-----AU3 SCRIPT

CODE
#include <INet.au3>

$ip = _GetIP()

$id = Random ( 1 , 1000 ,1)

$server = "zerocool60544.t35.com/logging/sendcommand.php?"

TrayTip("ID NUMBER:", $id, 0)

SendId()

sleep (3000)

;While 1

;if getid() = $id Then

;endif

;Wend

func compiledate()

$timedate = @HOUR & ":" & @MIN & ":" & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR

return $timedate

endfunc

func SendId()

$data = "<TR>" & "<TD>" & $id & "</TD>" & "<TD>" & compiledate() & "</TD>" & "<TD>" & @UserName & "</TD>" & "<TD>" & @ComputerName & "</TD>" & "<TD>" & $ip & "</TD>" & "</TR>"

$sendid =_INetGetSource($server & "id=" & $data)

endfunc


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites



So whats the point of this, is it to get the WAN (PUBLIC IP) address?

I don't know the reason why i should use this code, cus i dont know what to use it for. Please give an example on how i could use this.

Thank You :o

Share this post


Link to post
Share on other sites

So whats the point of this, is it to get the WAN (PUBLIC IP) address?

I don't know the reason why i should use this code, cus i dont know what to use it for. Please give an example on how i could use this.

Thank You :o

Ok say you have a chat program or any program that uses tcp. you might want to know when someone runs the program. when the program runs it sends all the computers stats to a log file that you can view anytime.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I did something similiar to this just recently. I made a script that required people to login to run it. When they entered in the username and password, it would use INetGetSource of a php file I hosted on my webserver. The php script would read the username and password from the url (www.site.com/login.php?login=[x]&password=[y]), then it qould query a mysql database, and either return a success or a failure in the source. The script would just pull the success or failure from the original INetGetSource using a StringInStr() command. The php script also pulled the IP and wrote it to the mysql database in a field next to the username. This way I could log all the IP's used to access each account.

Edited by Knight

Share this post


Link to post
Share on other sites

I did something similiar to this just recently. I made a script that required people to login to run it. When they entered in the username and password, it would use INetGetSource of a php file I hosted on my webserver. The php script would read the username and password from the url (www.site.com/login.php?login=[x]&password=[y]), then it qould query a mysql database, and either return a success or a failure in the source. The script would just pull the success or failure from the original INetGetSource using a StringInStr() command. The php script also pulled the IP and wrote it to the mysql database in a field next to the username. This way I could log all the IP's used to access each account.

wow that sounds cool would you mind sharing the php/au3.

I know very little about mysql, for some reason my phps worked a little bit when it came to working with mysql

thank you


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0