In this post we’ll take a look at how to setup Apache, MySQL and PHP on Windows and Linux. This setup is mainly for a series of SQL injection labs that I’ll be posting in the upcoming days (you’ll find the link for the HTML/PHP below). For this reason, it will be a development setup not a secure one. 😉
Creating MySQL user, database and grant privileges
Download HTML/PHP pages and configure it properly
Since I’ll be doing a series of SQL injection posts, I figured it would make sense to create this post given that understanding the installation process, database users/permissions all contribute to the vulnerability.
What’s up guys? Got a sweet and short tutorial for you today!
Before we begin, I want to clarify this tutorial is for Windows 10. I’m pretty sure it should work for other Windows version as well. I will probably make a Linux version for it soon too, so watch out for it! If you’re interested in it for a different operating system, leave a comment below.
Also, if you just want the script and don’t care about the article, head all the way down to the end of the post where you will find a download for either the Python 2.7 version or Python 3 scripts. Please watch the video though, so you know the instructions to get the script working (its easy!).
Yesterday I was looking for a way to automatically change the background / wallpaper of both my monitors using a Python script (every X seconds).
Although I was able to find a few sources to change the background, it would change the background for both of my monitors at once.
I then ran into this stackoverflow post, where a user replied suggesting merging two images into one and then setting the background as a tiled image using Win32 API functions – thank you fine sir.
Well, luckily I had some previous experience with Win32 API and its functionality under Python and I also had some experience working with images in Python using Python Imaging Library (PIL).
I decided this could be a fun little challenge and set out to do it. 😉
We’ve put a lot of work in these past five parts and today is no exception, however, we’ll try to take it easy after that insanity in the last article.
Looking back I probably should’ve broken that last article in more parts. At the same time, I guess it serves to separate the kittens from the lions. 😀
Enough jokes for now, let’s keep moving…
Today we’ll be implementing the second part to the text-based user interface which is what I call the active client chat screen.
Of course this also requires us to first implement the logging system for all of our clients, along with notifications as well.
Besides that we’ll add a few more features to wrap it up.
Dive Into The Code
I’m gonna focus on the main blocks of code added this time, so right off the bat, let’s jump into the new ‘active client chat screen’ interface…
I hope you’re well because this video is about to bang you on the head!
Not in a bad way of course, we’re about to learn a lot of cool stuff; but, I must warn you, grab your drink in advance and strap in that chair. 🙂
In this episode, as promised, we’re going to merge both the server and client script into one and add a bunch of functionality as well.
Analysis Before Coding
Since there’s a lot of ground to cover, let’s take a deep breath first and think about some components before diving into the code.
In the last part, we concluded the server thread and I mentioned we would work on the client thread this time. Which we will. However, before that we must port over some functions from the client script into the server script.
For example, the connect back functionality from the client script will be ported over and improved upon to allow the user to either start a new connection or be used programmatically in the main server.
Only then we’ll be able to consider firing up those client threads…
Now about the main server: we’ll have to place it inside its own function. The main reason is so we can run it in the background as a thread. This will allow us to shut it down once we finish establishing a connection and quickly fire it up again to listen for the next client.
Finally we’ll implement the text-based user interface since all of our main components are now running in the background as daemons: the server threads, the client threads and the main server.
I think that’s enough context for now so let’s jump into some code!
Recent Comments