Friday 23 March 2012

My Best Nmap experience

My  best experience with Network Mapper.

Its actually based on a real incident that happened during winters, some three and half months ago.
First of all about Nmap: Its one of my favorite open source software. I use open source and free software only because I can't afford to pay for software. n If you think that blah blah non-free software is awesome, I request you to please buy one for me and send it. Then also, I would use it on a test machine (a machine which does not contain anything important to me) because I am not that good with Binary data not created on my machine from source files that I could feel it safe to use on my working machine. You see I don't want Boom! to happen. Enough Good Information. Lets come back to the story of my best experience with Nmap, the Network Mapper.
Nmap, well known as Network Mapper is a tool created initially by the Hacker (A good hacker, obviously Hackers are good) well known as Fyodor (I don't remember real name, I hope Fyodor too doesn't bother about that) in 1997 if I am not wrong. Now its developed across Internet by Fyodor himself and a bunch of  Good people, Hackers. Search Wikipedia or Nmap website for more information. Thats enough History. Lets come back to story.

So by that time, I've been using Nmap for a year or so and became fairly good with its usage, its scripting engine and other good things it comes bundled up with.
That day one of my friends and I argued over something (he still is my friend :) ). The argument was about a silly thing, lets say it was about developing a few pages of text (program code is also text, right!). Lets not go into what that was actually.
So his argument was, 'I can produce those pages of text faster and efficiently than any of our friends including you.' Now that is something I don't like. I mean `Dude, you might be better at doing that. I mean why brag about it and more importantly why are you kinda' insulting me.` I didn't say that but told him that it was no great thing to reproduce an already present efficient version of  that text. I mean 'Life is too short to waste reproducing something that already existed in a remarkable form.' But that A***ole was not ready to come down from that fscking level. So to pull him down, I challenged him that he couldn''t even beat me at this thing, leave our other friends. Its not that I find myself inferior than our friends, Just said that to throw him more down than I could have, if I too bragged about that [Not a good grammatical statement, but I don't care right now].
So I agreed to replicate that few page thing. After saying that, I realized that I would not be able to do that. Its like, You can't win at everything. Some losers are better at something which you don't even care. This was one of those cases.


But as I am really a proud person, Once said, I had to try my best. In this case, I was desperate to beat that dumb-ass. It was a Thursday when that argument happened. The challenge time was fixed. It was during following weekend. I had Thursday and Friday to prepare, if I really wanted. But I was almost sure that whatever I do, he would be able to beat me. He was fscking good at that particular thing. I don't appreciate him for that.


I came back to my place. I was looking into it whether I could do something about this. I knew I could not go for preparing hard for it as it was so worthless that I had not mentioned it clearly here too what it really was. But in a part of my brain, I was really willing to beat him at any cost this one time. Anyways, I started doing some other stuff.

I am responsible for managing a web server with a group of friends. The friend whom I was gonna' beat soon had a webserver of his own to take care about, It is not visible on Internet but its available on the LAN we are connected to. Lets call his webserver "blahblahxyz.com". I started nmap with a few scripts on and started mapping the machine blahblahxyz.com. What flags I used is not much important, but I could find that the guy was not a good network administrator.
Nmap showed a lot of details.
It identified all open ports and stufff. Few open ports were 80, 443, 3306 and few more.

The nmap with NSE located something interesting for me.

It said something like this: There are some interesting locations that you might like. The locations were /images, /mysql, /downloads, /wordpress, /uploads and some others which I don't remember. Who keeps mysql accessible and that too with the name mysql. Dumbass! I read the results and backed it up in a file for perusal. Started doing something else keeping in mind the contents of that file. And then Zen! Why does he has a wordpress web framework installed. There are no links to it on his website. Then, I figured out that he was gonna' integrate the wordpress to support blogging feature on his fscking website.

A million Dollar idea striked me! You need a few pages of text to produce, right!! Why reproduce it when you could use already existing one!
The idea was very simple:
What is Wordpress good for?- Blogging, right! What is a blog? - a webpage with text. How do you access a blog? - using http i.e. our favorite port 80. Where does wordpress store blogs? Is it files uploaded in some upload directory?- Nah, Its not.. Its in a cell of a table of some database. Right! There you got it. Its simple.

Access the web based mysql (phpmyadmin), store the text to be replicated on The challenge day in cell of some already existing blog entry. (Don't create your own entry for obvious reasons).
Simple enough, Right? Nah, Comeon, you are such a loser. How would You access the phpmyadmin. You have to authenticate yourself. You don't have passwords and stuff right? Yeah you are right.... I didn't have, Yet!!
Another hurdle, How to cross it!! Is it worth the effort... Am I going on right path (Not morally right path, It was not about morals, it was about winning). By right, I meant Feasible.
I was not gonna' use Hydra or Nmap itself or any other not suitable tools for this. That'd be illegal, perhaps. So I neither used Hydra nor Nmap nor anything else for doing anything of cracking and stuff.
The day ended. Next Day, the Friday, I went to that Guy with another common friend of ours, just like that. He was doing some php coding n stuff for some part of his website. I am sure, I was not dreaming. He was doing that only and we really visited him. And believe it or not, after some time he closed his scite session and started talking with us. It was friendly. He and the third guy went to the balcony of the floor leaving me just like that or for some reason, may be enquiring the third guy why he brought me along with him or something. He had left the Nautilus opened with the codebase directory, just like that. In a moment, as I knew he was a dumbass administrator, I looked for some file named config or some similar one, n there you go, I found one... What was there, both the username and password of database in a php file in plain text. I mean what the Fsck! Do you really own this server, still, dude? ( I hope this was not illegal or we could have some other description also, if it was)
In a moment I closed the file echoing the name and password in my mind!!! Bam! Done..
I went outside to them and that's it...... My evil job done!
I came back after some time. By evening I was sure about what I would do!!!
I started my machine, got connected to wireless spot. Started browsing website. N there I was, opening blahblahxyz.com/mysql with the name and password which I still felt in cache of my brain. JackPot, If you would say so! Right! The helloworld blog was accessible at blahblahxyz.com/wordpress/hello.html?page=1 (I am not sure about it, but lets say it was)
Opened the file which I was gonna' produce during the challenge. Wordpress stores the blogs in tables, as I mentioned. Wordpress provides a helloworld blog too when you setup the framework, it seems. One more blog with some content was there. Copied the contents, and stored in the first blog as html comment in it because it contained only helloworld text and nothing more.
The Day:
The Saturday morning, we happened to be at computer lab with friends. It was the time. Lets do it now. Although I type quite fast, but I knew I won't be able to beat the Dumbass at his thing. Chose the machines. Machines were already connected to Lan. We opened Editors in our machines. Here is what I did. Started Vim. In insert mode, started typing damn fast, some arbitrary text... with meaningful words unrelated to the text like dumb-ass too. In the meantime after sometime, when nobody was taking care about me, I typed this: <Esc> :!wget blahblahxyz.com/wordpress/hello.html.?page=1 and opened the html file and Bam, Html page returned with the comment ( the huge comment) I inserted. Removed the text outside the comments I injected. A few keys on Vim, Right!! Saved it and Done! The challenge was complete. I took care of time. It should be feasible by an average human.. Done!!


Moral: Don't Be Dumb-ass.. and Don't believe everything I write!
Disclaimer: I am not responsible for any gains or losses incurred to people using this description. Don't use it, its not what you think it is...

No comments:

Post a Comment