Sqlmap – HTTP POST Request File

After some reading of http://carnal0wnage.attackresearch.com/2011/03/sqlmap-with-post-requests.html and thinking about how I normally try to deal with post requests, thought I would jot down a few lines as a reminder.

Using a HTTP Request File. You can capture this of course using a proxy or firefox addon quite easily.

sqlmap.py -r filename.txt –level 1 –risk 1 –dbms mysql -p paramatertotest –proxy

** level and risk can be adjusted if SQLmap doesnt confirm there is an injection, but you believe there is. 5 and 3 are the max respectively.

sqlmap.py -r filename.txt — dbms mysql –proxy –current-db

**Obtain Database Name

sqlmap.py -r filename.txt — dbms mysql –proxy -D dbname –tables

**Obtain Table Names

sqlmap.py -r filename.txt — dbms mysql –proxy -D dbname -T tablename –columns

**Obtain Column Names

sqlmap.py -r filename.txt — dbms mysql –proxy -D dbname -T tablename -C col1,col2,col3 –dump

**Obtain Data from the columns specified

Might want to specifiy a particular technique:

–technique BEUS

** Subtract letters to remove type from test.

B: Boolean-based blind

E: Error-based

U: Union

S: Stacked queries

T: Time-based blind

Some other interesting details:

sqlmap.py -r filename.txt — dbms mysql –proxy –current-user

** Current DBMS username

sqlmap.py -r filename.txt — dbms mysql –proxy –current-is-dba

** Is the user a DBA?

sqlmap.py -r filename.txt — dbms mysql –proxy –file-read=Path

** Read a file from the path provided.

Full documentation: http://sqlmap.sourceforge.net/doc/README.pdf

Preventing SQL Injection: https://www.owasp.org/index.php/SQL_Injection


*Recent edit to update the -r flag. for raw request.

Posted in Security | Leave a comment

Ghost In The Wires – Kevin Mitnick – Book Review

It took me a while to finally get through Kevin Mitnick’s latest book – Ghost In The Wires. Though, this was not due to it not being a page turner. Fact is it was!

It took me what felt like so long, as I had been trying to squeeze in the reading time in between everything else. Every time I turn around there is something else to learn or look at elsewhere. Still, beats being bored so can’t complain!

If you had never heard anything about Kevin or other hackers of that time you might find this video useful for a little background

The book is very interesting from a few perspectives. There is the personal component and the security/technology component.

The personal component gives you an idea of the way Kevin had to live his life, the impact on his family and a sense of a world in which trust was at times very scarce. It is hard to imagine in some ways, especially around how tough it must have been inside for so long or the fear I would imagine at facing a very long time locked away.

I enjoyed gaining an insight into the thinking behind some of the attacks or techniques he used when gaining access to a variety of systems (the list is quite astounding) or when he was trying to avoid capture. Surprised often by what, when you read it seems like simplicity, you almost think that would never work, but it did!

For anyone who is not that technical, you won’t have to worry, the details are not to heavy and the book does a decent job I think of explaining anything that is even the slightest bit technical in way anyone one familiar with using computers and the Internet should be able to understand.

From a security perspective it should be an alarm bell to many at the very least. Social Engineering, is alive and kicking. It is also something that many don’t seem to have enough awareness of, still to this day.

Matters in fact often appear to be getting worse as everyone rushes to share all of their intimate personal details all over the place, almost like trusting every stranger is now a good idea.

When you think about the kind of information and access he had, many times by simply asking for it, in others situations by doing enough research on targets and gathering enough relevant information to be extremely convincing and exploiting that element that companies pride themselves on with their staff, helpfulness.

I cant help but wonder how would many local businesses fair today. Especially as I see them rush out to splatter everything they can online in an effort to boost their page ratings. Often I am guessing without a thought about the potential risks.

The book mentions a documentary that I really need to check out called Freedom Downtime

Perhaps another day.

Posted in Books | Leave a comment

Coliseumlab – Observations

Back in March I wrote a post about my beta testing of http://Coliseumlab.com Elearnsecurity’s latest project.

Well the labs are live and the first new students have arrived in the forums and are experiencing the fresh new design and interface, wow what a difference from the BETA.

I personally was eager to test the new lab simulations that had just been released, to date there are currently 14 live, with I believe more in the pipeline.

The designs are great and yet simple enough, you’re not overwhelmed as you are trying to learn more about the concepts/techniques of particular attacks. You would probably benefit from some prior exposure to tools like burp, dirbuster, sqlmap & firebug to really get the most of your time. Though the support through the forums will assist anyone who feels the need to ask for more information.

I don’t think I need to go into great detail about the actual attacks in this post, you can get those from the link above, instead I wanted to note a few points that I personally felt benefited my  own studies by using my time in the environment.

My observations of any gains I’ve made:

Well I first feel much more confident in using some tools. The more hands on practice you get with software tends to have that affect.

I’m much more serious about taking useful notes. Well worth the effort and something to maintain/improve on into the future.

Saving you time that could be easily wasted by searching the net. Searching the net or through books is not always a shortcut.

Sure it’s easy to search the net, it is also too often easy to get distracted with all the extra content being thrown your way.

