ad

Thursday, 18 June 2015

Complete Registration, Login, Password recovery and changing system

Useful scripts for everyday use!

This is a small bundle of script I've developed, it's made for small projects. It comes with complete registration, login, password recovery and password changing system. Just to lessen load on server I wrote some client validation too.

Using these scripts is quite straight forward. Just import the ‘website_name.sql’ database, change your database information in ‘connection.php’ file and you should good to go. Just make sure in 'php_form_validator.php' you change the details for email, like your website name, address, reply to email etc. Other than this there's nothing really to be concerned about. Any suggestions/commits are welcome.




















- Authentication/login system requires that there's people in registration table. It stores the client data in $_POST, then hashes the password, and using SQL query it tries matching it against data in the table. If data is matched it will log the user in and create session. No account will be able to login unless it has been confirmed.

- Registration system also uses SQL to store data in our registration table. It hashes the password when storing. Registration script also comes with email verification methods, and aswell as captcha.

- Password recovery system asks for and sends it link to check whether user who put the email is the true owner. When user clicks that link, it check if it matches with temporary password and username in recover_password table and then generates new password and stores in registration table.

- Password changing sytem is quite easy too. You have to be logged in, enter new password and hit the button!

Download

Git
https://github.com/phpdevsami/Registration-Login-Password-Recovery-and-Password-Changing-system

Friday, 5 June 2015

[Auto] Random Proxy, Referal and Useragent visitor

After the release of Proxy visitor 1.0 I've been getting quite a bit of requests from people to add random useragent and referal userbar. In this new script I've added both along with user friendly txt files where you post your agents, proxies and referals - just to make process easier.

To understand how referal works, check this post.
To understand how this script works, check this post.

Before I proceed. I'd like to mention I do not recommend this. It's so much better to attract visitor legitimate way - this script can easily be detected.

This script comes with 5 different files. There's index.php where I call function of my static class - code inside this file should be posted on your website's main page, or page you'd open to start the script. This is also where you'll be providing your website's name.

There's also time option in same file, default refresh time is 30 seconds.

include("proxy_visitor_class.php");
webDevTown::load_files("http://www.whatismyreferer.com/");

Next 3 files are pretty obvious, proxies.txt, useragents.txt and referals.txt. Provide proxies with post. One proxy on each line, not separated by comma.








As for referal and agent do the same.
Demo Agents




Alright so that's pretty much it, as you may not it uses traditional cURL extension.. written in OO so only method I suggest you run is load_files.. I've set others to private for a reason.

https://dl.dropboxusercontent.com/u/28490184/webdevtown/Proxy%20visitor%201.2.rar

Run PHP from command line. It's just like executing Javascript code from console!

Apparently learning Javascript through console seems like a pretty decent way to get basic stuff down, and goo new is, it can be done in for PHP too!

What you'll need:
- XAMPP Installer. It's just environment for windows where you can execute PHP scripts.
- Access to command line.

Alright, lets crack on! Install XAMPP form this link. When you're done. Open Command prompt and type in basic echo function that echos 5 + 1. Like this, "echo(10 + 1);". Without strings of course.

So! is it working!? Did it return 6? See.. well it's not working! but don't worry. I'm about to tell you how to make it work.

Alright! Step number 1.
Open My Computer.












Step number 2.
Right click anywhere - except on the drives and select Properties.

Step number 3.
On the left hand side, click on Advanced System Settings.














Step number 4.
You've now System properties window open. At the bottom click on Environment Variables..



















Step number 5.
In the System variables area, find Path or PATH and click on Edit.. if you cant find it, click on new..



















Step number 6.
In the Variable name field type "Path". And in the Variable value field type the path to the php.exe file. This file will be inside xampp folder, in php folder. So my path is C:\xampp\php. Click okay and close it.
environment variable










Now lets head back to CMD and try the same thing we tried in the beginning - however with a little change, we want to tell CMD we're about to throw in some PHP code. So it does like this. "php -r 'echo 5+1'". It will return 6! -r parameter allows us to write in PHP code.

To see what different commands are available type in "php -h".
Command line















As you can see you can easily run PHP through command prompt now!

Tuesday, 2 June 2015

Learn TCP/IP basics in 5 minutes!

First things first alright. Yes I mentioned two strange acronyms in my title, which you know nothing about! But you will, in 5 minutes starting from now you will know everything that you didn't! So lets get started, shall we eh!?

Okay, TCP stands for Transmission Control Protocol and IP for Internet Protocol. They're just protocols. WHAT! WHAT'S A PROTOCOL YOU ASK! Protocols are rules. They're used to communicate - in other words they let computers talk to each other.

And that's pretty much what TCP/IP is! Keep on reading to find out what exactly they're there for and how they work. I promise, you'll understand every single bit of it!

Did you know that TCP/IP have for different layers. There's a network interface layer, Internet layer, Transport layer and Application layer.

Here's cute picture I found on https://technet.microsoft.com

On the left hand side are 4 layers I mentioned above.

