USF Student Seach Bypass

A simple script to bypass sign-in on the University of South Florida Directory page

  1. // ==UserScript==
  2. // @name USF Student Seach Bypass
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description A simple script to bypass sign-in on the University of South Florida Directory page
  6. // @author November2246
  7. // @match https://directory.usf.edu/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=usf.edu
  9. // @grant none
  10. // @run-at document-start
  11. // @license ISC
  12. // ==/UserScript==
  13.  
  14. //XHook - v1.6.2 - https://github.com/jpillora/xhook
  15. //Jaime Pillora <dev@jpillora.com> - MIT Copyright 2023
  16. var xhook = function () {
  17. "use strict";
  18.  
  19. const e = (e, t) => Array.prototype.slice.call(e, t);
  20. let t = null;
  21. if (typeof WorkerGlobalScope != "undefined" && self instanceof WorkerGlobalScope) {
  22. t = self;
  23. } else if (typeof global != "undefined") {
  24. t = global;
  25. } else if (window) {
  26. t = window;
  27. }
  28. const n = t;
  29. const o = t.document;
  30. const r = ["load", "loadend", "loadstart"];
  31. const s = ["progress", "abort", "error", "timeout"];
  32. const a = e => ["returnValue", "totalSize", "position"].includes(e);
  33. const i = function (e, t) {
  34. for (let n in e) {
  35. if (a(n)) {
  36. continue;
  37. }
  38. const o = e[n];
  39. try {
  40. t[n] = o;
  41. } catch (e) {}
  42. }
  43. return t;
  44. };
  45. const c = function (e, t, n) {
  46. const o = e => function (o) {
  47. const r = {};
  48. for (let e in o) {
  49. if (a(e)) {
  50. continue;
  51. }
  52. const s = o[e];
  53. r[e] = s === t ? n : s;
  54. }
  55. return n.dispatchEvent(e, r);
  56. };
  57. for (let r of Array.from(e)) {
  58. if (n._has(r)) {
  59. t[`on${r}`] = o(r);
  60. }
  61. }
  62. };
  63. const u = function (e) {
  64. if (o && o.createEventObject != null) {
  65. const t = o.createEventObject();
  66. t.type = e;
  67. return t;
  68. }
  69. try {
  70. return new Event(e);
  71. } catch (t) {
  72. return {
  73. type: e
  74. };
  75. }
  76. };
  77. const l = function (t) {
  78. let n = {};
  79. const o = e => n[e] || [];
  80. const r = {
  81. addEventListener: function (e, t, r) {
  82. n[e] = o(e);
  83. if (!(n[e].indexOf(t) >= 0)) {
  84. r = r === undefined ? n[e].length : r;
  85. n[e].splice(r, 0, t);
  86. }
  87. },
  88. removeEventListener: function (e, t) {
  89. if (e === undefined) {
  90. n = {};
  91. return;
  92. }
  93. if (t === undefined) {
  94. n[e] = [];
  95. }
  96. const r = o(e).indexOf(t);
  97. if (r !== -1) {
  98. o(e).splice(r, 1);
  99. }
  100. },
  101. dispatchEvent: function () {
  102. const n = e(arguments);
  103. const s = n.shift();
  104. if (!t) {
  105. n[0] = i(n[0], u(s));
  106. Object.defineProperty(n[0], "target", {
  107. writable: false,
  108. value: this
  109. });
  110. }
  111. const a = r[`on${s}`];
  112. if (a) {
  113. a.apply(r, n);
  114. }
  115. const c = o(s).concat(o("*"));
  116. for (let e = 0; e < c.length; e++) {
  117. c[e].apply(r, n);
  118. }
  119. },
  120. _has: e => !!n[e] || !!r[`on${e}`]
  121. };
  122. if (t) {
  123. r.listeners = t => e(o(t));
  124. r.on = r.addEventListener;
  125. r.off = r.removeEventListener;
  126. r.fire = r.dispatchEvent;
  127. r.once = function (e, t) {
  128. function n() {
  129. r.off(e, n);
  130. return t.apply(null, arguments);
  131. }
  132. return r.on(e, n);
  133. };
  134. r.destroy = () => n = {};
  135. }
  136. return r;
  137. };
  138. function f(e, t) {
  139. switch (typeof e) {
  140. case "object":
  141. n = e;
  142. return Object.entries(n).map(([e, t]) => `${e.toLowerCase()}: ${t}`).join("\r\n");
  143. case "string":
  144. return function (e, t) {
  145. const n = e.split("\r\n");
  146. if (t == null) {
  147. t = {};
  148. }
  149. for (let e of n) {
  150. if (/([^:]+):\s*(.+)/.test(e)) {
  151. const e = RegExp.$1 != null ? RegExp.$1.toLowerCase() : undefined;
  152. const n = RegExp.$2;
  153. if (t[e] == null) {
  154. t[e] = n;
  155. }
  156. }
  157. }
  158. return t;
  159. }(e, t);
  160. }
  161. var n;
  162. return [];
  163. }
  164. const d = l(true);
  165. const p = e => e === undefined ? null : e;
  166. const h = n.XMLHttpRequest;
  167. const y = function () {
  168. const e = new h();
  169. const t = {};
  170. let n;
  171. let o;
  172. let a;
  173. let u = null;
  174. var y = 0;
  175. const v = function () {
  176. a.status = u || e.status;
  177. if (u !== -1) {
  178. a.statusText = e.statusText;
  179. }
  180. if (u === -1) ;else {
  181. const t = f(e.getAllResponseHeaders());
  182. for (let e in t) {
  183. const n = t[e];
  184. if (!a.headers[e]) {
  185. const t = e.toLowerCase();
  186. a.headers[t] = n;
  187. }
  188. }
  189. }
  190. };
  191. const b = function () {
  192. x.status = a.status;
  193. x.statusText = a.statusText;
  194. };
  195. const g = function () {
  196. if (!n) {
  197. x.dispatchEvent("load", {});
  198. }
  199. x.dispatchEvent("loadend", {});
  200. if (n) {
  201. x.readyState = 0;
  202. }
  203. };
  204. const E = function (e) {
  205. while (e > y && y < 4) {
  206. x.readyState = ++y;
  207. if (y === 1) {
  208. x.dispatchEvent("loadstart", {});
  209. }
  210. if (y === 2) {
  211. b();
  212. }
  213. if (y === 4) {
  214. b();
  215. if ("text" in a) {
  216. x.responseText = a.text;
  217. }
  218. if ("xml" in a) {
  219. x.responseXML = a.xml;
  220. }
  221. if ("data" in a) {
  222. x.response = a.data;
  223. }
  224. if ("finalUrl" in a) {
  225. x.responseURL = a.finalUrl;
  226. }
  227. }
  228. x.dispatchEvent("readystatechange", {});
  229. if (y === 4) {
  230. if (t.async === false) {
  231. g();
  232. } else {
  233. setTimeout(g, 0);
  234. }
  235. }
  236. }
  237. };
  238. const m = function (e) {
  239. if (e !== 4) {
  240. E(e);
  241. return;
  242. }
  243. const n = d.listeners("after");
  244. function o() {
  245. if (n.length > 0) {
  246. const e = n.shift();
  247. if (e.length === 2) {
  248. e(t, a);
  249. o();
  250. } else if (e.length === 3 && t.async) {
  251. e(t, a, o);
  252. } else {
  253. o();
  254. }
  255. } else {
  256. E(4);
  257. }
  258. }
  259. o();
  260. };
  261. var x = l();
  262. t.xhr = x;
  263. e.onreadystatechange = function (t) {
  264. try {
  265. if (e.readyState === 2) {
  266. v();
  267. }
  268. } catch (e) {}
  269. if (e.readyState === 4) {
  270. o = false;
  271. v();
  272. (function () {
  273. if (e.responseType && e.responseType !== "text") {
  274. if (e.responseType === "document") {
  275. a.xml = e.responseXML;
  276. a.data = e.responseXML;
  277. } else {
  278. a.data = e.response;
  279. }
  280. } else {
  281. a.text = e.responseText;
  282. a.data = e.responseText;
  283. try {
  284. a.xml = e.responseXML;
  285. } catch (e) {}
  286. }
  287. if ("responseURL" in e) {
  288. a.finalUrl = e.responseURL;
  289. }
  290. })();
  291. }
  292. m(e.readyState);
  293. };
  294. const w = function () {
  295. n = true;
  296. };
  297. x.addEventListener("error", w);
  298. x.addEventListener("timeout", w);
  299. x.addEventListener("abort", w);
  300. x.addEventListener("progress", function (t) {
  301. if (y < 3) {
  302. m(3);
  303. } else if (e.readyState <= 3) {
  304. x.dispatchEvent("readystatechange", {});
  305. }
  306. });
  307. if ("withCredentials" in e) {
  308. x.withCredentials = false;
  309. }
  310. x.status = 0;
  311. for (let e of Array.from(s.concat(r))) {
  312. x[`on${e}`] = null;
  313. }
  314. x.open = function (e, r, s, i, c) {
  315. y = 0;
  316. n = false;
  317. o = false;
  318. t.headers = {};
  319. t.headerNames = {};
  320. t.status = 0;
  321. t.method = e;
  322. t.url = r;
  323. t.async = s !== false;
  324. t.user = i;
  325. t.pass = c;
  326. a = {};
  327. a.headers = {};
  328. m(1);
  329. };
  330. x.send = function (n) {
  331. let u;
  332. let l;
  333. for (u of ["type", "timeout", "withCredentials"]) {
  334. l = u === "type" ? "responseType" : u;
  335. if (l in x) {
  336. t[u] = x[l];
  337. }
  338. }
  339. t.body = n;
  340. const f = d.listeners("before");
  341. function p() {
  342. if (!f.length) {
  343. return function () {
  344. c(s, e, x);
  345. if (x.upload) {
  346. c(s.concat(r), e.upload, x.upload);
  347. }
  348. o = true;
  349. e.open(t.method, t.url, t.async, t.user, t.pass);
  350. for (u of ["type", "timeout", "withCredentials"]) {
  351. l = u === "type" ? "responseType" : u;
  352. if (u in t) {
  353. e[l] = t[u];
  354. }
  355. }
  356. for (let n in t.headers) {
  357. const o = t.headers[n];
  358. if (n) {
  359. e.setRequestHeader(n, o);
  360. }
  361. }
  362. e.send(t.body);
  363. }();
  364. }
  365. const n = function (e) {
  366. if (typeof e == "object" && (typeof e.status == "number" || typeof a.status == "number")) {
  367. i(e, a);
  368. if (!("data" in e)) {
  369. e.data = e.response || e.text;
  370. }
  371. m(4);
  372. return;
  373. }
  374. p();
  375. };
  376. n.head = function (e) {
  377. i(e, a);
  378. m(2);
  379. };
  380. n.progress = function (e) {
  381. i(e, a);
  382. m(3);
  383. };
  384. const d = f.shift();
  385. if (d.length === 1) {
  386. n(d(t));
  387. } else if (d.length === 2 && t.async) {
  388. d(t, n);
  389. } else {
  390. n();
  391. }
  392. }
  393. p();
  394. };
  395. x.abort = function () {
  396. u = -1;
  397. if (o) {
  398. e.abort();
  399. } else {
  400. x.dispatchEvent("abort", {});
  401. }
  402. };
  403. x.setRequestHeader = function (e, n) {
  404. const o = e != null ? e.toLowerCase() : undefined;
  405. const r = t.headerNames[o] = t.headerNames[o] || e;
  406. if (t.headers[r]) {
  407. n = t.headers[r] + ", " + n;
  408. }
  409. t.headers[r] = n;
  410. };
  411. x.getResponseHeader = e => p(a.headers[e ? e.toLowerCase() : undefined]);
  412. x.getAllResponseHeaders = () => p(f(a.headers));
  413. if (e.overrideMimeType) {
  414. x.overrideMimeType = function () {
  415. e.overrideMimeType.apply(e, arguments);
  416. };
  417. }
  418. if (e.upload) {
  419. let e = l();
  420. x.upload = e;
  421. t.upload = e;
  422. }
  423. x.UNSENT = 0;
  424. x.OPENED = 1;
  425. x.HEADERS_RECEIVED = 2;
  426. x.LOADING = 3;
  427. x.DONE = 4;
  428. x.response = "";
  429. x.responseText = "";
  430. x.responseXML = null;
  431. x.readyState = 0;
  432. x.statusText = "";
  433. return x;
  434. };
  435. y.UNSENT = 0;
  436. y.OPENED = 1;
  437. y.HEADERS_RECEIVED = 2;
  438. y.LOADING = 3;
  439. y.DONE = 4;
  440. var v = {
  441. patch() {
  442. if (h) {
  443. n.XMLHttpRequest = y;
  444. }
  445. },
  446. unpatch() {
  447. if (h) {
  448. n.XMLHttpRequest = h;
  449. }
  450. },
  451. Native: h,
  452. Xhook: y
  453. };
  454. function b(e, t, n, o) {
  455. return new (n ||= Promise)(function (r, s) {
  456. function a(e) {
  457. try {
  458. c(o.next(e));
  459. } catch (e) {
  460. s(e);
  461. }
  462. }
  463. function i(e) {
  464. try {
  465. c(o.throw(e));
  466. } catch (e) {
  467. s(e);
  468. }
  469. }
  470. function c(e) {
  471. var t;
  472. if (e.done) {
  473. r(e.value);
  474. } else {
  475. (t = e.value, t instanceof n ? t : new n(function (e) {
  476. e(t);
  477. })).then(a, i);
  478. }
  479. }
  480. c((o = o.apply(e, t || [])).next());
  481. });
  482. }
  483. const g = n.fetch;
  484. function E(e) {
  485. if (e instanceof Headers) {
  486. return m([...e.entries()]);
  487. } else if (Array.isArray(e)) {
  488. return m(e);
  489. } else {
  490. return e;
  491. }
  492. }
  493. function m(e) {
  494. return e.reduce((e, [t, n]) => {
  495. e[t] = n;
  496. return e;
  497. }, {});
  498. }
  499. const x = function (e, t = {
  500. headers: {}
  501. }) {
  502. let n = Object.assign(Object.assign({}, t), {
  503. isFetch: true
  504. });
  505. if (e instanceof Request) {
  506. const o = function (e) {
  507. let t = {};
  508. ["method", "headers", "body", "mode", "credentials", "cache", "redirect", "referrer", "referrerPolicy", "integrity", "keepalive", "signal", "url"].forEach(n => t[n] = e[n]);
  509. return t;
  510. }(e);
  511. const r = Object.assign(Object.assign({}, E(o.headers)), E(n.headers));
  512. n = Object.assign(Object.assign(Object.assign({}, o), t), {
  513. headers: r,
  514. acceptedRequest: true
  515. });
  516. } else {
  517. n.url = e;
  518. }
  519. const o = d.listeners("before");
  520. const r = d.listeners("after");
  521. return new Promise(function (t, s) {
  522. let a = t;
  523. const i = function (e) {
  524. if (!r.length) {
  525. return a(e);
  526. }
  527. const t = r.shift();
  528. if (t.length === 2) {
  529. t(n, e);
  530. return i(e);
  531. } else if (t.length === 3) {
  532. return t(n, e, i);
  533. } else {
  534. return i(e);
  535. }
  536. };
  537. const c = function (e) {
  538. if (e !== undefined) {
  539. const n = new Response(e.body || e.text, e);
  540. t(n);
  541. i(n);
  542. return;
  543. }
  544. u();
  545. };
  546. const u = function () {
  547. if (!o.length) {
  548. l();
  549. return;
  550. }
  551. const e = o.shift();
  552. if (e.length === 1) {
  553. return c(e(n));
  554. } else if (e.length === 2) {
  555. return e(n, c);
  556. } else {
  557. return undefined;
  558. }
  559. };
  560. const l = () => b(this, undefined, undefined, function* () {
  561. const {
  562. url: t,
  563. isFetch: o,
  564. acceptedRequest: r
  565. } = n;
  566. const c = function (e, t) {
  567. var n = {};
  568. for (var o in e) {
  569. if (Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0) {
  570. n[o] = e[o];
  571. }
  572. }
  573. if (e != null && typeof Object.getOwnPropertySymbols == "function") {
  574. var r = 0;
  575. for (o = Object.getOwnPropertySymbols(e); r < o.length; r++) {
  576. if (t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r])) {
  577. n[o[r]] = e[o[r]];
  578. }
  579. }
  580. }
  581. return n;
  582. }(n, ["url", "isFetch", "acceptedRequest"]);
  583. if (e instanceof Request && c.body instanceof ReadableStream) {
  584. c.body = yield new Response(c.body).text();
  585. }
  586. return g(t, c).then(e => i(e)).catch(function (e) {
  587. a = s;
  588. i(e);
  589. return s(e);
  590. });
  591. });
  592. u();
  593. });
  594. };
  595. var w = {
  596. patch() {
  597. if (g) {
  598. n.fetch = x;
  599. }
  600. },
  601. unpatch() {
  602. if (g) {
  603. n.fetch = g;
  604. }
  605. },
  606. Native: g,
  607. Xhook: x
  608. };
  609. const O = d;
  610. O.EventEmitter = l;
  611. O.before = function (e, t) {
  612. if (e.length < 1 || e.length > 2) {
  613. throw "invalid hook";
  614. }
  615. return O.on("before", e, t);
  616. };
  617. O.after = function (e, t) {
  618. if (e.length < 2 || e.length > 3) {
  619. throw "invalid hook";
  620. }
  621. return O.on("after", e, t);
  622. };
  623. O.enable = function () {
  624. v.patch();
  625. w.patch();
  626. };
  627. O.disable = function () {
  628. v.unpatch();
  629. w.unpatch();
  630. };
  631. O.XMLHttpRequest = v.Native;
  632. O.fetch = w.Native;
  633. O.headers = f;
  634. O.enable();
  635. return O;
  636. }();
  637. //# sourceMappingURL=xhook.js.map
  638.  
  639. xhook.before((request) => {
  640. if (request?.url !== '/readdata/3') return;
  641. request.body.append('student', 'on');
  642. request.body.delete('faculty');
  643. request.body.delete('staff');
  644. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址