Exploit database

GH-de2318f62d43bced52bf249576e6dec9

hoangrealer/cve-2023-27216

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-27216

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files47

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

_DSL-3782_A1_EU_1.01_07282016.bin.extracted/squashfs-root/boaroot/html/js/New_GUI/jquery.selectbox-0.2_new.js

JavaScript · 10,556 bytes
/*!
 * jQuery Selectbox plugin 0.2
 *
 * Copyright 2011-2012, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/selectbox/)
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
 * 
 * Date: Tue Jul 17 19:58:36 2012 +0300
 */
(function(d, f) {
	var e = "selectbox",
		c = false,
		b = true;

	function a() {
		this._state = [];
		this._defaults = {
			classHolder: "sbHolder",
			classHolderDisabled: "sbHolderDisabled",
			classSelector: "sbSelector",
			classOptions: "sbOptions",
			classGroup: "sbGroup",
			classSub: "sbSub",
			classDisabled: "sbDisabled",
			classToggleOpen: "sbToggleOpen",
			classToggle: "sbToggle",
			classFocus: "sbFocus",
			width: 200,
			speed: 100,
			effect: "slide",
			onChange: null,
			onOpen: null,
			onClose: null,
			maxHeight: null,
			direction: "down"
		}
	}
	d.extend(a.prototype, {
		_isOpenSelectbox: function(h) {
			if (!h) {
				return c
			}
			var g = this._getInst(h);
			return g.isOpen
		},
		_isDisabledSelectbox: function(h) {
			if (!h) {
				return c
			}
			var g = this._getInst(h);
			return g.isDisabled
		},
		_attachSelectbox: function(o, k) {
			if (this._getInst(o)) {
				return c
			}
			var j = d(o),
				u = this,
				m = u._newInst(j),
				l, r, i, p, v = c,
				t = j.find("optgroup"),
				h = j.find("option"),
				n = h.length;
			j.attr("sb", m.uid);
			d.extend(m.settings, u._defaults, k);
			u._state[m.uid] = c;
			j.hide();

			function g() {
				var w, x, s = this.attr("id").split("_")[1];
				for (w in u._state) {
					if (w !== s) {
						if (u._state.hasOwnProperty(w)) {
							x = d("select[sb='" + w + "']")[0];
							if (x) {
								u._closeSelectbox(x)
							}
						}
					}
				}
			}
			l = d("<div>", {
				id: "sbHolder_" + m.uid,
				"class": m.settings.classHolder,
				style: "width:" + m.settings.width + "px",
				tabindex: j.attr("tabindex")
			});
			r = d("<a>", {
				id: "sbSelector_" + m.uid,
				href: "#",
				"class": m.settings.classSelector,
				style: "width:" + (m.settings.width - 30) + "px",
				click: function(w) {
					w.preventDefault();
					g.apply(d(this), []);
					var s = d(this).attr("id").split("_")[1];
					if (u._state[s]) {
						u._closeSelectbox(o)
					} else {
						u._openSelectbox(o)
					}
				}
			});
			i = d("<a>", {
				id: "sbToggle_" + m.uid,
				href: "#",
				"class": m.settings.classToggle,
				click: function(w) {
					w.preventDefault();
					g.apply(d(this), []);
					var s = d(this).attr("id").split("_")[1];
					if (u._state[s]) {
						u._closeSelectbox(o)
					} else {
						u._openSelectbox(o)
					}
				}
			});
			i.appendTo(l);
			p = d("<ul>", {
				id: "sbOptions_" + m.uid,
				"class": m.settings.classOptions,
				style: "width:" + m.settings.width + "px",
				css: {
					display: "none"
				}
			});
			j.children().each(function(x) {
				var y = d(this),
					s, w = {};
				if (y.is("option")) {
					q(y)
				} else {
					if (y.is("optgroup")) {
						s = d("<li>");
						d("<span>", {
							text: y.attr("label")
						}).addClass(m.settings.classGroup).appendTo(s);
						s.appendTo(p);
						if (y.is(":disabled")) {
							w.disabled = true
						}
						w.sub = true;
						q(y.find("option"), w)
					}
				}
			});

			function q() {
				var w = arguments[1] && arguments[1].sub ? true : false,
					s = arguments[1] && arguments[1].disabled ? true : false;
				arguments[0].each(function(y) {
					var z = d(this),
						x = d("<li>"),
						A;
					if (z.is(":selected")) {
						r.text(z.text());
						v = b
					}
					if (y === n - 1) {
						x.addClass("last")
					}
					if (!z.is(":disabled") && !s) {
						A = d("<a>", {
							href: "" + z.val(),
							rel: z.val()
						}).text(z.text()).bind("click.sb", function(E) {
							if (E && E.preventDefault) {
								E.preventDefault()
							}
							var C = i,
								D = d(this),
								B = C.attr("id").split("_")[1];
							u._changeSelectbox(o, D.attr("rel"), D.text());
							u._closeSelectbox(o)
						}).bind("mouseover.sb", function() {
							var B = d(this);
							B.parent().siblings().find("a").removeClass(m.settings.classFocus);
							B.addClass(m.settings.classFocus)
						}).bind("mouseout.sb", function() {
							d(this).removeClass(m.settings.classFocus)
						});
						if (w) {
							A.addClass(m.settings.classSub)
						}
						if (z.is(":selected")) {
							A.addClass(m.settings.classFocus)
						}
						A.appendTo(x)
					} else {
						A = d("<span>", {
							text: z.text()
						}).addClass(m.settings.classDisabled);
						if (w) {
							A.addClass(m.settings.classSub)
						}
						A.appendTo(x)
					}
					x.appendTo(p)
				})
			}
			if (!v) {
				r.text(h.first().text())
			}
			d.data(o, e, m);
			l.data("uid", m.uid).bind("keydown.sb", function(A) {
				var D = A.charCode ? A.charCode : A.keyCode ? A.keyCode : 0,
					C = d(this),
					z = C.data("uid"),
					y = C.siblings("select[sb='" + z + "']").data(e),
					B = C.siblings(["select[sb='", z, "']"].join("")).get(0),
					s = C.find("ul").find("a." + y.settings.classFocus);
				switch (D) {
					case 37:
					case 38:
						if (s.length > 0) {
							var w;
							d("a", C).removeClass(y.settings.classFocus);
							w = s.parent().prevAll("li:has(a)").eq(0).find("a");
							if (w.length > 0) {
								w.addClass(y.settings.classFocus).focus();
								d("#sbSelector_" + z).text(w.text())
							}
						}
						break;
					case 39:
					case 40:
						var w;
						d("a", C).removeClass(y.settings.classFocus);
						if (s.length > 0) {
							w = s.parent().nextAll("li:has(a)").eq(0).find("a")
						} else {
							w = C.find("ul").find("a").eq(0)
						}
						if (w.length > 0) {
							w.addClass(y.settings.classFocus).focus();
							d("#sbSelector_" + z).text(w.text())
						}
						break;
					case 13:
						if (s.length > 0) {
							u._changeSelectbox(B, s.attr("rel"), s.text())
						}
						u._closeSelectbox(B);
						break;
					case 9:
						if (B) {
							var y = u._getInst(B);
							if (y) {
								if (s.length > 0) {
									u._changeSelectbox(B, s.attr("rel"), s.text())
								}
								u._closeSelectbox(B)
							}
						}
						var x = parseInt(C.attr("tabindex"), 10);
						if (!A.shiftKey) {
							x++
						} else {
							x--
						}
						d("*[tabindex='" + x + "']").focus();
						break;
					case 27:
						u._closeSelectbox(B);
						break
				}
				A.stopPropagation();
				return false
			}).delegate("a", "mouseover", function(s) {
				d(this).addClass(m.settings.classFocus)
			}).delegate("a", "mouseout", function(s) {
				d(this).removeClass(m.settings.classFocus)
			});
			r.appendTo(l);
			p.appendTo(l);
			l.insertAfter(j);
			d("html").live("mousedown", function(s) {
				s.stopPropagation();
				d("select").selectbox("close")
			});
			d([".", m.settings.classHolder, ", .", m.settings.classSelector].join("")).mousedown(function(s) {
				s.stopPropagation()
			})
		},
		_detachSelectbox: function(h) {
			var g = this._getInst(h);
			if (!g) {
				return c
			}
			d("#sbHolder_" + g.uid).remove();
			d.data(h, e, null);
			d(h).show()
		},
		_changeSelectbox: function(j, i, k) {
			var g, h = this._getInst(j);
			if (h) {
				g = this._get(h, "onChange");
				d("#sbSelector_" + h.uid).text(k)
			}
			i = i.replace(/\'/g, "\\'");
			d(j).find("option[value='" + i + "']").attr("selected", b);
			if (h && g) {
				g.apply((h.input ? h.input[0] : null), [i, h])
			} else {
				if (h && h.input) {
					h.input.trigger("change")
				}
			}
		},
		_enableSelectbox: function(h) {
			var g = this._getInst(h);
			if (!g || !g.isDisabled) {
				return c
			}
			d("#sbHolder_" + g.uid).removeClass(g.settings.classHolderDisabled);
			g.isDisabled = c;
			d.data(h, e, g)
		},
		_disableSelectbox: function(h) {
			var g = this._getInst(h);
			if (!g || g.isDisabled) {
				return c
			}
			d("#sbHolder_" + g.uid).addClass(g.settings.classHolderDisabled);
			g.isDisabled = b;
			d.data(h, e, g)
		},
		_optionSelectbox: function(j, g, i) {
			var h = this._getInst(j);
			if (!h) {
				return c
			}
			h[g] = i;
			d.data(j, e, h)
		},
		_openSelectbox: function(m) {
			var k = this._getInst(m);
			if (!k || k.isOpen || k.isDisabled) {
				return
			}
			var h = d("#sbOptions_" + k.uid),
				l = parseInt(d(window).height(), 10),
				j = d("#sbHolder_" + k.uid).offset(),
				g = d(window).scrollTop(),
				o = h.prev().height(),
				n = l - (j.top - g) - o / 2,
				i = this._get(k, "onOpen");
			h.css({
				top: (k.settings.direction == "down" ? o : "-" + k.settings.maxHeight) + "px",
				maxHeight: (k.settings.maxHeight ? k.settings.maxHeight : (n - o)) + "px"
			});
			k.settings.effect === "fade" ? h.fadeIn(k.settings.speed) : h.slideDown(k.settings.speed);
			d("#sbToggle_" + k.uid).addClass(k.settings.classToggleOpen);
			this._state[k.uid] = b;
			k.isOpen = b;
			if (i) {
				i.apply((k.input ? k.input[0] : null), [k])
			}
			d.data(m, e, k)
		},
		_closeSelectbox: function(i) {
			var h = this._getInst(i);
			if (!h || !h.isOpen) {
				return
			}
			var g = this._get(h, "onClose");
			h.settings.effect === "fade" ? d("#sbOptions_" + h.uid).fadeOut(h.settings.speed) : d("#sbOptions_" + h.uid).slideUp(h.settings.speed);
			d("#sbToggle_" + h.uid).removeClass(h.settings.classToggleOpen);
			this._state[h.uid] = c;
			h.isOpen = c;
			if (g) {
				g.apply((h.input ? h.input[0] : null), [h])
			}
			d.data(i, e, h)
		},
		_newInst: function(g) {
			var h = g[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1");
			return {
				id: h,
				input: g,
				uid: Math.floor(Math.random() * 99999999),
				isOpen: c,
				isDisabled: c,
				settings: {}
			}
		},
		_getInst: function(h) {
			try {
				return d.data(h, e)
			} catch (g) {
				throw "Missing instance data for this selectbox"
			}
		},
		_get: function(h, g) {
			return h.settings[g] !== f ? h.settings[g] : this._defaults[g]
		}
	});
	d.fn.selectbox = function(h) {
		var g = Array.prototype.slice.call(arguments, 1);
		if (typeof h == "string" && h == "isDisabled") {
			return d.selectbox["_" + h + "Selectbox"].apply(d.selectbox, [this[0]].concat(g))
		}
		if (h == "option" && arguments.length == 2 && typeof arguments[1] == "string") {
			return d.selectbox["_" + h + "Selectbox"].apply(d.selectbox, [this[0]].concat(g))
		}
		return this.each(function() {
			typeof h == "string" ? d.selectbox["_" + h + "Selectbox"].apply(d.selectbox, [this].concat(g)) : d.selectbox._attachSelectbox(this, h)
		})
	};
	d.selectbox = new a();
	d.selectbox.version = "0.2"
})(jQuery);