Books? Well is that not too far away from your desk.

Spent some time looking at other aspects I was curious about, when given a learning plan for a lab, I like to think “what else I can learn from this?”

This was good; I ended up feeling compelled and motivated to write a ruby script that helps me on a particular Joomla information gathering task.  Thanks to Digitalwestie and Matugm for hints in the right directions, I know you guys are busy with your own stuff. So I do appreciate people who take time out to give a few pointers.

There may be other tools doing the same job, but being able to solve your own problem has its advantages and again keeps me away from the distraction of searching. I also happen to be reading about ruby at the moment, so a chance to get away from the usual puts “hello world” stuff and try to develop these skills somewhat was fantastic!

Trophies gathered.

Posted in Courses | Tagged , , , | Leave a comment

Social Engineering The Art of Human Hacking – Review

So I have just completed Chris Hadnagy’s book and now I am a social engineering master. Well perhaps a master of this art is an exaggeration on my part, but I certainly believe I have learned a great deal from reading what is in my view, an essential guide to the inner workings of social engineering, be it used for good or evil.

The book does not claim to turn anyone into a master. It does though give you a broad and deep understanding and will point you to many other areas of research if becoming a master is your end goal. Considering the years of research gone into various disciplines discussed and skills you would need to cover, I wish you happy researching if this is your end game. I certainly plan to return to many of the areas out of interest myself.

As the web has recently started to develop into the social monster we see today, its teachings I believe may become even more important to many of us in the years to come. It should certainly convince people that a good security awareness program must be adopted everywhere and continually tested/updated.

Just observing my students and others I know online; day to day and seeing the kind of information they share without a thought of the impact this may have for their own personal security, never mind the organisations they may work for, really makes me think it could become open season for crime, in many different ways.

Hopefully they are all lucky and don’t fall victims or perhaps they listen to my constant warnings to take more care.

Thinking back to my own perception of social engineering before I read the book, I had a good idea of what I considered relatively simple types of attack, unfortunately though many people still seem to fall for these sweeping attacks.

For many of us experienced web users we tend to spot these or our spam filters sweep them away so we don’t have to endure yet another delete button press. But what about a targeted attack? How many of us would fall victim then?

I imagine a very high proportion of people would. In fact given enough information about the target and the right set of circumstances we all could quite easily and if you think “no way, not I” then you are probably the most likely to fall for one.

The book outlines the lengths that individuals or groups resort to, in order to tailor an attack customised especially just for you.

Essentially gathering your information from just about any resource they can, coming into contact with you in person or others around you, reading your face, emotions and behaviours like a book and then using all of this minute detail to manipulate you into giving further information away or perhaps fully compromising your systems in a variety of different ways including sending malicious files, dropping off at your office CD/DVD or USB devices with more nasty stuff, convincing you to browse to nasty websites or stealing your systems from right under your nose!

In actual fact it could be quite scary reading for many.

The book also offers good advice in terms of what you can do about it all to what to look for in an auditor if you have already started to think how these attacks my affect your business and would like to test/improve your performance.

The book promotes something which I truly think is important “be aware, educated and prepared”

I have heard recently there is “no patch for human stupidity”, well there is no immediate fix but we can certainly receive constant updates: Through Education.

Posted in Books | Tagged , , , , | Leave a comment

Glasgow Based – Computer – Software Repair – Training Stow College

Recent developments I am working on include a brand new computer repair training course in Glasgow aimed at home and small business in the area of computer repair solutions.

The purpose to assist you with the ongoing issue of break/fix type repair costs that many face on a regular basis. Often as a result of a virus or known just as malware for example.

We’ve all had those problems. Even with software designed to fend off these issues.

In these tough economic times making every penny count is vital.

Can you afford to pay out for expensive technical support?

If not this is the one for you.

This course which is run over 6 sessions introduces exactly what you need to know in order to do your own repairs from:

Sourcing your parts and software, getting to grips with the tools and techniques you need to recover your systems and keep them running.

To then ending by discussing the ever growing risks of the security issues we all face as users of the modern internet.

A hands on approach keeping the technical jargon to a minimum so you gain the practical skills to complete your goal of getting the system working again like the first time you turned it on and hopefully armed with a better idea of how to protect yourself and keep your system the way you want it.

There are options for funding available. Feel free to contact Stow for more information.

More details

Next course running soon. So don’t delay to get your place.

Supported by materials available online.

You should be comfortable using your computer system prior to joining this course to get the most out of this training.

Posted in Courses | Tagged | 1 Comment

Elearnsecuity BETA Testing of new labs

Elearn Security Online Labs and Challenges BETA Review

I was lucky enough to be asked to join in with a small team of beta testers to experience firsthand the latest developments by Elearnsecurity. The new online labs that are dedicated sandboxed cloud based environment for each student, accessible from the main learning material interface/portal.

On the 29 March 2011 at 8PM GMT; I eagerly await access to get a look at the concepts and ideas that up to then had only read about in discussions and suggestions by Armando in the forums.

The whole process I should add came off the back of consultation with the existing student community, so good to see a provider listening to the demands of the customer.