Now you gotta wonder, okay I see the layers but what's that on right hand side!? Not to be afraid my friend, they're also protocols, each layer of TCP/IP has its own set of protocols.

Some of the protocols that exists in Application layer are following: HTTP, Telnet, FTP, TFTP, SNMP, DNS, SMTP, X Windows, other application protocols. You can read more about HTTP here by the way, it's quite important to know to be honest.


Here's a quick example, lets say there's two different computers and computer A is transferring a file to computer B. What TCP will do is cut the file into small pieces. Note that it doesn't just cut it randomly it does it in a certain way so that when computer B receives it, it can paste the chunks and form a file again. Quick question: How does the computer know what computer to send data to? hm? Correct answer is, IP! Unique address. Every network has it like I mentioned above.

You should also know that these layers interact with each other, for example. Application layer includes application that uses Transport, so when this layer receives data it cuts data into small pieces using TCP.

What else should you know, well as a beginner that's pretty much  it! now we could continue talking about it all day long but as I promised in the title this tutorial wont take more than 5 minutes.

If you want to go more in depth have a read, here.

So what you know now:
- TCP/IP is a protocol - set of rules.
- It's used for computers to communicate with each other on internet.
- It consists of 4 different layers.
- Each layer has its own protocols.
- We learned about packets(chunks)
- We now know what identifies our computer on internet, IP address.
- Layers interact with each other.

I hope you now have abetter understanding of TCP/IP, if you couldn't understand something, leave a comment.

Friday, 22 May 2015

Mini web based chatting application in PHP - NO database required!

I've been getting couple of requests about a chat application that doesn't require database to work.

Here it is, you may ask what're the requirements and setup to make it work? Well.. None! All you do is upload the file to your server and you're good to go!

So what this script offers; it allows you to chat, that's pretty much it's for sake of simplicity, there's no nickname option, your messages are anonymous unless you decide to tell who you are in chat. This script will delete old messages, for example as soon as there's 25 messages in the file, it will erase em all! No login, not registration nothing, it's as simple as it gets!

Although I must admit it's not the most secure way, but it's what it is, if you're looking for more secure system, try the chatting system in my samforum script. It's a free forum made from scratch in PHP.

Couple screenies?


Files

https://dl.dropboxusercontent.com/u/28490184/webdevtown/mini%20chat%20application%20no%20database%20needed.rar

Share if you like!

Thursday, 21 May 2015

How to spoof referrals tutorial

In this quick tutorial I'll be showing you guys how referral spoofing works and then ultimately give you an example of it in action.

First lemme tell you guys what spoofing is, spoofing it something, that masquerades/changes itself to something else. Or in lay mans terms.. lets say you gotta be 18+ to go to club but cant enter since you're just 17.. your friend has an idea that he can make you look 18+, so what he does is he puts some weird makeup on your face and voila! you're looking just like 18+ dude! It's spoofing! you've made yourself look like something that you're not.

Before we go further, I recommend reading this tutorial. HTTP the very basics

Alright! now lets get some practical example, there's couple types of spoofing, here's some of them. In this particular tutorial we'll be talking about referral spoofing. But before that those who just popped on this tutorial lemme explain what referral is.. and yeah if you read my HTTP the very basics it's gonna be easy as a pie!

You know whenever you open a page, there's data that's send to server, server's basically requesting some data, for example, website address, IP address.. and referral address! referral address is the previous website link, for example, if you've come to this site(www.webdevtown.com) form some forum, site will save that forum's address.

Here's example of couple request headers
Accept: Content-Types that are acceptable for the response.

Host: The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The port number may be omitted if the port is the standard port for the service requested.

Referer: This is the address of the previous web page from which a link to the currently requested page was followed. (The word “referrer” has been misspelled in the RFC as well as in most implementations to the point that it has become standard usage and is considered correct terminology)

User agent The user agent string of the user agent

Full list can be found here

So lets continue and.. and get to actual example. For this what you'll need is a server with PHP installed. What we're going to do is, save HTTP referral in a text file. So we know where the hits are coming from.
Here's the code for that.
    //error_reporting(0);
    $referer = $_SERVER["HTTP_REFERER"] . PHP_EOL;
    $opened_file = fopen("referers.txt", "ab");
    if(isset($referer)){
        echo "referer is set";
        fwrite($opened_file, $referer);
        fclose($opened_file);
    }else{
        echo "you aint being referer from any site";
    }
   
    echo $referer;


</br> <a href="index.php"> Click me! </a>


Post this on your webpage, make sure it's .php file. We're also going to download a plugin for firefox so we can send fake referrals! here's the plugin.

Alright, so you've the plugin and the file's been uploaded, lets open the site for first time. Loaded? Now open the referels file it's created on your server.. It shouldn't have anything in, since there was no referral.. now lets open our refcontrol plugin, choose custom and enter in custom referel URL.
spoof, fake referel










Press okay, then okay again and load the page. As expected page will load normally, however! it will show youtube as a referral! Magic!? and if you open referel file it should show www.youtube.com!

