Skip to content

Commit

Permalink
add copy/paste in EXECUTION
Browse files Browse the repository at this point in the history
  • Loading branch information
needle-wang committed Dec 31, 2020
1 parent 465f9df commit ee7d9f7
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 77 deletions.
52 changes: 23 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
## sqlmap-gtk
## sqlmap-gtk-zh
sqlmap GUI, using PyGObject(gtk+3)

此GUI只能在linux下运行, 已在kali, debian系中测试通过.
如果想在win下使用, 可以使用[sqlmap-wx](https://github.com/needle-wang/sqlmap-wx)(维护慢, 还有很大的改善空间).
欢迎使用, 反馈!

sqlmap已经移植到了python3!
来自sqlmap's FAQ:
"Both Python 2 and 3 are supported from May of 2019"
此GUI只能在linux下运行, 已在Mint 20, kali 2020.4 中通过测试.
win下可以使用[sqlmap-wx](https://github.com/needle-wang/sqlmap-wx)(维护慢, 还有很大的改善空间).
sqlmap已经移植到了python3.
请不要再使用python2.

#### 截图
![screenshot](https://github.com/needle-wang/sqlmap-gtk/blob/master/screenshots/sqlmap-ui1.png)

#### 为什么需要GUI?
选项太多了, 没有GUI, 总会忘了选项, 含义及使用.
于是不时地: sqlmap -hh和sqlmap wiki和google. 翻找半天, 阅读又要琢磨半天.
我学使用sqlmap断续好些年了, 存了看了好些资料, 等过段时间, 又模糊了, 没用.
光一个中文手册就看了好多遍, 总感觉缺点什么, 后来想明白了, 缺少视觉上的位置记忆.
滚动+链接跳转的文献, 缺少纸张的阅读痕迹, 也就是位置记忆.
当然, 还有个使用时长的原因.

另外, 光会选项也没有用, wiki上的介绍过于零碎, 选项背后的技术细节很多,
工具描述不够详细, 很多选项有前提要求, 这就要求使用者要有相应的知识储备了
可记性就是不好, 怎么办? 边用边学? 过段时间又忘了, 毕竟只在特定场景才有效.
计算机是个大类, 要记的东西太多了.
选项太多, 容易忘记选项, 含义及使用.
需要经常: sqlmap -hh, sqlmap wiki和google.
视觉上的位置记忆: 滚动+链接跳转的文献, 缺少纸张的阅读痕迹, 也就是位置记忆.

光会选项也没用, wiki上的介绍过于零碎, 选项背后的技术细节很多,
工具描述不够详细, 很多选项有前提要求, 只在特定场景才有效.

这里, 我将选项进行了分类, wiki集成进了GUI, 增加了使用前提, 使用时会有提示,
也许会方便些吧. 熟练后可以注释掉tooltip.
也许会方便些. 熟练后可以自行注释掉tooltip.

#### 安装与使用
1. **要求**
- python3.6+, GTK+3.20
- pygobject: `pip3 install PyGObject` or `apt-get install python3-gi`
- python3.6+, GTK+3.20以上(linux下已自带)
- pygobject: (二选一)
- `apt-get install python3-gi`(推荐)
- `pip3 install PyGObject`
- requests: `pip3 install requests`
- 最新的[sqlmap](https://github.com/sqlmapproject/sqlmap): `git clone` it.
2. **下载本GUI**
Expand All @@ -47,12 +41,12 @@ sqlmap已经移植到了python3!
- 会话功能, 自动保存和载入上一次的选项

#### 关于
- V0.3.4.2
2019年10月10日 08:06:05
作者: needle wang
- 使用PyGObject(Gtk+3 + python3-gi)重写sqm.py
- 感谢[sqm](https://github.com/kxcode/gui-for-sqlmap)带来的灵感, 其作者: [KINGX](https://github.com/kxcode) (sqm UI 使用的是python2 + tkinter)
- V0.3.4.3
2021年01月01日 02:18:45
- 使用PyGObject(python3-gi + Gtk+3)重写sqm.py
- 感谢[sqm]<https://github.com/kxcode/gui-for-sqlmap>带来的灵感,
其作者: [KINGX](https://github.com/kxcode)(sqm UI 使用的是python2 + tkinter)

#### 参考文献
- Python GTK+3教程: https://python-gtk-3-tutorial.readthedocs.io/en/latest/
- PyGObject API: https://lazka.github.io/pgi-docs/Gtk-3.0/
- Python GTK+3教程: <https://python-gtk-3-tutorial.readthedocs.io/en/latest/>
- PyGObject API: <https://lazka.github.io/pgi-docs/Gtk-3.0/>
3 changes: 1 addition & 2 deletions handlers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# encoding: utf-8
#
# 2018年 08月 29日 星期三 15:34:10 CST

Expand Down Expand Up @@ -41,7 +40,7 @@ def build_all(self, button):

def run_cmdline(self, button):
'''
only for posix, won't code it for win now.
only for posix, won't work for win now.
'''
sqlmap_path = self.get_sqlmap_path()
_target = self._get_target()
Expand Down
5 changes: 3 additions & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __init__(self):
self._page1_general_har_ckbtn = cb('转存至HAR文件')
self._page1_general_har_entry = FileEntry()
self._page1_general_har_chooser = btn.new_with_label('打开')
self._page1_general_flush_session_ckbtn = cb('清空目标的会话文件')
self._page1_general_flush_session_ckbtn = cb('<b>清空目标的会话文件</b>')
self._page1_general_dump_format_ckbtn = cb('dump结果的文件格式')
self._page1_general_dump_format_entry = et(width_chars = 6)
self._page1_general_csv_del_ckbtn = cb('(csv文件的)分隔符')
Expand All @@ -364,7 +364,7 @@ def __init__(self):
self._page1_misc_gpage_spinbtn = sp.new_with_range(1, 100, 1)
self._page1_misc_beep_ckbtn = cb('响铃')
self._page1_misc_offline_ckbtn = cb('离线模式(仅使用本地会话数据)')
self._page1_misc_purge_ckbtn = cb('抹除所有本地记录!')
self._page1_misc_purge_ckbtn = cb('<b>抹除所有本地记录!</b>')
self._page1_misc_dependencies_ckbtn = cb('检查丢失的(非核心的)sqlmap依赖')
self._page1_misc_update_ckbtn = cb('更新sqlmap')
self._page1_misc_alert_ckbtn = cb('发现注入时运行本地命令:')
Expand All @@ -382,6 +382,7 @@ def __init__(self):
# 输出区(2)
# self._page2_cmdline_str_label = label.new('')
self._page2_respwan_btn = btn.new_with_label('重开终端')
self._page2_right_btn = btn.new_with_label('context menu')
self._page2_terminal = Vte.Terminal.new()
# 日志区(3)
self._page3_log_view = tv(editable = False, wrap_mode = g.WrapMode.WORD)
Expand Down
13 changes: 8 additions & 5 deletions opts_gtk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# encoding: utf-8
#
# 2019年 05月 14日 星期二 19:44:19 CST

Expand Down Expand Up @@ -212,9 +211,9 @@ def _build_page1_setting_detection(self, m):
'Level 5 追加: Host报头',
halign = g.Align.START)
_risk_note = label(label = 'Risk 1(默认): 基本无风险\n'
'Risk 2 追加: 大量时间型盲注\n'
'Risk 3 追加: OR型布尔盲注',
halign = g.Align.START)
'Risk 2 追加: 大量时间型盲注\n'
'Risk 3 追加: OR型布尔盲注',
halign = g.Align.START)
# _risk_note.override_background_color(g.StateFlags.NORMAL, d.RGBA(255, 0, 0, 1))
_boxes[8].pack_start(_level_note, True, True, 5)
_boxes[8].pack_start(_risk_note, True, True, 5)
Expand Down Expand Up @@ -1012,6 +1011,8 @@ def _build_page1_other_general(self, m):
[m._page1_general_save_entry]
)

m._page1_general_flush_session_ckbtn.get_children()[0].set_use_markup(True)

_boxes[8].pack_start(m._page1_general_flush_session_ckbtn, False, True, 5)
_boxes[8].pack_start(m._page1_general_dump_format_ckbtn, False, True, 5)
_boxes[8].pack_start(m._page1_general_dump_format_entry, False, True, 5)
Expand Down Expand Up @@ -1052,6 +1053,8 @@ def _build_page1_other_misc(self, m):

_boxes = [Box() for _ in range(5)]

m._page1_misc_purge_ckbtn.get_children()[0].set_use_markup(True)

_boxes[0].pack_start(m._page1_misc_skip_waf_ckbtn, False, True, 5)
_boxes[0].pack_start(m._page1_misc_unstable_ckbtn, False, True, 5)
_boxes[0].pack_start(m._page1_misc_list_tampers_ckbtn, False, True, 5)
Expand Down Expand Up @@ -1124,7 +1127,7 @@ def main():
win.show_all()
# --------
end = time.process_time()
print('loading cost: %s Seconds' % (end - start))
print('loading cost: %.3f Seconds' % (end - start))
g.main()


Expand Down
Loading

0 comments on commit ee7d9f7

Please sign in to comment.