Reading the text in the forums, I could tell that Armando was excited about this project as it would bring yet another perspective to the learning model on offer from Elearnsecurity and ultimately would enhance the learner’s experience.

My experience I would have to say lived up to anticipated hype!

Perhaps partly due to having another chance to log in with equal minded folks keen to get their hands on the latest information and experience they could.

I need to mention, matugm who pretty much pwnd it before we really got off and running, last time I seen him posting he was trying to get a shell!

4 hours flashed passed in a blink of an eye.

Roughly about 30 mins after the agreed meet up time; we were off and running. The only real reason for this late start in my mind was due to getting some testers initial technical issues resolved and giving us group instruction via text based chat. (A head ache I would imagine if you’re on the supporting side)

The test itself involved what appeared to be at the outset a simple enough challenge for anyone who has experience in this field or perhaps has recently studied a course like ecppt.

Though as we attacked the challenge set out in front of us, I started to realise how this setup could give me an advantage to expand my inner working knowledge of both SQLi and of the popular tool sqlmap.

Most of what I have read or the guides I have seen up to now focus in on GET method via URL vulnerable parameters. I struggled to see many discussions around other input channels or POST method choices while studying for ecppt.

This challenge was exactly what I wanted to see, exactly what I wanted to try out and lucky for me gave me a chance to yet again apply what I had learnt up to know. Having developed new skills you are keen to try to keep them sharp, in hacking as we know only really achievable if you have labs if you want to stay on the side of the good.

As well as the actual objective of retrieving information from a database and inserting data into a database, I found I was starting to think “you know what I am going to try this from different angles from the point of view of learning more about the use of Sqlmap, from a burp log, from config file and straight off the CLI”. Giving me a chance to work with the tool in the different ways I wanted, so I could feel I was making progress towards being comfortable with the options that up to now I had really only read from the manual.

I collected a whole bunch of data that I plan to look at from the tool and study/research a bit further to understand as much as I can from the SQL used and look to ways to refine  and focus my attacks.

All of this from a single login page, I could hardly believe it, now I was wishing I had more time and energy left in me to keep chatting and testing with some very experienced specialists in the field. Alas work beckoned in the morning and the lure of sleep forced me to concede, well at least to go to bed and leave my laptop cracking the hashes I had obtained from the dump (not actually an objective but fun none the less, there was talk of removing this as I don’t think it was intended but I suggest leave it in)

As far as other enhancements are concerned; my understanding is there is a plan to have more exercises with step by step walkthrough examples to get those needing extra assistance off the ground, which in turn will help them pass the cert/gain skills.

More challenges are to be released to keep the more experienced students coming back for more; this in turn should in my view build on what is already showing signs of growing as a community.

The challenges do come with hints, but I know from chat with Armando and the team that these hints will affect the participants scores and plans of giving away goodies for challenge winners will probably keep the hardcore away from these but still give others at least a good learning tool until they build up their skills and experience.

Details of the goodies and prices for access have yet to be disclosed.

In my humble view a good addition to give us who are interested in researching security the hands on approach that is needed to close in on a sector that needs more good guys/gals on side.

Lets face it so far the bad guys/gals appear to be winning.

Posted in Courses | 1 Comment

eCPPT – Review and Passed

I am pleased to be able to report I am now a proud holder of eCPPT.

From my own background and perspective the course and exam was a very enjoyable experience. I would recommend this to anyone interested in security and perhaps on a limited budget.

I had done CEH prior to this course and personally found CEH useful in giving me a good foundation to approach this course. My day-to-day working life is not at the moment centred on security.

From my initial contact with eLearn security, I was impressed by the way I was handled as a potential customer and supported in terms of believing that I could achieve.

I did ponder long and hard before I parted with my own hard-earned cash.

After making my decision to join the course, I initially did feel a bit unsure in what I had bought into, mainly due to my concerns that perhaps I could not do this on my own in a distance learning fashion.

My fears where quickly put to rest, once I seen responses to my questions and I had read every post in the forums to make sure I was not adding posts already answered and just creating a general nuisance of myself.

The responses I received gave me matters to think about and pointers as to where to head to next, which is useful when you’re learning; building on my understanding was a combination of taking in the good advice and information in the slides/videos and asking appropriate questions.

I never felt at any time that if I had tried on my own and had to request for more info that I would not be given some sort of support, be it from someone experienced on the course or Armando the creator himself.

I would also say that experience from network+ and CCNA came in useful, as did some of my previous studies in relation to web technology including HTML, CSS (limited PHP and SQL), a basic understanding of Linux is also helpful.

The challenge of the exam really does focus on expecting you to apply what you learn; I believe this to be an excellent approach. No exam cram sessions on this one I am afraid, if you’re really only looking for another CV filler.

I had good fun and I believe that Armando is building on its success and looking to provide new and interesting experiences for current and potential new students. I look forward to this and hope to continue on as a student/contributor as I learn and have more fun.

If like me you wondered if you had what it took to perform a manual web application penetration test, then this is the one for you!

Details of the course content can be found at http://www.elearnsecurity.com/

Posted in Courses | Tagged , | Leave a comment