You've basically spoofed the referral. Now to make the process automatic, here's what you'll need to do, use cURL extension(little tutorial here) and send random referrals every time page refreshes!  You can even use proxy along with random referral! Here's auto proxy changing script.

Please share if you liked this tutorial!

Monday, 18 May 2015

Force visitors to go through adf.ly link!

Well this little idea come to my mind recently where anyone who visits your website will have to go through adf.ly link to get access to it. It will create a session, to check if user has already visited the site.. if user closes the browser it will make the user go through link again!

How it works.
- Someone goes to your website
- Script will check if they've already clicked on adf.ly link and finished the AD. NOTE: If web browser is closed, script will forget everything and make user go through adf.ly again.

How to use this script.
I've two files, index.php and callback.php, index.php contains the code you should post in your website's main page. Just copy paste the code. Don't forget the PHP tags though. I've also got callback.php file there's not much you need to know about it, if you're a developer have a look.

What changes you need to make for this script to work.
All you need to do is, where it says $adf_link change it to your adf.ly link. And in callback.php file where it says $secret_key change it to whatever key you wish.

For this script to work you need to shrink adf.ly link in a certain way, here's what needs to be shinked.
www.websitename.com/callback.php?secret_ley=your_secret_key Just shrink it!

Once shrinked, just do whatever I said above about replacing the link and key.. and you're done!

Download:
https://dl.dropboxusercontent.com/u/28490184/webdevtown/Adf%20force%20visit.rar

How it works.
- Someone goes to your website
- Script will check if they've already made clicked on adf.ly link and finished the ad. NOTE: If web browser is closed, script will forget everything and make user go through adf.ly again.

How to use this script.
I've two files, index.php and callback.php, index.php contains the code you should post on your website's main page. Just copy paste the code. I've also got callback.php file there's not much you need to know about it, if you're a developer have a look.

What changes you need to make for this script to work.
All you need to do is, where it says adf_link change it to your adf.ly link. And in callback.php file where it says secret_key change it to whatever key you wish.

For this script to work you need to shink adf.ly link in a certain way, here's what needs to be shinked.
www.websitename.com/callback.php?secret_ley=your secret key

Once shrinked, just do whatever I said above about replacing the link and key.. and you're done!
Well this little idea come to my mind recently where anyone who visits your website will have to go through adf.ly link to get access to it. It will create a session, if user closes the browser it will make the user go through link again!

How it works.
- Someone goes to your website
- Script will check if they've already made clicked on adf.ly link and finished the ad. NOTE: If web browser is closed, script will forget everything and make user go through adf.ly again.

How to use this script.
I've two files, index.php and callback.php, index.php contains the code you should post on your website's main page. Just copy paste the code. I've also got callback.php file there's not much you need to know about it, if you're a developer have a look.

What changes you need to make for this script to work.
All you need to do is, where it says adf_link change it to your adf.ly link. And in callback.php file where it says secret_key change it to whatever key you wish.

For this script to work you need to shink adf.ly link in a certain way, here's what needs to be shinked.
www.websitename.com/callback.php?secret_ley=your secret key

Once shrinked, just do whatever I said above about replacing the link and key.. and you're done!
Well this little idea come to my mind recently where anyone who visits your website will have to go through adf.ly link to get access to it. It will create a session, if user closes the browser it will make the user go through link again!

How it works.
- Someone goes to your website
- Script will check if they've already made clicked on adf.ly link and finished the ad. NOTE: If web browser is closed, script will forget everything and make user go through adf.ly again.

How to use this script.
I've two files, index.php and callback.php, index.php contains the code you should post on your website's main page. Just copy paste the code. I've also got callback.php file there's not much you need to know about it, if you're a developer have a look.

What changes you need to make for this script to work.
All you need to do is, where it says adf_link change it to your adf.ly link. And in callback.php file where it says secret_key change it to whatever key you wish.

For this script to work you need to shink adf.ly link in a certain way, here's what needs to be shinked.
www.websitename.com/callback.php?secret_ley=your secret key

Once shrinked, just do whatever I said above about replacing the link and key.. and you're done!
Well this little idea come to my mind recently where anyone who visits your website will have to go through adf.ly link to get access to it. It will create a session, if user closes the browser it will make the user go through link again!

How it works.
- Someone goes to your website
- Script will check if they've already made clicked on adf.ly link and finished the ad. NOTE: If web browser is closed, script will forget everything and make user go through adf.ly again.

How to use this script.
I've two files, index.php and callback.php, index.php contains the code you should post on your website's main page. Just copy paste the code. I've also got callback.php file there's not much you need to know about it, if you're a developer have a look.

What changes you need to make for this script to work.
All you need to do is, where it says adf_link change it to your adf.ly link. And in callback.php file where it says secret_key change it to whatever key you wish.

For this script to work you need to shink adf.ly link in a certain way, here's what needs to be shinked.
www.websitename.com/callback.php?secret_ley=your secret key

Once shrinked, just do whatever I said above about replacing the link and key.. and you're done!