[ { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"\/* Author: Selvahini Kamalarajan \r\nDate: December 5, 2023 \r\nFile Name: script \r\nDescription: Informational website about the implications of privacy and information technology usage *\/\r\n\r\nfunction phishing() {\r\n \/\/ Function to display correct answer for phishing email question\r\n var question = document.quiz2.question.value;\r\n\r\n if (question == \"yes\") {\r\n document.getElementById(\"message\").innerHTML = \"Correct! This is a spoof email coming from a fake sender address (i.e. 'myuniversity.edu') and redirects the user to a bogus page that appears to be legitimate.\";\r\n }\r\n\r\n if (question == \"no\") {\r\n document.getElementById(\"message\").innerHTML = \"Incorrect. This is a spoof email coming from a fake sender address (i.e. 'myuniversity.edu') and redirects the user to a bogus page that appears to be legitimate. Your privacy can be compromised due to malicious script activities.\";\r\n }\r\n document.getElementById(\"after_submit\").style.visibility = \"visible\"; \/\/Set element visibility to visible \r\n}\r\n\r\nfunction check() {\r\n \/\/ Function to check answers for Privacy Policy Question\r\n var question = document.quiz.question.value;\r\n\r\n \/\/ Output message and picture if user answers yes\/no\r\n if (question == \"yes\") {\r\n document.getElementById(\"message\").innerHTML = \"Nice! You are one of 9% of people who read privacy policies often.\";\r\n document.getElementById(\"picture\").src = \"policy.png\";\r\n }\r\n\r\n if (question == \"no\") {\r\n document.getElementById(\"message\").innerHTML = \"Just like you, 91% of consumers accept the terms and conditions without reading them.\";\r\n document.getElementById(\"picture\").src = \"policies-stats.jpg\";\r\n }\r\n document.getElementById(\"after_submit\").style.visibility = \"visible\";\r\n}\r\n\r\nfunction checkAns() {\r\n \/\/ Function to check answers for quiz \r\n var correctAns = [\"b\", \"b\", \"a\", \"d\", \"b\", \"d\", \"b\", \"b\", \"c\", \"d\"]; \r\n\r\n var correct = 0;\r\n \r\n var questions = [document.quiz.q1.value, document.quiz.q2.value, document.quiz.q3.value, documen", "language":"Javascript", "repo_name":"selvxhini-10\/PersonalPrivacyWebsite", "timestamp":"2025-05-22T22:01:00.115247", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"\/\/\n\/******************************************************************************\n * user.js *\n * https:\/\/github.com\/pyllyukko\/user.js *\n ******************************************************************************\/\n\n\/******************************************************************************\n * SECTION: HTML5 \/ APIs \/ DOM *\n ******************************************************************************\/\n\n\/\/ PREF: Disable Service Workers\n\/\/ https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Worker\n\/\/ https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/ServiceWorker_API\n\/\/ https:\/\/wiki.mozilla.org\/Firefox\/Push_Notifications#Service_Workers\n\/\/ NOTICE: Disabling ServiceWorkers breaks functionality on some sites (Google Street View...)\n\/\/ NOTICE: Disabling ServiceWorkers breaks Firefox Sync\n\/\/ Unknown security implications\n\/\/ CVE-2016-5259, CVE-2016-2812, CVE-2016-1949, CVE-2016-5287 (fixed)\nuser_pref(\"dom.serviceWorkers.enabled\",\t\t\t\tfalse);\n\n\/\/ PREF: Disable web notifications\n\/\/ https:\/\/support.mozilla.org\/en-US\/questions\/1140439\nuser_pref(\"dom.webnotifications.enabled\",\t\t\tfalse);\n\n\/\/ PREF: Disable DOM timing API\n\/\/ https:\/\/wiki.mozilla.org\/Security\/Reviews\/Firefox\/NavigationTimingAPI\n\/\/ https:\/\/www.w3.org\/TR\/navigation-timing\/#privacy\n\/\/ NOTICE: Disabling DOM timing API breaks item pages in AliExpress (https:\/\/github.com\/pyllyukko\/user.js\/issues\/561)\nuser_pref(\"dom.enable_performance\",\t\t\t\tfalse);\n\n\/\/ PREF: Disable resource timing API\n\/\/ https:\/\/www.w3.org\/TR\/resource-timing\/#privacy-security\n\/\/ NOTICE: Disabling resource timing API breaks some DDoS protection pages (Cloudflare)\nuser_pref(\"dom.enable_resource_timing\",\t\t\t\tfalse);\n\n\/\/ PREF: Make sure the User Timing API does not provide a new high resolution timestamp\n\/\/ https:\/\/trac.torproject.org\/projects\/tor\/ticket\/16336\n\/\/ https:\/\/www.w3.org\/TR\/2013\/REC-user-timing-2", "language":"Javascript", "repo_name":"pyllyukko\/user.js", "timestamp":"2025-05-22T22:01:00.249678", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"export class PhishingDetector {\n constructor() {\n \/\/ No need to check for ai.languageModel here\n \/\/ We'll handle capability checks when we use the model\n }\n\n async calculateScore(emailContent) {\n try {\n \/\/ Log emailContent for debugging\n console.log('Email content received:', emailContent);\n\n const features = this.analyzeEmailFeatures(emailContent);\n\n \/\/ Check if the language model is available\n const capabilities = await ai.languageModel.capabilities();\n\n if (capabilities.available !== \"readily\") {\n console.warn('Language model is not readily available');\n\n if (capabilities.consent === \"granted\") {\n console.log('Consent already granted.');\n } else if (capabilities.consent === \"requirable\") {\n \/\/ Request user consent\n const consentResult = await ai.languageModel.requestConsent();\n if (!consentResult) {\n console.warn('User did not grant consent');\n return 50; \/\/ Return a default score or handle accordingly\n } else {\n console.log('User granted consent.');\n }\n } else {\n console.warn('Consent is not available.');\n return 50; \/\/ Return a default score or handle accordingly\n }\n }\n\n \/\/ Generate the prompt\n const prompt = `\n \nInstructions:\n- Considering the above information, assign a phishing likelihood score and provide a detailed explanation.\n- Use English and Arabic numerals.\n- Return the result in the format \"The score is the following: X\", where X is a number between 0 and 100.\nAnalyze this email for phishing indicators and provide a response in the following format:\n\nThe score is the following: X\n\nThe explanation is: [Your detailed analysis here]\nEnd of explanation.\n\nConsider these factors:\n- Urgency or pressure tactics\n- Grammar and spelling errors\n- Suspicious links or attachments\n- Requests for sensitive information\n- Mismatched or fake sender addresses\n- Time sent ", "language":"Javascript", "repo_name":"Dalosuuu\/GmailPhishGuardian_AI", "timestamp":"2025-05-22T22:01:00.434292", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"'use strict'\n\nconst chromeLauncher = require('chrome-launcher')\nconst path = require('path')\n\n\/\/ Borrow from here:\n\/\/ https:\/\/github.com\/GoogleChrome\/puppeteer\/blob\/master\/lib\/Launcher.js#L30\nconst DEFAULT_ARGS = [\n '--disable-background-networking',\n '--disable-background-timer-throttling',\n '--disable-client-side-phishing-detection',\n '--disable-default-apps',\n '--disable-hang-monitor',\n '--disable-popup-blocking',\n '--disable-prompt-on-repost',\n '--disable-sync',\n '--enable-automation',\n '--enable-devtools-experiments',\n '--metrics-recording-only',\n '--no-first-run',\n '--password-store=basic',\n '--safebrowsing-disable-auto-update',\n '--use-mock-keychain',\n]\n\n\/\/ borrow from: http:\/\/qiita.com\/saekis\/items\/c2b41cd8940923863791\nfunction escapeHtml (string) {\n if (typeof string !== 'string') {\n return string\n }\n return string.replace(\/[&'`\"<>]\/g, function (match) {\n return {\n '&': '&',\n '\\'': ''',\n '`': '`',\n '\"': '"',\n '<': '<',\n '>': '>',\n }[match]\n })\n}\n\nfunction escapeSingleQuote (string) {\n if (typeof string !== 'string') {\n return string\n }\n return string.replace(\/'\/g, '\\\\\\'')\n}\n\nfunction escapeNewLine (string) {\n return string.replace(\/\\r?\\n\/g, '\\\\n')\n}\n\nasync function createChromeLauncher (startingUrl, options) {\n const flags = [].concat(DEFAULT_ARGS)\n let chromeInstance\n\n \/\/ Lighthouse adds '--disable-setuid-sandbox' flag automatically.\n \/\/ The flag causes an error on linux when staring headless chrome.\n \/\/ '--no-sandbox' suppresses an error caused by '--disable-setuid-sandbox'.\n if (process.platform === 'linux') {\n flags.push('--no-sandbox')\n }\n if (!options.visible) {\n flags.push('--headless')\n flags.push('--hide-scrollbars')\n flags.push('--mute-audio')\n }\n if (options.chromeFlags && Array.isArray(options.chromeFlags)) {\n options.chromeFlags.forEach(f => {\n if (f.indexOf('--') === -1) {\n throw new Error('An item of chromFlags option", "language":"Javascript", "repo_name":"OnetapInc\/chromy", "timestamp":"2025-05-22T22:01:00.573851", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"\/\/ eslint-disable-next-line no-undef\ndocute.init({\n debug: true,\n title: 'Spam Scanner',\n repo: 'spamscanner\/spamscanner',\n 'edit-link': 'https:\/\/github.com\/spamscanner\/spamscanner\/tree\/master\/',\n twitter: 'niftylettuce',\n nav: {\n default: [\n {\n title:\n 'The best anti-spam, email filtering, and phishing prevention service.',\n path: '\/'\n }\n ]\n },\n \/\/ eslint-disable-next-line no-undef\n plugins: [docuteEmojify()]\n});\n", "language":"Javascript", "repo_name":"spamscanner\/spamscanner", "timestamp":"2025-05-22T22:01:00.710474", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"\n\n\/\/ this is the code which will be injected into a given page...\nvar config = {\n apiKey: \"AIzaSyD1FfiwIWzbbn0rhqQg6ZF2KzVBOiqU7oQ\",\n authDomain: \"phish-ai-production.firebaseapp.com\",\n databaseURL: \"https:\/\/phish-ai-production.firebaseio.com\",\n projectId: \"phish-ai-production\",\n storageBucket: \"gs:\/\/phish-ai-production.appspot.com\/\",\n messagingSenderId: \"976092427021\"\n};\nfirebase.initializeApp(config);\nvar db = firebase.firestore();\n\n\nfunction open_options_page() {\n chrome.tabs.create({'url': \"\/options.html\" } )\n};\n\nfunction open_demo_page() {\n chrome.tabs.create({'url': \"https:\/\/www.phish.ai\/request-a-demo\" } )\n};\n\nfunction restore_popup() {\n chrome.storage.local.get({\n idnEnable: true,\n aiEnable: true\n }, function(items) {\n if (!items.aiEnable) {\n document.getElementById('zero_day_disabled').style.display = \"\"\n }\n if (!items.idnEnable) {\n document.getElementById('idn_disabled').style.display = \"\"\n }\n var bg = chrome.extension.getBackgroundPage();\n var query = {active: true, currentWindow: true};\n chrome.tabs.query(query, function callback(tabs) {\n if (items.idnEnable) {\n var currentTab = tabs[0]; \/\/ there will be only one in this array\n var hostname = bg.extractHostname(currentTab.url);\n var domain = document.getElementById('domain');\n var idn_status = document.getElementById('idn_status');\n if (bg.isDomainIDN(hostname)) {\n domain.className = 'badge badge-danger';\n idn_status.className = 'badge badge-danger';\n idn_status.innerHTML = 'IDN Detected';\n }\n domain.innerHTML = hostname;\n }\n\n if (items.aiEnable) {\n if (currentTab.id in bg.tabMalicious) {\n var zero_day = document.getElementById('zero_day');\n var ta", "language":"Javascript", "repo_name":"phishai\/phish-protect", "timestamp":"2025-05-22T22:01:00.830022", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"respecConfig.localBiblio = {\n\t\"aicaptcha\": {\n\t\t\"title\": \"aiCaptcha: Using AI to beat CAPTCHA and post comment spam\",\n\t\t\"date\": \"\",\n\t\t\"authors\": [\"Casey Chesnut\"],\n\t\t\"editors\": [],\n\t\t\"etAl\": false,\n\t\t\"publisher\": \"\",\n\t\t\"href\": \"http:\/\/www.brains-n-brawn.com\/default.aspx?vDir=aicaptcha\"\n\t},\n\n \"able-gamers\": {\n \"title\": \"Thought On Accessibility and VR\",\n \"date\": \"March, 2017\",\n \"authors\": [\"AJ Ryan\"],\n \"editors\": [],\n \"etAl\": false,\n \"publisher\": \"\",\n \"href\": \"https:\/\/ablegamers.org\/thoughts-on-accessibility-and-vr\/\"\n },\n\n\t\"antiphishing\": {\n\t\t\"title\": \"Phishing Activity Trends Report\",\n\t\t\"date\": \"July, 2005\",\n\t\t\"authors\": [],\n\t\t\"editors\": [],\n\t\t\"etAl\": false,\n\t\t\"publisher\": \"Anti-Phishing Working Group\",\n\t\t\"href\": \"http:\/\/antiphishing.org\/APWG_Phishing_Activity_Report_Jul_05.pdf\"\n\t},\n\t\"breaking\": {\n\t\t\"title\": \"Breaking CAPTCHAs Without Using OCR\",\n\t\t\"date\": \"\",\n\t\t\"authors\": [\"Howard Yeend\"],\n\t\t\"editors\": [],\n\t\t\"etAl\": false,\n\t\t\"publisher\": \"\",\n\t\t\"href\": \"http:\/\/www.cs.berkeley.edu\/%7Emori\/gimpy\/gimpy.html\"\n\t},\n\t\"breakingocr\": {\n\t\t\"title\": \"Breaking CAPTCHAs Without Using OCR\",\n\t\t\"date\": \"\",\n\t\t\"authors\": [\"Howard Yeend\"],\n\t\t\"editors\": [],\n\t\t\"etAl\": false,\n\t\t\"publisher\": \"\",\n\t\t\"href\": \"http:\/\/www.puremango.co.uk\/cm_breaking_captcha_115.php\"\n\t},\n\t\"chafee\": {\n\t\t\"title\": \"17 USC 121, Limitations on exclusive rights: reproduction for blind or other people with disabilities (also known as the Chafee Amendment)\",\n\t\t\"date\": \"\",\n\t\t\"authors\": [],\n\t\t\"editors\": [],\n\t\t\"etAl\": false,\n\t\t\"publisher\": \"\",\n\t\t\"href\": \"https:\/\/www.copyright.gov\/title17\/92chap1.html\"\n\t},\n \"captcha-ocr\": {\n\t\"title\": \"CAPTCHA: Attacks and Weaknesses against OCR technology\",\n\t\"date\": \"2013\",\n\t\"authors\": [\n\t \"Silky Azad\", \"Kiran Jain\"],\n\t\"publisher\": \"Journal of Computer science and Technology\",\n\t\"etAl\": false,\n\t\"editors\": [],\n\t\"href\": \"https:\/\/computerresearch.org\/index.php\/computer\/article\/download\/368\/368\"\n },\n \"information-security\": {\n\t\"ti", "language":"Javascript", "repo_name":"w3c\/apa", "timestamp":"2025-05-22T22:01:01.006796", "split":"training" }, { "task":"code_generation", "problem_title":"phishing in Javascript", "problem_description":"Real implementation of phishing in Javascript fetched from GitHub.", "sample_solution":"'use strict';\n\nconst fs = require('fs-extra');\nconst debug = require('debug')('app');\nconst express = require('express');\nconst csp = require('express-csp-header');\nconst frameguard = require('frameguard');\nconst xssFilter = require('x-xss-protection');\nconst bodyParser = require('body-parser');\nconst url = require('url');\nconst dateFormat = require('dateformat');\nconst {fork} = require('child_process');\nconst download = require('download-file');\nconst rimraf = require('rimraf');\nconst phishingDetector = require('eth-phishing-detect\/src\/detector');\nconst crypto = require(\"crypto\");\nconst request = require('request');\nconst app = express();\nconst config = require('.\/config');\nconst check = require('.\/_utils\/webcheck.js');\nconst lookup = require('.\/_utils\/lookup.js');\n\n\nlet default_template = fs.readFileSync('.\/_layouts\/default.html', 'utf8');\nlet cache;\nlet updating_now = false;\nlet icon_warnings = [];\nvar older_cache_time;\n\n\nif('perform_dns_lookup' in config && config.perform_dns_lookup === false) {\n default_template = default_template.replace(\"{{ config.perform_dns_lookup }}\", \"