2

Is there any way to save half-dumped output in csv file or in table format in sqlmap?

Look below image for better understanding. The target is boolean-based blind injection vulnerable. For sure, this injection takes a long time for larger database to extract. But my concern is if current columns I am trying to dump contains lets say 10000 rows (data). I spend 2-3 hours and extracted 5000 rows using flag --dump. Now I don't want to extract further data and I am happy with the 5000 so, I pressed ctrl+C to stop the attack.

Now the problem is sqlmap will not save this 5000 extracted data in csv file because the attack was not finished or it was stopped in the middle. And the output in the terminal window is also not in table format where I can copy paste and save it in a txt file or anywhere.

Now I am stuck with this 5000 extracted data which is not even useful for me or sorting this data in table format might take me another 2-3 hours!

So what can I do save this half dumped data in table format?

Current Output Format

Current Output Format

I want output in this format or save in csv file. Any one option would be ok.

4
  • sed and awk can do it or a python script
    – schroeder
    Commented May 15 at 7:11
  • 1
    I googled your request and got this from the developer: github.com/sqlmapproject/sqlmap/issues/841 and github.com/sqlmapproject/sqlmap/issues/3199. So it looks like you will need to use something outside of sqlmap to format the data
    – schroeder
    Commented May 15 at 7:20
  • Yeah someone mentioned "can't write to a dump file before the last row is retrieved because of formatting and filtering." in that github comment. And this issue is raised in 2014 so I dont think that anyone has started working on the fix but still I have raised FR because I am not that expert to add feature like this by myself. Until then I will keep researching on the fix. Thanks!
    – Solo
    Commented May 15 at 8:15
  • 1
    It's been a recurring request for years. The core request is github.com/sqlmapproject/sqlmap/issues/516. I don't think a new request will change anything.
    – schroeder
    Commented May 15 at 8:20

1 Answer 1

2

sqlmap doesn't save or format the data until the last line has been retrieved.

There have been requests to be able to format stopped dumps over the years:

According to the developer, there is a request that is being tracked to implement incremental dumps and that is the core issue that all subsequent requests are getting mapped to. That was in 2013:

So, you need to use a script or some other tool to transform the structured output into the format you want. Such scripting is no longer a security concern.

Google search: "sqlmap format partial dump"

2
  • Got it. Thanks for the help! Appreciated.
    – Solo
    Commented May 15 at 15:00
  • The part where you mentioned about using script or some other tool, are you familiar to something that might work? I tried searching on internet but still not finding anything. Will search more but if you have anything then I would appreciate your help in that matter as well. Thanks!
    – Solo
    Commented May 15 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .