Регистрация: 05.07.2010
Сообщений: 33
|
Запуск sqlmap кнопкой из firefox (Linux) и еще...
Запуск sqlmap кнопкой из firefox (Linux):
+ Код для атодоплнения по tab, команд sqlmap'a.
Идея в том, чтобы просто передать параметр в --url,
достаточно будет начать набирать url[TAB], отобразится --url="url переданный из браузера"
ставим расширение custom buttons:
https://addons.mozilla.org/En-us/firefox/addon/custom-buttons/
Код кнопки:
Код:
/*CODE*/
// forum.mozilla-russia.org/viewtopic.php?id=41987
var page = gBrowser.currentURI;
var browser = "/PATH/ff_run_sqlmap"; // Указываем путь
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(browser);
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.run(false, [page.spec], 1);
return true;
закидываем кнопку на панель.
код ff_run_sqlmap запуск tab.py, передача параметра:
Код:
#!/bin/bash
pSQL="python2 /PATH/sqlmap/tab.py" # указываем свой
lilyterm -H -e bash -c "$pSQL '$1'" # пользуюсь lilyterm, можно и xterm или подобные
Делаем его исполняемым.
SqlMap-автодополнение, хранение истории:
переходим в дирикторию с sqlmap
создаем tab.py с кодом :
Код:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import readline
import os
import sys
import atexit
CMD_SQLMAP = "python2 sqlmap.py"
HISTORY_SQLMAP = "./.hist"
HISTORY_LENGHT = 1000000
#
if os.path.exists(HISTORY_SQLMAP):
pass
else:
with open(HISTORY_SQLMAP, 'w') as hist:
hist.write("")
mnemonics = ['z "random-ag,current-db,current-user,is-dba,ban,tec=UE,dbms=" -v 3',
'z "random-ag,o,dbs"',
'z "random-ag,o" --search -C pass --exclude-sysdbs',
'z "random-ag,o" --sql-query="SELECT * FROM "'
]
values = [
"help",
"version",
'url="{0}"'.format(sys.argv[1]),
"data",
"param-del",
"cookie",
"cookie-del",
"load-cookies",
"drop-set",
"user-agent",
"random-agent",
"host",
"referer",
"headers",
"auth-type",
"auth-cred",
"auth-private",
"proxy",
"proxy-cred",
"proxy-file",
"ignore-proxy",
"tor",
"tor-port",
"tor-type",
"check-tor",
"delay",
"timeout",
"retries",
"randomize",
"safe-url",
"safe-freq",
"skip-urlencode",
"force-ssl",
"hpp",
"eval",
"predict-output",
"keep-alive",
"null-connection",
"threads",
"skip",
"dbms",
"dbms-cred",
"os",
"invalid-bignum",
"invalid-logical",
"no-cast",
"no-escape",
"prefix",
"suffix",
"tamper",
"level",
"risk",
"string",
"not-string",
"regexp",
"code",
"text-only",
"titles",
"technique",
"time-sec",
"union-cols",
"union-char",
"union-from",
"dns-domain",
"second-order",
"fingerprint",
"all",
"banner",
"current-user",
"current-db",
"hostname",
"is-dba",
"users",
"passwords",
"privileges",
"roles",
"dbs",
"tables",
"columns",
"schema",
"count",
"dump",
"dump-all",
"search",
"comments",
"exclude-sysdbs",
"start",
"stop",
"first",
"last",
"sql-query",
"sql-shell",
"sql-file",
"common-tables",
"common-columns",
"udf-inject",
"shared-lib",
"file-read",
"file-write",
"file-dest",
"os-cmd",
"os-shell",
"os-pwn",
"os-smbrelay",
"os-bof",
"priv-esc",
"msf-path",
"tmp-path",
"reg-read",
"reg-add",
"reg-del",
"reg-key",
"reg-value",
"reg-data",
"reg-type",
"batch",
"charset",
"crawl",
"csv-del",
"dump-format",
"eta",
"flush-session",
"forms",
"fresh-queries",
"hex",
"output-dir",
"parse-errors",
"pivot-column",
"save",
"scope",
"test-filter",
"update",
"alert",
"answers",
"beep",
"check-waf",
"cleanup",
"dependencies",
"disable-coloring",
"gpage",
"identify-waf",
"mobile",
"page-rank",
"purge-output",
"smart",
"wizard",
'get-tamper'
]
#
os.chdir(os.path.realpath(os.path.dirname(sys.argv[0])))
completions = {}
history_file = os.path.expanduser(HISTORY_SQLMAP)
readline.read_history_file(history_file)
#
def completer(text, state):
try:
matches = completions[text]
except KeyError:
if text.startswith('z'):
delim = "-"
values_ = mnemonics
else:
delim = "--"
values_ = values
matches = [delim+c for c in values_ if c.startswith(text)]
completions[text] = matches
try:
return matches[state]
except IndexError:
return None
#
def tamper():
tampers = filter(lambda x: x != "__init__.py" and x.endswith('.py'),
os.listdir('./tamper'))
print "\n".join(sorted(tampers))
#
print "\n Use -h for basic or -hh for advanced help.\n\n"
readline.set_completer(completer)
readline.set_completer_delims(' \t\n;')
readline.set_history_length(HISTORY_LENGHT)
readline.parse_and_bind('tab: menu-complete')
while 1:
try:
GET_CMD = raw_input('» ')
if "--get-tamper" in GET_CMD:
tamper()
continue
SQLMAP_SEND_CMD = "%s %s" % (CMD_SQLMAP, GET_CMD)
os.system(SQLMAP_SEND_CMD)
atexit.register(readline.write_history_file, history_file)
except KeyboardInterrupt:
print ""
except EOFError:
atexit.register(readline.write_history_file, history_file)
sys.exit("exit, ok :)")
Описание:
атодополнение для не "однобуквенных опций", их не лениво печатать
получить список tamper-скриптов:
начинаем набирать get{жмем TAB}, сработает автокомплит --get-tamper, жмем [Enter]
вставка шаблона:
вводим [z] жмем [TAB], перебираем нужные шаблоны для подставноки команды.
поиск по истории ctrl+r
Выход по ctrl+d
Последний раз редактировалось xCedz; 30.09.2013 в 07:57..
|