Arif571 commited on
Commit
ef4a4b4
·
verified ·
1 Parent(s): c5846ce

Singularity Update: 1770276830

Browse files
.gitattributes CHANGED
@@ -147,3 +147,9 @@ data/MITRE_ATTACK.jsonl filter=lfs diff=lfs merge=lfs -text
147
  data/OWASP_ASVS.jsonl filter=lfs diff=lfs merge=lfs -text
148
  data/PEACH_FUZZER.jsonl filter=lfs diff=lfs merge=lfs -text
149
  data/SYZKALLER.jsonl filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
147
  data/OWASP_ASVS.jsonl filter=lfs diff=lfs merge=lfs -text
148
  data/PEACH_FUZZER.jsonl filter=lfs diff=lfs merge=lfs -text
149
  data/SYZKALLER.jsonl filter=lfs diff=lfs merge=lfs -text
150
+ data/BOTAN.jsonl filter=lfs diff=lfs merge=lfs -text
151
+ data/HASHCAT.jsonl filter=lfs diff=lfs merge=lfs -text
152
+ data/JOHN_THE_RIPPER.jsonl filter=lfs diff=lfs merge=lfs -text
153
+ data/OPENSSL.jsonl filter=lfs diff=lfs merge=lfs -text
154
+ data/PYCRYPTODOME.jsonl filter=lfs diff=lfs merge=lfs -text
155
+ data/WOLFSSL.jsonl filter=lfs diff=lfs merge=lfs -text
data/ART_IBM.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/AUG_LY.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/BCRYPT.jsonl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'BCRYPT' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: noxfile.py\n<|im_end|>\n<|im_start|>assistant\nREPO: BCRYPT\nCODE:\nimport nox\n\nnox.options.reuse_existing_virtualenvs = True\nnox.options.default_venv_backend = \"uv|virtualenv\"\n\n\n@nox.session\ndef tests(session: nox.Session) -> None:\n session.install(\"coverage\")\n session.install(\".[tests]\")\n\n session.run(\n \"coverage\", \"run\", \"-m\", \"pytest\", \"--strict-markers\", *session.posargs\n )\n session.run(\"coverage\", \"combine\")\n session.run(\"coverage\", \"report\", \"-m\", \"--fail-under\", \"100\")\n\n\n@nox.session\ndef pep8(session: nox.Session) -> None:\n session.install(\"ruff\")\n\n session.run(\"ruff\", \"check\", \".\")\n session.run(\"ruff\", \"format\", \"--check\", \".\")\n\n\n@nox.session\ndef mypy(session: nox.Session) -> None:\n session.install(\"mypy\")\n session.install(\".[tests]\")\n\n session.run(\"mypy\", \"tests/\")\n\n\n@nox.session\ndef packaging(session: nox.Session) -> None:\n session.install(\"setuptools-rust\", \"check-manifest\", \"readme_renderer\")\n\n session.run(\"check-manifest\")\n session.run(\n \"python3\", \"-m\", \"readme_renderer\", \"README.rst\", \"-o\", \"/dev/null\"\n )\n\n<|im_end|>"}
2
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'BCRYPT' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: release.py\n<|im_end|>\n<|im_start|>assistant\nREPO: BCRYPT\nCODE:\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport subprocess\n\nimport click\n\n\ndef run(*args, **kwargs):\n print(f\"[running] {list(args)}\")\n subprocess.check_call(list(args), **kwargs)\n\n\n@click.command()\n@click.argument(\"version\")\ndef release(version):\n \"\"\"\n ``version`` should be a string like '0.4' or '1.0'.\n \"\"\"\n run(\"git\", \"tag\", \"-s\", version, \"-m\", f\"{version} release\")\n run(\"git\", \"push\", \"--tags\", \"git@github.com:pyca/bcrypt.git\")\n\n\nif __name__ == \"__main__\":\n release()\n\n<|im_end|>"}
3
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'BCRYPT' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: src/_bcrypt/src/lib.rs\n<|im_end|>\n<|im_start|>assistant\nREPO: BCRYPT\nCODE:\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#![deny(rust_2018_idioms)]\n\nuse base64::Engine;\nuse pyo3::types::PyBytesMethods;\nuse pyo3::PyTypeInfo;\nuse std::convert::TryInto;\nuse std::ffi::CString;\nuse std::io::Write;\nuse subtle::ConstantTimeEq;\n\npub const BASE64_ENGINE: base64::engine::GeneralPurpose = base64::engine::GeneralPurpose::new(\n &base64::alphabet::BCRYPT,\n base64::engine::general_purpose::NO_PAD,\n);\n\n#[pyo3::pyfunction]\n#[pyo3(signature = (rounds=12, prefix=None), text_signature = \"(rounds=12, prefix=b'2b')\")]\nfn gensalt<'p>(\n py: pyo3::Python<'p>,\n rounds: u16,\n prefix: Option<&[u8]>,\n) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {\n let prefix = prefix.unwrap_or(b\"2b\");\n\n if prefix != b\"2a\" && prefix != b\"2b\" {\n return Err(pyo3::exceptions::PyValueError::new_err(\n \"Supported prefixes are b'2a' or b'2b'\",\n ));\n }\n\n if !(4..=31).contains(&rounds) {\n return Err(pyo3::exceptions::PyValueError::new_err(\"Invalid rounds\"));\n }\n\n let mut salt = [0; 16];\n getrandom::fill(&mut salt).unwrap();\n\n let encoded_salt = BASE64_ENGINE.encode(salt);\n\n pyo3::types::PyBytes::new_with(\n py,\n 1 + prefix.len() + 1 + 2 + 1 + encoded_salt.len(),\n |mut b| {\n write!(b, \"$\").unwrap();\n b.write_all(prefix).unwrap();\n write!(b, \"$\").unwrap();\n write!(b, \"{:02.2}\", rounds).unwrap();\n write!(b, \"$\").unwrap();\n b.write_all(encoded_salt.as_bytes()).unwrap();\n\n Ok(())\n },\n )\n}\n\n#[pyo3::pyfunction]\nfn hashpw<'p>(\n py: pyo3::Python<'p>,\n password: &[u8],\n salt: &[u8],\n) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {\n // bcrypt originally suffered from a wraparound bug:\n // http://www.openwall.com/lists/oss-security/2012/01/02/4\n // This bug was corrected in the OpenBSD source by truncating inputs to 72\n // bytes on the updated prefix $2b$, but leaving $2a$ unchanged for\n // compatibility. However, pyca/bcrypt 2.0.0 *did* correctly truncate inputs\n // on $2a$, so we do it here to preserve compatibility with 2.0.0\n // Silent truncation is _probably_ not the best idea, even if the \"original\"\n // OpenBSD implementation did/does this.\n // We prefer to raise a ValueError in this case - if the user _wants_ to truncate,\n // they can always do so manually by passing s[:72] instead of s into hashpw().\n\n if password.len() > 72 {\n return Err(pyo3::exceptions::PyValueError::new_err(\n \"password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72])\",\n ));\n }\n\n // salt here is not just the salt bytes, but rather an encoded value\n // containing a version number, number of rounds, and the salt.\n // Should be [prefix, cost, hash]. This logic is copied from `bcrypt`\n let [raw_version, raw_cost, remainder]: [&[u8]; 3] = salt\n .split(|&b| b == b'$')\n .filter(|s| !s.is_empty())\n .collect::<Vec<_>>()\n .try_into()\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?;\n\n let version = match raw_version {\n b\"2y\" => bcrypt::Version::TwoY,\n b\"2b\" => bcrypt::Version::TwoB,\n b\"2a\" => bcrypt::Version::TwoA,\n b\"2x\" => bcrypt::Version::TwoX,\n _ => {\n return Err(pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"));\n }\n };\n let cost = std::str::from_utf8(raw_cost)\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?\n .parse::<u32>()\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?;\n\n if remainder.len() < 22 {\n return Err(pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"));\n }\n\n // The last component can contain either just the salt, or the salt and\n // the result hash, depending on if the `salt` value come from `hashpw` or\n // `gensalt`.\n let raw_salt = BASE64_ENGINE\n .decode(&remainder[..22])\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?\n .try_into()\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?;\n\n let hashed = py\n .detach(|| bcrypt::hash_with_salt(password, cost, raw_salt))\n .map_err(|_| pyo3::exceptions::PyValueError::new_err(\"Invalid salt\"))?;\n Ok(pyo3::types::PyBytes::new(\n py,\n hashed.format_for_version(version).as_bytes(),\n ))\n}\n\n#[pyo3::pyfunction]\nfn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo3::PyResult<bool> {\n Ok(hashpw(py, password, hashed_password)?\n .as_bytes()\n .ct_eq(hashed_password)\n .into())\n}\n\n#[pyo3::pyfunction]\n#[pyo3(signature = (password, salt, desired_key_bytes, rounds, ignore_few_rounds=false))]\nfn kdf<'p>(\n py: pyo3::Python<'p>,\n password: &[u8],\n salt: &[u8],\n desired_key_bytes: usize,\n rounds: u32,\n ignore_few_rounds: bool,\n) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {\n if password.is_empty() || salt.is_empty() {\n return Err(pyo3::exceptions::PyValueError::new_err(\n \"password and salt must not be empty\",\n ));\n }\n\n if desired_key_bytes == 0 || desired_key_bytes > 512 {\n return Err(pyo3::exceptions::PyValueError::new_err(\n \"desired_key_bytes must be 1-512\",\n ));\n }\n\n if rounds < 1 {\n return Err(pyo3::exceptions::PyValueError::new_err(\n \"rounds must be 1 or more\",\n ));\n }\n\n if rounds < 50 && !ignore_few_rounds {\n // They probably think bcrypt.kdf()'s rounds parameter is logarithmic,\n // expecting this value to be slow enough (it probably would be if this\n // were bcrypt). Emit a warning.\n pyo3::PyErr::warn(\n py,\n &pyo3::exceptions::PyUserWarning::type_object(py),\n &CString::new(format!(\"Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2.\")).unwrap(),\n 3\n )?;\n }\n\n pyo3::types::PyBytes::new_with(py, desired_key_bytes, |output| {\n py.detach(|| {\n bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, output).unwrap();\n });\n Ok(())\n })\n}\n\n#[pyo3::pymodule(gil_used = false)]\nmod _bcrypt {\n use pyo3::types::PyModuleMethods;\n\n #[pymodule_export]\n use super::{checkpw, gensalt, hashpw, kdf};\n\n // Not yet possible to add constants declaratively.\n #[pymodule_init]\n fn init(m: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {\n m.add(\"__title__\", \"bcrypt\")?;\n m.add(\n \"__summary__\",\n \"Modern(-ish) password hashing for your software and your servers\",\n )?;\n m.add(\"__uri__\", \"https://github.com/pyca/bcrypt/\")?;\n\n // When updating this, also update pyproject.toml\n // This isn't named __version__ because passlib treats the existence of\n // that attribute as proof that we're a different module\n m.add(\"__version_ex__\", \"5.0.0\")?;\n\n let author = \"The Python Cryptographic Authority developers\";\n m.add(\"__author__\", author)?;\n m.add(\"__email__\", \"cryptography-dev@python.org\")?;\n\n m.add(\"__license__\", \"Apache License, Version 2.0\")?;\n m.add(\"__copyright__\", format!(\"Copyright 2013-2025 {author}\"))?;\n\n Ok(())\n }\n}\n\n<|im_end|>"}
4
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'BCRYPT' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: src/bcrypt/__init__.py\n<|im_end|>\n<|im_start|>assistant\nREPO: BCRYPT\nCODE:\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom ._bcrypt import (\n __author__,\n __copyright__,\n __email__,\n __license__,\n __summary__,\n __title__,\n __uri__,\n checkpw,\n gensalt,\n hashpw,\n kdf,\n)\nfrom ._bcrypt import (\n __version_ex__ as __version__,\n)\n\n__all__ = [\n \"__author__\",\n \"__copyright__\",\n \"__email__\",\n \"__license__\",\n \"__summary__\",\n \"__title__\",\n \"__uri__\",\n \"__version__\",\n \"checkpw\",\n \"gensalt\",\n \"hashpw\",\n \"kdf\",\n]\n\n<|im_end|>"}
5
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'BCRYPT' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: tests/test_bcrypt.py\n<|im_end|>\n<|im_start|>assistant\nREPO: BCRYPT\nCODE:\nimport uuid\nfrom concurrent.futures import ThreadPoolExecutor\n\nimport pytest\n\nimport bcrypt\n\n_test_vectors = [\n (\n b\"Kk4DQuMMfZL9o\",\n b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\",\n b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO026BWLIoQMD/TXg5uZV.0P.uO8m3YEm\",\n ),\n (\n b\"9IeRXmnGxMYbs\",\n b\"$2b$04$pQ7gRO7e6wx/936oXhNjrO\",\n b\"$2b$04$pQ7gRO7e6wx/936oXhNjrOUNOHL1D0h1N2IDbJZYs.1ppzSof6SPy\",\n ),\n (\n b\"xVQVbwa1S0M8r\",\n b\"$2b$04$SQe9knOzepOVKoYXo9xTte\",\n b\"$2b$04$SQe9knOzepOVKoYXo9xTteNYr6MBwVz4tpriJVe3PNgYufGIsgKcW\",\n ),\n (\n b\"Zfgr26LWd22Za\",\n b\"$2b$04$eH8zX.q5Q.j2hO1NkVYJQO\",\n b\"$2b$04$eH8zX.q5Q.j2hO1NkVYJQOM6KxntS/ow3.YzVmFrE4t//CoF4fvne\",\n ),\n (\n b\"Tg4daC27epFBE\",\n b\"$2b$04$ahiTdwRXpUG2JLRcIznxc.\",\n b\"$2b$04$ahiTdwRXpUG2JLRcIznxc.s1.ydaPGD372bsGs8NqyYjLY1inG5n2\",\n ),\n (\n b\"xhQPMmwh5ALzW\",\n b\"$2b$04$nQn78dV0hGHf5wUBe0zOFu\",\n b\"$2b$04$nQn78dV0hGHf5wUBe0zOFu8n07ZbWWOKoGasZKRspZxtt.vBRNMIy\",\n ),\n (\n b\"59je8h5Gj71tg\",\n b\"$2b$04$cvXudZ5ugTg95W.rOjMITu\",\n b\"$2b$04$cvXudZ5ugTg95W.rOjMITuM1jC0piCl3zF5cmGhzCibHZrNHkmckG\",\n ),\n (\n b\"wT4fHJa2N9WSW\",\n b\"$2b$04$YYjtiq4Uh88yUsExO0RNTu\",\n b\"$2b$04$YYjtiq4Uh88yUsExO0RNTuEJ.tZlsONac16A8OcLHleWFjVawfGvO\",\n ),\n (\n b\"uSgFRnQdOgm4S\",\n b\"$2b$04$WLTjgY/pZSyqX/fbMbJzf.\",\n b\"$2b$04$WLTjgY/pZSyqX/fbMbJzf.qxCeTMQOzgL.CimRjMHtMxd/VGKojMu\",\n ),\n (\n b\"tEPtJZXur16Vg\",\n b\"$2b$04$2moPs/x/wnCfeQ5pCheMcu\",\n b\"$2b$04$2moPs/x/wnCfeQ5pCheMcuSJQ/KYjOZG780UjA/SiR.KsYWNrC7SG\",\n ),\n (\n b\"vvho8C6nlVf9K\",\n b\"$2b$04$HrEYC/AQ2HS77G78cQDZQ.\",\n b\"$2b$04$HrEYC/AQ2HS77G78cQDZQ.r44WGcruKw03KHlnp71yVQEwpsi3xl2\",\n ),\n (\n b\"5auCCY9by0Ruf\",\n b\"$2b$04$vVYgSTfB8KVbmhbZE/k3R.\",\n b\"$2b$04$vVYgSTfB8KVbmhbZE/k3R.ux9A0lJUM4CZwCkHI9fifke2.rTF7MG\",\n ),\n (\n b\"GtTkR6qn2QOZW\",\n b\"$2b$04$JfoNrR8.doieoI8..F.C1O\",\n b\"$2b$04$JfoNrR8.doieoI8..F.C1OQgwE3uTeuardy6lw0AjALUzOARoyf2m\",\n ),\n (\n b\"zKo8vdFSnjX0f\",\n b\"$2b$04$HP3I0PUs7KBEzMBNFw7o3O\",\n b\"$2b$04$HP3I0PUs7KBEzMBNFw7o3O7f/uxaZU7aaDot1quHMgB2yrwBXsgyy\",\n ),\n (\n b\"I9VfYlacJiwiK\",\n b\"$2b$04$xnFVhJsTzsFBTeP3PpgbMe\",\n b\"$2b$04$xnFVhJsTzsFBTeP3PpgbMeMREb6rdKV9faW54Sx.yg9plf4jY8qT6\",\n ),\n (\n b\"VFPO7YXnHQbQO\",\n b\"$2b$04$WQp9.igoLqVr6Qk70mz6xu\",\n b\"$2b$04$WQp9.igoLqVr6Qk70mz6xuRxE0RttVXXdukpR9N54x17ecad34ZF6\",\n ),\n (\n b\"VDx5BdxfxstYk\",\n b\"$2b$04$xgZtlonpAHSU/njOCdKztO\",\n b\"$2b$04$xgZtlonpAHSU/njOCdKztOPuPFzCNVpB4LGicO4/OGgHv.uKHkwsS\",\n ),\n (\n b\"dEe6XfVGrrfSH\",\n b\"$2b$04$2Siw3Nv3Q/gTOIPetAyPr.\",\n b\"$2b$04$2Siw3Nv3Q/gTOIPetAyPr.GNj3aO0lb1E5E9UumYGKjP9BYqlNWJe\",\n ),\n (\n b\"cTT0EAFdwJiLn\",\n b\"$2b$04$7/Qj7Kd8BcSahPO4khB8me\",\n b\"$2b$04$7/Qj7Kd8BcSahPO4khB8me4ssDJCW3r4OGYqPF87jxtrSyPj5cS5m\",\n ),\n (\n b\"J8eHUDuxBB520\",\n b\"$2b$04$VvlCUKbTMjaxaYJ.k5juoe\",\n b\"$2b$04$VvlCUKbTMjaxaYJ.k5juoecpG/7IzcH1AkmqKi.lIZMVIOLClWAk.\",\n ),\n (\n b\"U*U\",\n b\"$2a$05$CCCCCCCCCCCCCCCCCCCCC.\",\n b\"$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW\",\n ),\n (\n b\"U*U*\",\n b\"$2a$05$CCCCCCCCCCCCCCCCCCCCC.\",\n b\"$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK\",\n ),\n (\n b\"U*U*U\",\n b\"$2a$05$XXXXXXXXXXXXXXXXXXXXXO\",\n b\"$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4a\",\n ),\n (\n b\"\\xa3\",\n b\"$2a$05$/OK.fbVrR/bpIqNJ5ianF.\",\n b\"$2a$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq\",\n ),\n (\n b\"}>\\xb3\\xfe\\xf1\\x8b\\xa0\\xe6(\\xa2Lzq\\xc3P\\x7f\\xcc\\xc8b{\\xf9\\x14\\xf6\"\n b\"\\xf6`\\x81G5\\xec\\x1d\\x87\\x10\\xbf\\xa7\\xe1}I7 \\x96\\xdfc\\xf2\\xbf\\xb3Vh\"\n b\"\\xdfM\\x88q\\xf7\\xff\\x1b\\x82~z\\x13\\xdd\\xe9\\x84\\x00\\xdd4\",\n b\"$2b$10$keO.ZZs22YtygVF6BLfhGO\",\n b\"$2b$10$keO.ZZs22YtygVF6BLfhGOI/JjshJYPp8DZsUtym6mJV2Eha2Hdd.\",\n ),\n (\n b\"g7\\r\\x01\\xf3\\xd4\\xd0\\xa9JB^\\x18\\x007P\\xb2N\\xc7\\x1c\\xee\\x87&\\x83C\"\n b\"\\x8b\\xe8\\x18\\xc5>\\x86\\x14/\\xd6\\xcc\\x1cJ\\xde\\xd7ix\\xeb\\xdeO\\xef\"\n b\"\\xe1i\\xac\\xcb\\x03\\x96v1' \\xd6@.m\\xa5!\\xa0\\xef\\xc0(\",\n b\"$2a$04$tecY.9ylRInW/rAAzXCXPO\",\n b\"$2a$04$tecY.9ylRInW/rAAzXCXPOOlyYeCNzmNTzPDNSIFztFMKbvs/s5XG\",\n ),\n]\n\n_2y_test_vectors = [\n (\n b\"\\xa3\",\n b\"$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq\",\n b\"$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq\",\n ),\n (\n b\"\\xff\\xff\\xa3\",\n b\"$2y$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e\",\n b\"$2y$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e\",\n ),\n]\n\n\ndef test_gensalt_basic():\n salt = bcrypt.gensalt()\n assert salt.startswith(b\"$2b$12$\")\n\n\n@pytest.mark.parametrize(\n (\"rounds\", \"expected_prefix\"),\n [\n (4, b\"$2b$04$\"),\n (5, b\"$2b$05$\"),\n (6, b\"$2b$06$\"),\n (7, b\"$2b$07$\"),\n (8, b\"$2b$08$\"),\n (9, b\"$2b$09$\"),\n (10, b\"$2b$10$\"),\n (11, b\"$2b$11$\"),\n (12, b\"$2b$12$\"),\n (13, b\"$2b$13$\"),\n (14, b\"$2b$14$\"),\n (15, b\"$2b$15$\"),\n (16, b\"$2b$16$\"),\n (17, b\"$2b$17$\"),\n (18, b\"$2b$18$\"),\n (19, b\"$2b$19$\"),\n (20, b\"$2b$20$\"),\n (21, b\"$2b$21$\"),\n (22, b\"$2b$22$\"),\n (23, b\"$2b$23$\"),\n (24, b\"$2b$24$\"),\n ],\n)\ndef test_gensalt_rounds_valid(rounds, expected_prefix):\n salt = bcrypt.gensalt(rounds)\n\n assert salt.startswith(expected_prefix)\n\n\n@pytest.mark.parametrize(\"rounds\", list(range(1, 4)))\ndef test_gensalt_rounds_invalid(rounds):\n with pytest.raises(ValueError):\n bcrypt.gensalt(rounds)\n\n\ndef test_gensalt_bad_prefix():\n with pytest.raises(ValueError):\n bcrypt.gensalt(prefix=b\"bad\")\n\n\ndef test_gensalt_2a_prefix():\n salt = bcrypt.gensalt(prefix=b\"2a\")\n assert salt.startswith(b\"$2a$12$\")\n\n\n@pytest.mark.parametrize((\"password\", \"salt\", \"hashed\"), _test_vectors)\ndef test_hashpw_new(password, salt, hashed):\n assert bcrypt.hashpw(password, salt) == hashed\n\n\n@pytest.mark.parametrize((\"password\", \"salt\", \"hashed\"), _test_vectors)\ndef test_checkpw(password, salt, hashed):\n assert bcrypt.checkpw(password, hashed) is True\n\n\n@pytest.mark.parametrize((\"password\", \"salt\", \"hashed\"), _test_vectors)\ndef test_hashpw_existing(password, salt, hashed):\n assert bcrypt.hashpw(password, hashed) == hashed\n\n\n@pytest.mark.parametrize((\"password\", \"hashed\", \"expected\"), _2y_test_vectors)\ndef test_hashpw_2y_prefix(password, hashed, expected):\n assert bcrypt.hashpw(password, hashed) == expected\n\n\n@pytest.mark.parametrize((\"password\", \"hashed\", \"expected\"), _2y_test_vectors)\ndef test_checkpw_2y_prefix(password, hashed, expected):\n assert bcrypt.checkpw(password, hashed) is True\n\n\n@pytest.mark.parametrize(\n (\"pw_length\", \"should_raise\"),\n [\n (71, False),\n (72, False),\n (73, True),\n ],\n)\ndef test_hashpw_raises_correctly_for_long_passwords(pw_length, should_raise):\n password = b\"\\xaa\" * pw_length\n salt = b\"$2b$04$xnFVhJsTzsFBTeP3PpgbMe\"\n\n if should_raise:\n with pytest.raises(ValueError):\n bcrypt.hashpw(password, salt)\n else:\n bcrypt.hashpw(password, salt)\n\n\ndef test_hashpw_invalid():\n with pytest.raises(ValueError):\n bcrypt.hashpw(b\"password\", b\"$2z$04$cVWp4XaNU8a4v1uMRum2SO\")\n\n\ndef test_checkpw_wrong_password():\n assert (\n bcrypt.checkpw(\n b\"badpass\",\n b\"$2b$04$2Siw3Nv3Q/gTOIPetAyPr.GNj3aO0lb1E5E9UumYGKjP9BYqlNWJe\",\n )\n is False\n )\n\n\ndef test_checkpw_bad_salt():\n with pytest.raises(ValueError):\n bcrypt.checkpw(\n b\"badpass\",\n b\"$2b$04$?Siw3Nv3Q/gTOIPetAyPr.GNj3aO0lb1E5E9UumYGKjP9BYqlNWJe\",\n )\n with pytest.raises(ValueError):\n bcrypt.checkpw(\n b\"password\",\n b\"$2b$3$mdEQPMOtfPX.WGZNXgF66OhmBlOGKEd66SQ7DyJPGucYYmvTJYviy\",\n )\n with pytest.raises(ValueError):\n bcrypt.checkpw(b\"password\", b\"$2b$12$incorrect\")\n\n\ndef test_checkpw_str_password():\n with pytest.raises(TypeError):\n bcrypt.checkpw(\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\") # type: ignore[arg-type]\n\n\ndef test_checkpw_str_salt():\n with pytest.raises(TypeError):\n bcrypt.checkpw(b\"password\", \"$2b$04$cVWp4XaNU8a4v1uMRum2SO\") # type: ignore[arg-type]\n\n\ndef test_hashpw_str_password():\n with pytest.raises(TypeError):\n bcrypt.hashpw(\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\") # type: ignore[arg-type]\n\n\ndef test_hashpw_str_salt():\n with pytest.raises(TypeError):\n bcrypt.hashpw(b\"password\", \"$2b$04$cVWp4XaNU8a4v1uMRum2SO\") # type: ignore[arg-type]\n\n\ndef test_checkpw_nul_byte():\n bcrypt.checkpw(\n b\"abc\\0def\",\n b\"$2b$04$2Siw3Nv3Q/gTOIPetAyPr.GNj3aO0lb1E5E9UumYGKjP9BYqlNWJe\",\n )\n\n with pytest.raises(ValueError):\n bcrypt.checkpw(\n b\"abcdef\",\n b\"$2b$04$2S\\0w3Nv3Q/gTOIPetAyPr.GNj3aO0lb1E5E9UumYGKjP9BYqlNWJe\",\n )\n\n\ndef test_hashpw_nul_byte():\n salt = bcrypt.gensalt(4)\n hashed = bcrypt.hashpw(b\"abc\\0def\", salt)\n assert bcrypt.checkpw(b\"abc\\0def\", hashed)\n # assert that we are sensitive to changes in the password after the first\n # null byte:\n assert not bcrypt.checkpw(b\"abc\\0deg\", hashed)\n assert not bcrypt.checkpw(b\"abc\\0def\\0\", hashed)\n assert not bcrypt.checkpw(b\"abc\\0def\\0\\0\", hashed)\n\n\ndef test_checkpw_extra_data():\n salt = bcrypt.gensalt(4)\n hashed = bcrypt.hashpw(b\"abc\", salt)\n\n assert bcrypt.checkpw(b\"abc\", hashed)\n assert bcrypt.checkpw(b\"abc\", hashed + b\"extra\") is False\n assert bcrypt.checkpw(b\"abc\", hashed[:-10]) is False\n\n\n@pytest.mark.parametrize(\n (\"rounds\", \"password\", \"salt\", \"expected\"),\n [\n [\n 4,\n b\"password\",\n b\"salt\",\n b\"\\x5b\\xbf\\x0c\\xc2\\x93\\x58\\x7f\\x1c\\x36\\x35\\x55\\x5c\\x27\\x79\\x65\\x98\"\n b\"\\xd4\\x7e\\x57\\x90\\x71\\xbf\\x42\\x7e\\x9d\\x8f\\xbe\\x84\\x2a\\xba\\x34\\xd9\",\n ],\n [\n 4,\n b\"password\",\n b\"\\x00\",\n b\"\\xc1\\x2b\\x56\\x62\\x35\\xee\\xe0\\x4c\\x21\\x25\\x98\\x97\\x0a\\x57\\x9a\\x67\",\n ],\n [\n 4,\n b\"\\x00\",\n b\"salt\",\n b\"\\x60\\x51\\xbe\\x18\\xc2\\xf4\\xf8\\x2c\\xbf\\x0e\\xfe\\xe5\\x47\\x1b\\x4b\\xb9\",\n ],\n [\n # nul bytes in password and string\n 4,\n b\"password\\x00\",\n b\"salt\\x00\",\n b\"\\x74\\x10\\xe4\\x4c\\xf4\\xfa\\x07\\xbf\\xaa\\xc8\\xa9\\x28\\xb1\\x72\\x7f\\xac\"\n b\"\\x00\\x13\\x75\\xe7\\xbf\\x73\\x84\\x37\\x0f\\x48\\xef\\xd1\\x21\\x74\\x30\\x50\",\n ],\n [\n 4,\n b\"pass\\x00wor\",\n b\"sa\\0l\",\n b\"\\xc2\\xbf\\xfd\\x9d\\xb3\\x8f\\x65\\x69\\xef\\xef\\x43\\x72\\xf4\\xde\\x83\\xc0\",\n ],\n [\n 4,\n b\"pass\\x00word\",\n b\"sa\\0lt\",\n b\"\\x4b\\xa4\\xac\\x39\\x25\\xc0\\xe8\\xd7\\xf0\\xcd\\xb6\\xbb\\x16\\x84\\xa5\\x6f\",\n ],\n [\n # bigger key\n 8,\n b\"password\",\n b\"salt\",\n b\"\\xe1\\x36\\x7e\\xc5\\x15\\x1a\\x33\\xfa\\xac\\x4c\\xc1\\xc1\\x44\\xcd\\x23\\xfa\"\n b\"\\x15\\xd5\\x54\\x84\\x93\\xec\\xc9\\x9b\\x9b\\x5d\\x9c\\x0d\\x3b\\x27\\xbe\\xc7\"\n b\"\\x62\\x27\\xea\\x66\\x08\\x8b\\x84\\x9b\\x20\\xab\\x7a\\xa4\\x78\\x01\\x02\\x46\"\n b\"\\xe7\\x4b\\xba\\x51\\x72\\x3f\\xef\\xa9\\xf9\\x47\\x4d\\x65\\x08\\x84\\x5e\\x8d\",\n ],\n [\n # more rounds\n 42,\n b\"password\",\n b\"salt\",\n b\"\\x83\\x3c\\xf0\\xdc\\xf5\\x6d\\xb6\\x56\\x08\\xe8\\xf0\\xdc\\x0c\\xe8\\x82\\xbd\",\n ],\n [\n # longer password\n 8,\n b\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do\"\n b\" eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut \"\n b\"enim ad minim veniam, quis nostrud exercitation ullamco laboris \"\n b\"nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor \"\n b\"in reprehenderit in voluptate velit esse cillum dolore eu fugiat\"\n b\" nulla pariatur. Excepteur sint occaecat cupidatat non proident,\"\n b\" sunt in culpa qui officia deserunt mollit anim id est laborum.\",\n b\"salis\\x00\",\n b\"\\x10\\x97\\x8b\\x07\\x25\\x3d\\xf5\\x7f\\x71\\xa1\\x62\\xeb\\x0e\\x8a\\xd3\\x0a\",\n ],\n [\n # \"unicode\"\n 8,\n b\"\\x0d\\xb3\\xac\\x94\\xb3\\xee\\x53\\x28\\x4f\\x4a\\x22\\x89\\x3b\\x3c\\x24\\xae\",\n b\"\\x3a\\x62\\xf0\\xf0\\xdb\\xce\\xf8\\x23\\xcf\\xcc\\x85\\x48\\x56\\xea\\x10\\x28\",\n b\"\\x20\\x44\\x38\\x17\\x5e\\xee\\x7c\\xe1\\x36\\xc9\\x1b\\x49\\xa6\\x79\\x23\\xff\",\n ],\n [\n # very large key\n 8,\n b\"\\x0d\\xb3\\xac\\x94\\xb3\\xee\\x53\\x28\\x4f\\x4a\\x22\\x89\\x3b\\x3c\\x24\\xae\",\n b\"\\x3a\\x62\\xf0\\xf0\\xdb\\xce\\xf8\\x23\\xcf\\xcc\\x85\\x48\\x56\\xea\\x10\\x28\",\n b\"\\x20\\x54\\xb9\\xff\\xf3\\x4e\\x37\\x21\\x44\\x03\\x34\\x74\\x68\\x28\\xe9\\xed\"\n b\"\\x38\\xde\\x4b\\x72\\xe0\\xa6\\x9a\\xdc\\x17\\x0a\\x13\\xb5\\xe8\\xd6\\x46\\x38\"\n b\"\\x5e\\xa4\\x03\\x4a\\xe6\\xd2\\x66\\x00\\xee\\x23\\x32\\xc5\\xed\\x40\\xad\\x55\"\n b\"\\x7c\\x86\\xe3\\x40\\x3f\\xbb\\x30\\xe4\\xe1\\xdc\\x1a\\xe0\\x6b\\x99\\xa0\\x71\"\n b\"\\x36\\x8f\\x51\\x8d\\x2c\\x42\\x66\\x51\\xc9\\xe7\\xe4\\x37\\xfd\\x6c\\x91\\x5b\"\n b\"\\x1b\\xbf\\xc3\\xa4\\xce\\xa7\\x14\\x91\\x49\\x0e\\xa7\\xaf\\xb7\\xdd\\x02\\x90\"\n b\"\\xa6\\x78\\xa4\\xf4\\x41\\x12\\x8d\\xb1\\x79\\x2e\\xab\\x27\\x76\\xb2\\x1e\\xb4\"\n b\"\\x23\\x8e\\x07\\x15\\xad\\xd4\\x12\\x7d\\xff\\x44\\xe4\\xb3\\xe4\\xcc\\x4c\\x4f\"\n b\"\\x99\\x70\\x08\\x3f\\x3f\\x74\\xbd\\x69\\x88\\x73\\xfd\\xf6\\x48\\x84\\x4f\\x75\"\n b\"\\xc9\\xbf\\x7f\\x9e\\x0c\\x4d\\x9e\\x5d\\x89\\xa7\\x78\\x39\\x97\\x49\\x29\\x66\"\n b\"\\x61\\x67\\x07\\x61\\x1c\\xb9\\x01\\xde\\x31\\xa1\\x97\\x26\\xb6\\xe0\\x8c\\x3a\"\n b\"\\x80\\x01\\x66\\x1f\\x2d\\x5c\\x9d\\xcc\\x33\\xb4\\xaa\\x07\\x2f\\x90\\xdd\\x0b\"\n b\"\\x3f\\x54\\x8d\\x5e\\xeb\\xa4\\x21\\x13\\x97\\xe2\\xfb\\x06\\x2e\\x52\\x6e\\x1d\"\n b\"\\x68\\xf4\\x6a\\x4c\\xe2\\x56\\x18\\x5b\\x4b\\xad\\xc2\\x68\\x5f\\xbe\\x78\\xe1\"\n b\"\\xc7\\x65\\x7b\\x59\\xf8\\x3a\\xb9\\xab\\x80\\xcf\\x93\\x18\\xd6\\xad\\xd1\\xf5\"\n b\"\\x93\\x3f\\x12\\xd6\\xf3\\x61\\x82\\xc8\\xe8\\x11\\x5f\\x68\\x03\\x0a\\x12\\x44\",\n ],\n [\n # UTF-8 Greek characters \"odysseus\" / \"telemachos\"\n 8,\n b\"\\xe1\\xbd\\x88\\xce\\xb4\\xcf\\x85\\xcf\\x83\\xcf\\x83\\xce\\xb5\\xcf\\x8d\\xcf\\x82\",\n b\"\\xce\\xa4\\xce\\xb7\\xce\\xbb\\xce\\xad\\xce\\xbc\\xce\\xb1\\xcf\\x87\\xce\\xbf\"\n b\"\\xcf\\x82\",\n b\"\\x43\\x66\\x6c\\x9b\\x09\\xef\\x33\\xed\\x8c\\x27\\xe8\\xe8\\xf3\\xe2\\xd8\\xe6\",\n ],\n ],\n)\ndef test_kdf(rounds, password, salt, expected):\n derived = bcrypt.kdf(\n password, salt, len(expected), rounds, ignore_few_rounds=True\n )\n assert derived == expected\n\n\ndef test_kdf_str_password():\n with pytest.raises(TypeError):\n bcrypt.kdf(\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 10, 10) # type: ignore[arg-type]\n\n\ndef test_kdf_str_salt():\n with pytest.raises(TypeError):\n bcrypt.kdf(b\"password\", \"salt\", 10, 10) # type: ignore[arg-type]\n\n\ndef test_kdf_no_warn_rounds():\n bcrypt.kdf(b\"password\", b\"salt\", 10, 10, True)\n\n\ndef test_kdf_warn_rounds():\n with pytest.warns(UserWarning):\n bcrypt.kdf(b\"password\", b\"salt\", 10, 10)\n\n\n@pytest.mark.parametrize(\n (\"password\", \"salt\", \"desired_key_bytes\", \"rounds\", \"error\"),\n [\n (\"pass\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 10, 10, TypeError),\n (b\"password\", \"salt\", 10, 10, TypeError),\n (b\"\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 10, 10, ValueError),\n (b\"password\", b\"\", 10, 10, ValueError),\n (b\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 0, 10, ValueError),\n (b\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", -3, 10, OverflowError),\n (b\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 513, 10, ValueError),\n (b\"password\", b\"$2b$04$cVWp4XaNU8a4v1uMRum2SO\", 20, 0, ValueError),\n ],\n)\ndef test_invalid_params(password, salt, desired_key_bytes, rounds, error):\n with pytest.raises(error):\n bcrypt.kdf(password, salt, desired_key_bytes, rounds)\n\n\ndef test_multithreading():\n def create_user(pw):\n salt = bcrypt.gensalt(4)\n hash_ = bcrypt.hashpw(pw, salt)\n key = bcrypt.kdf(pw, salt, 32, 50)\n assert bcrypt.checkpw(pw, hash_)\n return (salt, hash_, key)\n\n user_creator = ThreadPoolExecutor(max_workers=4)\n pws = [uuid.uuid4().bytes for _ in range(50)]\n\n futures = [user_creator.submit(create_user, pw) for pw in pws]\n\n users = [future.result() for future in futures]\n\n for pw, (salt, hash_, key) in zip(pws, users):\n assert bcrypt.hashpw(pw, salt) == hash_\n assert bcrypt.checkpw(pw, hash_)\n assert bcrypt.kdf(pw, salt, 32, 50) == key\n\n<|im_end|>"}
data/BEROOT.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/BOTAN.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7cf4fd8160f5d8ec392d5a29e61d48ff1a7ad041d1ecdf059de7c09eb9a50db
3
+ size 12960198
data/CIPHERSCAN.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/CLEVERHANS.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/CRYPTOGRAPHY_PY.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/DEEPFOOL.jsonl CHANGED
@@ -1,4 +1,4 @@
1
- {"text": "<|im_start|>user\nAnalyze the file 'MATLAB/README.md' from repository 'DEEPFOOL'.\n<|im_end|>\n<|im_start|>assistant\nFILE: MATLAB/README.md\nSOURCE: DEEPFOOL\nCONTENT:\n# DeepFool\nDeepFool is a simple algorithm to find the minimum adversarial perturbations in deep networks\n\n__Note__: A Python implementation can be found [here](http://github.com/LTS4/universal/blob/master/python/deepfool.py).\n\n### adversarial_perturbation.m\n\nThis function implements the algorithm proposed in [[1]](http://arxiv.org/pdf/1511.04599) to find the adverasrial perturbation.\n\n### adversarial_DeepFool_matconvnet.m\n\nThis function is a wrapper to compute the adversarial perturbation for [MatConvNet](http://www.vlfeat.org/matconvnet/)'s models.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\n### adversarial_DeepFool_caffe.m\n\nThis function is a wrapper to compute the adversarial perturbation for [Caffe](http://caffe.berkeleyvision.org)'s models.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\nThe arguments for both wrappers are:\n\n- `x`: input image in `W*H*C` format\n- `net`: network model where the last layer (loss) is removed.\n- `opts`: a structure containing the following options:\n - `labels_limit`: limits the number of classes to test against (default = 10).\n - `overshoot`: used as a termination criterion to prevent vanishing updates (default = 0.02).\n - `max_iter`: maximum number of iterations (default = 100).\n - `norm_p`: determines which l_p norm to use (see [[1]](http://arxiv.org/pdf/1511.04599)) (default = 2).\n \n### demo_matconvnet.m\n\nA simple demo which computes the adversarial perturbation for an image from MNIST dataset for a LeNet classifier. The image is loaded from a standard IMDB file.\n\n### demo_caffe.m\n\nA simple demo which computes the adversarial perturbation for an image on CaffeNet classifier.\n\n## Reference\n[1] S. Moosavi-Dezfooli, A. Fawzi, P. Frossard:\n*DeepFool: a simple and accurate method to fool deep neural networks*. In Computer Vision and Pattern Recognition (CVPR \u201916), IEEE, 2016.\n\n<|im_end|>"}
2
- {"text": "<|im_start|>user\nAnalyze the file 'Python/README.md' from repository 'DEEPFOOL'.\n<|im_end|>\n<|im_start|>assistant\nFILE: Python/README.md\nSOURCE: DEEPFOOL\nCONTENT:\n# DeepFool\nDeepFool is a simple algorithm to find the minimum adversarial perturbations in deep networks\n\n### deepfool.py\n\nThis function implements the algorithm proposed in [[1]](http://arxiv.org/pdf/1511.04599) using PyTorch to find adversarial perturbations.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\nThe parameters of the function are:\n\n- `image`: Image of size `HxWx3d`\n- `net`: neural network (input: images, output: values of activation **BEFORE** softmax).\n- `num_classes`: limits the number of classes to test against, by default = 10.\n- `max_iter`: max number of iterations, by default = 50.\n\n### test_deepfool.py\n\nA simple demo which computes the adversarial perturbation for a test image from ImageNet dataset.\n\n## Reference\n[1] S. Moosavi-Dezfooli, A. Fawzi, P. Frossard:\n*DeepFool: a simple and accurate method to fool deep neural networks*. In Computer Vision and Pattern Recognition (CVPR \u201916), IEEE, 2016.\n\n<|im_end|>"}
3
- {"text": "<|im_start|>user\nAnalyze the file 'Python/deepfool.py' from repository 'DEEPFOOL'.\n<|im_end|>\n<|im_start|>assistant\nFILE: Python/deepfool.py\nSOURCE: DEEPFOOL\nCONTENT:\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch as torch\nimport copy\nfrom torch.autograd.gradcheck import zero_gradients\n\n\ndef deepfool(image, net, num_classes=10, overshoot=0.02, max_iter=50):\n\n \"\"\"\n :param image: Image of size HxWx3\n :param net: network (input: images, output: values of activation **BEFORE** softmax).\n :param num_classes: num_classes (limits the number of classes to test against, by default = 10)\n :param overshoot: used as a termination criterion to prevent vanishing updates (default = 0.02).\n :param max_iter: maximum number of iterations for deepfool (default = 50)\n :return: minimal perturbation that fools the classifier, number of iterations that it required, new estimated_label and perturbed image\n \"\"\"\n is_cuda = torch.cuda.is_available()\n\n if is_cuda:\n print(\"Using GPU\")\n image = image.cuda()\n net = net.cuda()\n else:\n print(\"Using CPU\")\n\n\n f_image = net.forward(Variable(image[None, :, :, :], requires_grad=True)).data.cpu().numpy().flatten()\n I = (np.array(f_image)).flatten().argsort()[::-1]\n\n I = I[0:num_classes]\n label = I[0]\n\n input_shape = image.cpu().numpy().shape\n pert_image = copy.deepcopy(image)\n w = np.zeros(input_shape)\n r_tot = np.zeros(input_shape)\n\n loop_i = 0\n\n x = Variable(pert_image[None, :], requires_grad=True)\n fs = net.forward(x)\n fs_list = [fs[0,I[k]] for k in range(num_classes)]\n k_i = label\n\n while k_i == label and loop_i < max_iter:\n\n pert = np.inf\n fs[0, I[0]].backward(retain_graph=True)\n grad_orig = x.grad.data.cpu().numpy().copy()\n\n for k in range(1, num_classes):\n zero_gradients(x)\n\n fs[0, I[k]].backward(retain_graph=True)\n cur_grad = x.grad.data.cpu().numpy().copy()\n\n # set new w_k and new f_k\n w_k = cur_grad - grad_orig\n f_k = (fs[0, I[k]] - fs[0, I[0]]).data.cpu().numpy()\n\n pert_k = abs(f_k)/np.linalg.norm(w_k.flatten())\n\n # determine which w_k to use\n if pert_k < pert:\n pert = pert_k\n w = w_k\n\n # compute r_i and r_tot\n # Added 1e-4 for numerical stability\n r_i = (pert+1e-4) * w / np.linalg.norm(w)\n r_tot = np.float32(r_tot + r_i)\n\n if is_cuda:\n pert_image = image + (1+overshoot)*torch.from_numpy(r_tot).cuda()\n else:\n pert_image = image + (1+overshoot)*torch.from_numpy(r_tot)\n\n x = Variable(pert_image, requires_grad=True)\n fs = net.forward(x)\n k_i = np.argmax(fs.data.cpu().numpy().flatten())\n\n loop_i += 1\n\n r_tot = (1+overshoot)*r_tot\n\n return r_tot, loop_i, label, k_i, pert_image\n\n<|im_end|>"}
4
- {"text": "<|im_start|>user\nAnalyze the file 'Python/test_deepfool.py' from repository 'DEEPFOOL'.\n<|im_end|>\n<|im_start|>assistant\nFILE: Python/test_deepfool.py\nSOURCE: DEEPFOOL\nCONTENT:\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport torchvision.transforms as transforms\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.optim as optim\nimport torch.utils.data as data_utils\nfrom torch.autograd import Variable\nimport math\nimport torchvision.models as models\nfrom PIL import Image\nfrom deepfool import deepfool\nimport os\n\nnet = models.resnet34(pretrained=True)\n\n# Switch to evaluation mode\nnet.eval()\n\nim_orig = Image.open('test_im2.jpg')\n\nmean = [ 0.485, 0.456, 0.406 ]\nstd = [ 0.229, 0.224, 0.225 ]\n\n\n# Remove the mean\nim = transforms.Compose([\n transforms.Scale(256),\n transforms.CenterCrop(224),\n transforms.ToTensor(),\n transforms.Normalize(mean = mean,\n std = std)])(im_orig)\n\nr, loop_i, label_orig, label_pert, pert_image = deepfool(im, net)\n\nlabels = open(os.path.join('synset_words.txt'), 'r').read().split('\\n')\n\nstr_label_orig = labels[np.int(label_orig)].split(',')[0]\nstr_label_pert = labels[np.int(label_pert)].split(',')[0]\n\nprint(\"Original label = \", str_label_orig)\nprint(\"Perturbed label = \", str_label_pert)\n\ndef clip_tensor(A, minv, maxv):\n A = torch.max(A, minv*torch.ones(A.shape))\n A = torch.min(A, maxv*torch.ones(A.shape))\n return A\n\nclip = lambda x: clip_tensor(x, 0, 255)\n\ntf = transforms.Compose([transforms.Normalize(mean=[0, 0, 0], std=map(lambda x: 1 / x, std)),\n transforms.Normalize(mean=map(lambda x: -x, mean), std=[1, 1, 1]),\n transforms.Lambda(clip),\n transforms.ToPILImage(),\n transforms.CenterCrop(224)])\n\nplt.figure()\nplt.imshow(tf(pert_image.cpu()[0]))\nplt.title(str_label_pert)\nplt.show()\n\n<|im_end|>"}
 
1
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'DEEPFOOL' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: MATLAB/README.md\n<|im_end|>\n<|im_start|>assistant\nREPO: DEEPFOOL\nCODE:\n# DeepFool\nDeepFool is a simple algorithm to find the minimum adversarial perturbations in deep networks\n\n__Note__: A Python implementation can be found [here](http://github.com/LTS4/universal/blob/master/python/deepfool.py).\n\n### adversarial_perturbation.m\n\nThis function implements the algorithm proposed in [[1]](http://arxiv.org/pdf/1511.04599) to find the adverasrial perturbation.\n\n### adversarial_DeepFool_matconvnet.m\n\nThis function is a wrapper to compute the adversarial perturbation for [MatConvNet](http://www.vlfeat.org/matconvnet/)'s models.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\n### adversarial_DeepFool_caffe.m\n\nThis function is a wrapper to compute the adversarial perturbation for [Caffe](http://caffe.berkeleyvision.org)'s models.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\nThe arguments for both wrappers are:\n\n- `x`: input image in `W*H*C` format\n- `net`: network model where the last layer (loss) is removed.\n- `opts`: a structure containing the following options:\n - `labels_limit`: limits the number of classes to test against (default = 10).\n - `overshoot`: used as a termination criterion to prevent vanishing updates (default = 0.02).\n - `max_iter`: maximum number of iterations (default = 100).\n - `norm_p`: determines which l_p norm to use (see [[1]](http://arxiv.org/pdf/1511.04599)) (default = 2).\n \n### demo_matconvnet.m\n\nA simple demo which computes the adversarial perturbation for an image from MNIST dataset for a LeNet classifier. The image is loaded from a standard IMDB file.\n\n### demo_caffe.m\n\nA simple demo which computes the adversarial perturbation for an image on CaffeNet classifier.\n\n## Reference\n[1] S. Moosavi-Dezfooli, A. Fawzi, P. Frossard:\n*DeepFool: a simple and accurate method to fool deep neural networks*. In Computer Vision and Pattern Recognition (CVPR \u201916), IEEE, 2016.\n\n<|im_end|>"}
2
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'DEEPFOOL' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: Python/README.md\n<|im_end|>\n<|im_start|>assistant\nREPO: DEEPFOOL\nCODE:\n# DeepFool\nDeepFool is a simple algorithm to find the minimum adversarial perturbations in deep networks\n\n### deepfool.py\n\nThis function implements the algorithm proposed in [[1]](http://arxiv.org/pdf/1511.04599) using PyTorch to find adversarial perturbations.\n\n__Note__: The final softmax (loss) layer should be removed in order to prevent numerical instabilities.\n\nThe parameters of the function are:\n\n- `image`: Image of size `HxWx3d`\n- `net`: neural network (input: images, output: values of activation **BEFORE** softmax).\n- `num_classes`: limits the number of classes to test against, by default = 10.\n- `max_iter`: max number of iterations, by default = 50.\n\n### test_deepfool.py\n\nA simple demo which computes the adversarial perturbation for a test image from ImageNet dataset.\n\n## Reference\n[1] S. Moosavi-Dezfooli, A. Fawzi, P. Frossard:\n*DeepFool: a simple and accurate method to fool deep neural networks*. In Computer Vision and Pattern Recognition (CVPR \u201916), IEEE, 2016.\n\n<|im_end|>"}
3
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'DEEPFOOL' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: Python/deepfool.py\n<|im_end|>\n<|im_start|>assistant\nREPO: DEEPFOOL\nCODE:\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch as torch\nimport copy\nfrom torch.autograd.gradcheck import zero_gradients\n\n\ndef deepfool(image, net, num_classes=10, overshoot=0.02, max_iter=50):\n\n \"\"\"\n :param image: Image of size HxWx3\n :param net: network (input: images, output: values of activation **BEFORE** softmax).\n :param num_classes: num_classes (limits the number of classes to test against, by default = 10)\n :param overshoot: used as a termination criterion to prevent vanishing updates (default = 0.02).\n :param max_iter: maximum number of iterations for deepfool (default = 50)\n :return: minimal perturbation that fools the classifier, number of iterations that it required, new estimated_label and perturbed image\n \"\"\"\n is_cuda = torch.cuda.is_available()\n\n if is_cuda:\n print(\"Using GPU\")\n image = image.cuda()\n net = net.cuda()\n else:\n print(\"Using CPU\")\n\n\n f_image = net.forward(Variable(image[None, :, :, :], requires_grad=True)).data.cpu().numpy().flatten()\n I = (np.array(f_image)).flatten().argsort()[::-1]\n\n I = I[0:num_classes]\n label = I[0]\n\n input_shape = image.cpu().numpy().shape\n pert_image = copy.deepcopy(image)\n w = np.zeros(input_shape)\n r_tot = np.zeros(input_shape)\n\n loop_i = 0\n\n x = Variable(pert_image[None, :], requires_grad=True)\n fs = net.forward(x)\n fs_list = [fs[0,I[k]] for k in range(num_classes)]\n k_i = label\n\n while k_i == label and loop_i < max_iter:\n\n pert = np.inf\n fs[0, I[0]].backward(retain_graph=True)\n grad_orig = x.grad.data.cpu().numpy().copy()\n\n for k in range(1, num_classes):\n zero_gradients(x)\n\n fs[0, I[k]].backward(retain_graph=True)\n cur_grad = x.grad.data.cpu().numpy().copy()\n\n # set new w_k and new f_k\n w_k = cur_grad - grad_orig\n f_k = (fs[0, I[k]] - fs[0, I[0]]).data.cpu().numpy()\n\n pert_k = abs(f_k)/np.linalg.norm(w_k.flatten())\n\n # determine which w_k to use\n if pert_k < pert:\n pert = pert_k\n w = w_k\n\n # compute r_i and r_tot\n # Added 1e-4 for numerical stability\n r_i = (pert+1e-4) * w / np.linalg.norm(w)\n r_tot = np.float32(r_tot + r_i)\n\n if is_cuda:\n pert_image = image + (1+overshoot)*torch.from_numpy(r_tot).cuda()\n else:\n pert_image = image + (1+overshoot)*torch.from_numpy(r_tot)\n\n x = Variable(pert_image, requires_grad=True)\n fs = net.forward(x)\n k_i = np.argmax(fs.data.cpu().numpy().flatten())\n\n loop_i += 1\n\n r_tot = (1+overshoot)*r_tot\n\n return r_tot, loop_i, label, k_i, pert_image\n\n<|im_end|>"}
4
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'DEEPFOOL' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: Python/test_deepfool.py\n<|im_end|>\n<|im_start|>assistant\nREPO: DEEPFOOL\nCODE:\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport torchvision.transforms as transforms\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.optim as optim\nimport torch.utils.data as data_utils\nfrom torch.autograd import Variable\nimport math\nimport torchvision.models as models\nfrom PIL import Image\nfrom deepfool import deepfool\nimport os\n\nnet = models.resnet34(pretrained=True)\n\n# Switch to evaluation mode\nnet.eval()\n\nim_orig = Image.open('test_im2.jpg')\n\nmean = [ 0.485, 0.456, 0.406 ]\nstd = [ 0.229, 0.224, 0.225 ]\n\n\n# Remove the mean\nim = transforms.Compose([\n transforms.Scale(256),\n transforms.CenterCrop(224),\n transforms.ToTensor(),\n transforms.Normalize(mean = mean,\n std = std)])(im_orig)\n\nr, loop_i, label_orig, label_pert, pert_image = deepfool(im, net)\n\nlabels = open(os.path.join('synset_words.txt'), 'r').read().split('\\n')\n\nstr_label_orig = labels[np.int(label_orig)].split(',')[0]\nstr_label_pert = labels[np.int(label_pert)].split(',')[0]\n\nprint(\"Original label = \", str_label_orig)\nprint(\"Perturbed label = \", str_label_pert)\n\ndef clip_tensor(A, minv, maxv):\n A = torch.max(A, minv*torch.ones(A.shape))\n A = torch.min(A, maxv*torch.ones(A.shape))\n return A\n\nclip = lambda x: clip_tensor(x, 0, 255)\n\ntf = transforms.Compose([transforms.Normalize(mean=[0, 0, 0], std=map(lambda x: 1 / x, std)),\n transforms.Normalize(mean=map(lambda x: -x, mean), std=[1, 1, 1]),\n transforms.Lambda(clip),\n transforms.ToPILImage(),\n transforms.CenterCrop(224)])\n\nplt.figure()\nplt.imshow(tf(pert_image.cpu()[0]))\nplt.title(str_label_pert)\nplt.show()\n\n<|im_end|>"}
data/FEATHERDUSTER.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/HASHCAT.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9375e1e80a8314fb2a37d3597a18d7b0442826f7c2611aa9f06ed14cc3c53c72
3
+ size 42584550
data/JAWS.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'JAWS' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: README.md\n<|im_end|>\n<|im_start|>assistant\nREPO: JAWS\nCODE:\n# JAWS - Just Another Windows (Enum) Script\n\nJAWS is PowerShell script designed to help penetration testers (and CTFers) quickly identify potential privilege escalation vectors on Windows systems. It is written using PowerShell 2.0 so 'should' run on every Windows version since Windows 7.\n\n## Usage:\n\n\n**Run from within CMD shell and write out to file.**\n```\nCMD C:\\temp> powershell.exe -ExecutionPolicy Bypass -File .\\jaws-enum.ps1 -OutputFilename JAWS-Enum.txt\n```\n**Run from within CMD shell and write out to screen.**\n```\nCMD C:\\temp> powershell.exe -ExecutionPolicy Bypass -File .\\jaws-enum.ps1\n```\n**Run from within PS Shell and write out to file.**\n```\nPS C:\\temp> .\\jaws-enum.ps1 -OutputFileName Jaws-Enum.txt\n```\n\n## Current Features\n - Network Information (interfaces, arp, netstat)\n - Firewall Status and Rules\n - Running Processes\n - Files and Folders with Full Control or Modify Access\n - Mapped Drives\n - Potentially Interesting Files\n - Unquoted Service Paths\n - Recent Documents\n - System Install Files \n - AlwaysInstallElevated Registry Key Check\n - Stored Credentials\n - Installed Applications\n - Potentially Vulnerable Services\n - MuiCache Files\n - Scheduled Tasks\n\n## Known Issues\n\n- Output for firewall rules can sometimes be clipped.\n- When running from within a shell the script doesnt always tell you its finished.\n- When running within some PowerShell reverse shells the running menu isnt shown. \n\n\n\n## To Do\n - Add full directory listing with user defined depth\n - Read SAM file permissions\n - Improve output\n\n<|im_end|>"}
2
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'JAWS' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: jaws-enum.ps1\n<|im_end|>\n<|im_start|>assistant\nREPO: JAWS\nCODE:\n<#\n.SYNOPSIS\nWindows enumeration script\n.DESCRIPTION\nThis script is designed to be used in a penetration test or CTF\nenviroment. It will enumerate useful information from the host\nfor privilege escalation.\n.EXAMPLE\nPS > .\\jaws-enum.ps1 \nwill write results out to screen.\n.EXAMPLE\nPS > .\\jaws-enum.ps1 -OutputFileName Jaws-Enum.txt\nWrites out results to Jaws-Enum.txt in current directory.\n.LINK\nhttps://github.com/411Hall/JAWS\n#>\nParam(\n [String]$OutputFilename = \"\"\n)\n\nfunction JAWS-ENUM {\n write-output \"`nRunning J.A.W.S. Enumeration\"\n $output = \"\" \n $output = $output + \"############################################################`r`n\"\n $output = $output + \"## J.A.W.S. (Just Another Windows Enum Script) ##`r`n\"\n $output = $output + \"## ##`r`n\"\n $output = $output + \"## https://github.com/411Hall/JAWS ##`r`n\"\n $output = $output + \"## ##`r`n\"\n $output = $output + \"############################################################`r`n\"\n $output = $output + \"`r`n\"\n $win_version = (Get-WmiObject -class Win32_OperatingSystem)\n $output = $output + \"Windows Version: \" + (($win_version.caption -join $win_version.version) + \"`r`n\")\n $output = $output + \"Architecture: \" + (($env:processor_architecture) + \"`r`n\")\n $output = $output + \"Hostname: \" + (($env:ComputerName) + \"`r`n\")\n $output = $output + \"Current User: \" + (($env:username) + \"`r`n\")\n $output = $output + \"Current Time\\Date: \" + (get-date)\n $output = $output + \"`r`n\"\n $output = $output + \"`r`n\"\n write-output \"\t- Gathering User Information\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Users`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $adsi = [ADSI]\"WinNT://$env:COMPUTERNAME\"\n $adsi.Children | where {$_.SchemaClassName -eq 'user'} | Foreach-Object {\n $groups = $_.Groups() | Foreach-Object {$_.GetType().InvokeMember(\"Name\", 'GetProperty', $null, $_, $null)}\n $output = $output + \"----------`r`n\"\n $output = $output + \"Username: \" + $_.Name + \"`r`n\"\n $output = $output + \"Groups: \" + $groups + \"`r`n\"\n }\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Network Information`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (ipconfig | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Arp`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (arp -a | out-string) \n $output = $output + \"`r`n\"\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" NetStat`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (netstat -ano | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Firewall Status`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \"`r`n\"\n $Firewall = New-Object -com HNetCfg.FwMgr\n $FireProfile = $Firewall.LocalPolicy.CurrentProfile \n if ($FireProfile.FirewallEnabled -eq $False) {\n $output = $output + (\"Firewall is Disabled\" + \"`r`n\")\n } else {\n $output = $output + (\"Firwall is Enabled\" + \"`r`n\")\n }\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" FireWall Rules`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n Function Get-FireWallRule\n {Param ($Name, $Direction, $Enabled, $Protocol, $profile, $action, $grouping)\n $Rules=(New-object -comObject HNetCfg.FwPolicy2).rules\n If ($name) {$rules= $rules | where-object {$_.name -like $name}}\n If ($direction) {$rules= $rules | where-object {$_.direction -eq $direction}}\n If ($Enabled) {$rules= $rules | where-object {$_.Enabled -eq $Enabled}}\n If ($protocol) {$rules= $rules | where-object {$_.protocol -eq $protocol}}\n If ($profile) {$rules= $rules | where-object {$_.Profiles -bAND $profile}}\n If ($Action) {$rules= $rules | where-object {$_.Action -eq $Action}}\n If ($Grouping) {$rules= $rules | where-object {$_.Grouping -like $Grouping}}\n $rules}\n $output = $output + (Get-firewallRule -enabled $true | sort direction,applicationName,name | format-table -property Name , localPorts,applicationname | out-string)\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Hosts File Content`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \"`r`n\"\n $output = $output + ((get-content $env:windir\\System32\\drivers\\etc\\hosts | out-string) + \"`r`n\")\n $output = $output + \"`r`n\"\n write-output \"\t- Gathering Processes, Services and Scheduled Tasks\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Processes`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + ((Get-WmiObject win32_process | Select-Object Name,ProcessID,@{n='Owner';e={$_.GetOwner().User}},CommandLine | sort name | format-table -wrap -autosize | out-string) + \"`r`n\")\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Scheduled Tasks`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \"Current System Time: \" + (get-date)\n $output = $output + (schtasks /query /FO CSV /v | convertfrom-csv | where { $_.TaskName -ne \"TaskName\" } | select \"TaskName\",\"Run As User\", \"Task to Run\" | fl | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Services`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (get-service | Select Name,DisplayName,Status | sort status | Format-Table -Property * -AutoSize | Out-String -Width 4096)\n $output = $output + \"`r`n\"\n write-output \"\t- Gathering Installed Software\"\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Installed Programs`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (get-wmiobject -Class win32_product | select Name, Version, Caption | ft -hidetableheaders -autosize| out-string -Width 4096)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Installed Patches`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (Get-Wmiobject -class Win32_QuickFixEngineering -namespace \"root\\cimv2\" | select HotFixID, InstalledOn| ft -autosize | out-string )\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Program Folders`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \"`n`rC:\\Program Files`r`n\"\n $output = $output + \"-------------\"\n $output = $output + (get-childitem \"C:\\Program Files\" -EA SilentlyContinue | select Name | ft -hidetableheaders -autosize| out-string)\n $output = $output + \"C:\\Program Files (x86)`r`n\"\n $output = $output + \"-------------------\"\n $output = $output + (get-childitem \"C:\\Program Files (x86)\" -EA SilentlyContinue | select Name | ft -hidetableheaders -autosize| out-string)\n $output = $output + \"`r`n\"\n write-output \"\t- Gathering File System Information\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Files with Full Control and Modify Access`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $files = get-childitem C:\\\n foreach ($file in $files){\n try {\n $output = $output + (get-childitem \"C:\\$file\" -include *.ps1,*.bat,*.com,*.vbs,*.txt,*.html,*.conf,*.rdp,.*inf,*.ini -recurse -EA SilentlyContinue | get-acl -EA SilentlyContinue | select path -expand access | \n where {$_.identityreference -notmatch \"BUILTIN|NT AUTHORITY|EVERYONE|CREATOR OWNER|NT SERVICE\"} | where {$_.filesystemrights -match \"FullControl|Modify\"} | \n ft @{Label=\"\";Expression={Convert-Path $_.Path}} -hidetableheaders -autosize | out-string -Width 4096)\n }\n catch {\n $output = $output + \"`nFailed to read more files`r`n\"\n }\n }\n\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Folders with Full Control and Modify Access`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $folders = get-childitem C:\\\n foreach ($folder in $folders){\n try {\n $output = $output + (Get-ChildItem -Recurse \"C:\\$folder\" -EA SilentlyContinue | ?{ $_.PSIsContainer} | get-acl | select path -expand access | \n where {$_.identityreference -notmatch \"BUILTIN|NT AUTHORITY|CREATOR OWNER|NT SERVICE\"} | where {$_.filesystemrights -match \"FullControl|Modify\"} | \n select path,filesystemrights,IdentityReference | ft @{Label=\"\";Expression={Convert-Path $_.Path}} -hidetableheaders -autosize | out-string -Width 4096)\n }\n catch {\n $output = $output + \"`nFailed to read more folders`r`n\"\n }\n }\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Mapped Drives`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (Get-WmiObject -Class Win32_LogicalDisk | select DeviceID, VolumeName | ft -hidetableheaders -autosize | out-string -Width 4096)\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Unquoted Service Paths`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (cmd /c 'wmic service get name,displayname,pathname,startmode |findstr /i \"auto\" |findstr /i /v \"c:\\windows\\\\\" |findstr /i /v \"\"\"')\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Recent Documents`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (get-childitem \"C:\\Users\\$env:username\\AppData\\Roaming\\Microsoft\\Windows\\Recent\" -EA SilentlyContinue | select Name | ft -hidetableheaders | out-string )\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Potentially Interesting Files in Users Directory `r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (get-childitem \"C:\\Users\\\" -recurse -Include *.zip,*.rar,*.7z,*.gz,*.conf,*.rdp,*.kdbx,*.crt,*.pem,*.ppk,*.txt,*.xml,*.vnc.*.ini,*.vbs,*.bat,*.ps1,*.cmd -EA SilentlyContinue | %{$_.FullName } | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" 10 Last Modified Files in C:\\User`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (Get-ChildItem 'C:\\Users' -recurse -EA SilentlyContinue | Sort {$_.LastWriteTime} | %{$_.FullName } | select -last 10 | ft -hidetableheaders | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" MUICache Files`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n get-childitem \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\\" -EA SilentlyContinue |\n foreach { $CurrentKey = (Get-ItemProperty -Path $_.PsPath)\n if ($CurrentKey -match \"C:\\\\\") {\n $output = $output + ($_.Property -join \"`r`n\")\n }\n }\n $output = $output + \"`r`n\"\n $output = $output + \"`r`n\"\n write-output \"\t- Looking for Simple Priv Esc Methods\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" System Files with Passwords`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $files = (\"unattended.xml\", \"sysprep.xml\", \"autounattended.xml\",\"unattended.inf\", \"sysprep.inf\", \"autounattended.inf\",\"unattended.txt\", \"sysprep.txt\", \"autounattended.txt\")\n $output = $output + (get-childitem C:\\ -recurse -include $files -EA SilentlyContinue | Select-String -pattern \"<Value>\" | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" AlwaysInstalledElevated Registry Key`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $HKLM = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\"\n $HKCU = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\"\n if (($HKLM | test-path) -eq \"True\") \n {\n if (((Get-ItemProperty -Path $HKLM -Name AlwaysInstallElevated).AlwaysInstallElevated) -eq 1)\n {\n $output = $output + \"AlwaysInstallElevated enabled on this host!\"\n }\n }\n if (($HKCU | test-path) -eq \"True\") \n {\n if (((Get-ItemProperty -Path $HKCU -Name AlwaysInstallElevated).AlwaysInstallElevated) -eq 1)\n {\n $output = $output + \"AlwaysInstallElevated enabled on this host!\"\n }\n }\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Stored Credentials`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + (cmdkey /list | out-string)\n $output = $output + \"`r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $output = $output + \" Checking for AutoAdminLogon `r`n\"\n $output = $output + \"-----------------------------------------------------------`r`n\"\n $Winlogon = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\"\n if (get-itemproperty -path $Winlogon -Name AutoAdminLogon -ErrorAction SilentlyContinue) \n {\n if ((get-itemproperty -path $Winlogon -Name AutoAdminLogon).AutoAdminLogon -eq 1) \n {\n $Username = (get-itemproperty -path $Winlogon -Name DefaultUserName).DefaultUsername\n $output = $output + \"The default username is $Username `r`n\"\n $Password = (get-itemproperty -path $Winlogon -Name DefaultPassword).DefaultPassword\n $output = $output + \"The default password is $Password `r`n\"\n $DefaultDomainName = (get-itemproperty -path $Winlogon -Name DefaultDomainName).DefaultDomainName\n $output = $output + \"The default domainname is $DefaultDomainName `r`n\"\n }\n }\n $output = $output + \"`r`n\"\n if ($OutputFilename.length -gt 0)\n {\n $output | Out-File -FilePath $OutputFileName -encoding utf8\n }\n else\n {\n clear-host\n write-output $output\n }\n}\n\nif ($OutputFilename.length -gt 0)\n {\n Try \n { \n [io.file]::OpenWrite($OutputFilename).close() \n JAWS-ENUM\n }\n Catch \n { \n Write-Warning \"`nUnable to write to output file $OutputFilename, Check path and permissions\" \n }\n } \nelse \n {\n JAWS-ENUM\n }\n\n<|im_end|>"}
data/JOHN_THE_RIPPER.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28fac5590bf4fdf2890787dba4198fa87fe949853ba1d64039cf3c40ec6db638
3
+ size 18335860
data/LIBGCRYPT.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/LIBSODIUM.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/LINENUM.jsonl ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'LINENUM' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: CHANGELOG.md\n<|im_end|>\n<|im_start|>assistant\nREPO: LINENUM\nCODE:\n# Changelog\n\nNote: Export functionality is currently in the experimental stage.\n\n## V0.982 (release 07-01-2020)\n* Improvements to script execution speed by @Jrhenderson11 (https://github.com/rebootuser/LinEnum/pull/45 & https://github.com/rebootuser/LinEnum/commit/13741ce79fd5627da64bcf6a04fea11829e91ec8)\n\n## V0.981 (release 21-11-2019)\n* List permissions on PATH directories to see if they are writable by @stealthcopter\n* Added checks for .bak files by @richardcurteis\n\n## V0.98 (18-10-19 & 20-11-19)\n* Added further useful binaries to list by @Anon-Exploiter\n* Fixes to psql password issue by @Disassembler0\n\n## V0.971 (11-09-19)\n* Added useful binaries to list by @Anon-Exploiter\n\n## V0.97 (release 09-07-2019)\n* Improvements to TCP/UDP socket output by @Hypnoze57\n\n## V0.96 (release 16-04-2019)\n* Fixes to SUID/SGID checks\n\n## V0.95 (release 24-01-2019)\nAdditions\n* Additional checks provided by @djhohnstein (https://github.com/djhohnstein/LinEnum/commit/bf4ce1ad3beb392cab5d388e364972373533c721#diff-679e8fbdcfe07231f5eda7a8b491511dR1350)\n* Searches /home for private key files\n* Searches /home for AWS keys\n* Searches / for git credential files \n\nModifications\n* SUID/SGID and capabilities checks moved from thorough to standard check\n* False positive ssh-agent fix \n* Output text/small code changes and clean-up\n\n## V0.9 (release 25-05-2018)\nAdditions\n* Sudo/SUID/SGID binary list expanded to include entries from https://gtfobins.github.io/\n* -s switch introduced. This allows you to supply the current user password for authenticated sudo 'checks'. Note; this is INSECURE and is really only for use in CTF environments\n\nModifications\n* Sudo/suid/guid searches modified & bug in sudo parsing (when multiple entries are separated by commas) fixed\n* Apache home dir output moved to thorough checks (due to extensive output)\n\n## V0.8 (release 12-04-2018)\nAdditions\n* Prints contents of users .bash_history (if found)\n* Looks for users that have used sudo\n* Checks for htpasswd files\n* Lists hidden files\n* Further checks/output in regards to viewing files the user owns\n* Additional checks using newer ip commands\n* Added PHP search for keywords\n\nModifications\n* Code/commands cleaned\n* Added [+] and [-] to output, to aid in searching through the generated report\n\n## V0.7 (22-01-2018)\nAdditions\n* LX Container checks\n* Loaded Kernel Modules list\n* adm group listing\n* SELinux Presence\n\nModifications\n* Code optimization: everything is in functions, cat grep awk pair optimized.\n\n## V0.6 (release 12-05-2017)\nAdditions\n* ARP information added\n* Shows users currently logged onto the host\n* Added checks to show env information\n* Displays enabled Apache modules\n* Checks to see if we're in a Docker container\n* Checks to see if we're hosting Docker services\n\nModifications\n* Tweaked the SSH search as we were getting false negatives\n* Tweaked the searches used for SUID, GUID binaries\n* Fixed issues with some commands not, or incorrectly, redirecting to error\n\n## V0.5 (release 27-01-2014)\nAdditions\n* Interface tweaks including the following additional switches:\n** -e :export functionality\n** -r :generate report output\n** -t :perform thorough tests\n* Thorough tests include lengthy checks, if the -t switch is absent, a default 'quick' scan is performed\n* Export functionality copies 'interesting' files to a specified location for offline analysis\n* Checks added for inetd.conf binary ownership\n* Extracts password policy and hashing information from /etc/login.defs\n* Checks umask value\n\nModifications\n* Reporting functionality now has a dependency on 'tee'\n* Fixed/modified user/group scan\n* Tidied sudoer file extraction command\n\n## V0.4 (release 05-08-2013)\nAdditions\n* Added basic usage details to display on start-up\n* Added cron.deny/cron.allow checks\n\nModifications\n* Fixed printing of scan start date when output is saved to file\n* Tidied up output when output is saved to a file\n\n## V0.3 (release 30-08-2013)\nEdited by Nikhil Sreekumar (@roo7break)\nEnhancements\n* Support for multiple keywords for searching added (space separated)\n* Search for keywords optimised\n* Store output to file and pass seach keywords from command line (e.g. ./LinEnum.sh output.txt \"password credential username\"\n\n## V0.2 (release 30-08-2013)\nAdditions\n* Date/time is displayed when the scan is started\n* Checks for word-readable files in /home and displays positive matches\n* Apache user config (user/group) details displayed (if applicable)\n* Details all members of our users' current groups\n* Lists available shells\n* Performs basics SSH checks (i.e. what can be read/where is it stored and associated permissions)\n* Locates and lists password hashes that may be found in /etc/passwd on old setups (big thanks to www.pentestmonkey.net)\n* Locates credentials file and username/passwords in /etc/fstab\n\nModifications:\n* ifconfig command simplified so 'br' & 'em' interfaces details are also shown\n* Keyword search also includes *.ini files\n\n## V0.1 (release 19-08-2013)\n\n<|im_end|>"}
2
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'LINENUM' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: CONTRIBUTORS.md\n<|im_end|>\n<|im_start|>assistant\nREPO: LINENUM\nCODE:\nFollowing People have contributed to various features (list in no particular order):\n\n* @roo7break (http://roo7break.co.uk/) : added reporting functionality [added to version 3 (support discontinued in later versions).]\n* @Reboare : added lxc container checks\n* @phackt : added various checks (adm group, SELinux Presence, fstab)\n* @anantshri (http://anantshri.info) : code optimization, loaded kernel modules listing\n* @gedigi : fixed incorrect sudo NOPASSWD check\n* https://github.com/d78ui98 : code optimization\n* https://github.com/djhohnstein : added checks for private keys, AWS keys and git credential files\n* @3therk1ll : added checks for .bak files\n\n<|im_end|>"}
3
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'LINENUM' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: LinEnum.sh\n<|im_end|>\n<|im_start|>assistant\nREPO: LINENUM\nCODE:\n#!/bin/bash\n#A script to enumerate local information from a Linux host\nversion=\"version 0.982\"\n#@rebootuser\n\n#help function\nusage () \n{ \necho -e \"\\n\\e[00;31m#########################################################\\e[00m\" \necho -e \"\\e[00;31m#\\e[00m\" \"\\e[00;33mLocal Linux Enumeration & Privilege Escalation Script\\e[00m\" \"\\e[00;31m#\\e[00m\"\necho -e \"\\e[00;31m#########################################################\\e[00m\"\necho -e \"\\e[00;33m# www.rebootuser.com | @rebootuser \\e[00m\"\necho -e \"\\e[00;33m# $version\\e[00m\\n\"\necho -e \"\\e[00;33m# Example: ./LinEnum.sh -k keyword -r report -e /tmp/ -t \\e[00m\\n\"\n\n\t\techo \"OPTIONS:\"\n\t\techo \"-k\tEnter keyword\"\n\t\techo \"-e\tEnter export location\"\n\t\techo \"-s \tSupply user password for sudo checks (INSECURE)\"\n\t\techo \"-t\tInclude thorough (lengthy) tests\"\n\t\techo \"-r\tEnter report name\" \n\t\techo \"-h\tDisplays this help text\"\n\t\techo -e \"\\n\"\n\t\techo \"Running with no options = limited scans/no output file\"\n\t\t\necho -e \"\\e[00;31m#########################################################\\e[00m\"\t\t\n}\nheader()\n{\necho -e \"\\n\\e[00;31m#########################################################\\e[00m\" \necho -e \"\\e[00;31m#\\e[00m\" \"\\e[00;33mLocal Linux Enumeration & Privilege Escalation Script\\e[00m\" \"\\e[00;31m#\\e[00m\" \necho -e \"\\e[00;31m#########################################################\\e[00m\" \necho -e \"\\e[00;33m# www.rebootuser.com\\e[00m\" \necho -e \"\\e[00;33m# $version\\e[00m\\n\" \n\n}\n\ndebug_info()\n{\necho \"[-] Debug Info\" \n\nif [ \"$keyword\" ]; then \n\techo \"[+] Searching for the keyword $keyword in conf, php, ini and log files\" \nfi\n\nif [ \"$report\" ]; then \n\techo \"[+] Report name = $report\" \nfi\n\nif [ \"$export\" ]; then \n\techo \"[+] Export location = $export\" \nfi\n\nif [ \"$thorough\" ]; then \n\techo \"[+] Thorough tests = Enabled\" \nelse \n\techo -e \"\\e[00;33m[+] Thorough tests = Disabled\\e[00m\" \nfi\n\nsleep 2\n\nif [ \"$export\" ]; then\n mkdir $export 2>/dev/null\n format=$export/LinEnum-export-`date +\"%d-%m-%y\"`\n mkdir $format 2>/dev/null\nfi\n\nif [ \"$sudopass\" ]; then \n echo -e \"\\e[00;35m[+] Please enter password - INSECURE - really only for CTF use!\\e[00m\"\n read -s userpassword\n echo \nfi\n\nwho=`whoami` 2>/dev/null \necho -e \"\\n\" \n\necho -e \"\\e[00;33mScan started at:\"; date \necho -e \"\\e[00m\\n\" \n}\n\n# useful binaries (thanks to https://gtfobins.github.io/)\nbinarylist='aria2c\\|arp\\|ash\\|awk\\|base64\\|bash\\|busybox\\|cat\\|chmod\\|chown\\|cp\\|csh\\|curl\\|cut\\|dash\\|date\\|dd\\|diff\\|dmsetup\\|docker\\|ed\\|emacs\\|env\\|expand\\|expect\\|file\\|find\\|flock\\|fmt\\|fold\\|ftp\\|gawk\\|gdb\\|gimp\\|git\\|grep\\|head\\|ht\\|iftop\\|ionice\\|ip$\\|irb\\|jjs\\|jq\\|jrunscript\\|ksh\\|ld.so\\|ldconfig\\|less\\|logsave\\|lua\\|make\\|man\\|mawk\\|more\\|mv\\|mysql\\|nano\\|nawk\\|nc\\|netcat\\|nice\\|nl\\|nmap\\|node\\|od\\|openssl\\|perl\\|pg\\|php\\|pic\\|pico\\|python\\|readelf\\|rlwrap\\|rpm\\|rpmquery\\|rsync\\|ruby\\|run-parts\\|rvim\\|scp\\|script\\|sed\\|setarch\\|sftp\\|sh\\|shuf\\|socat\\|sort\\|sqlite3\\|ssh$\\|start-stop-daemon\\|stdbuf\\|strace\\|systemctl\\|tail\\|tar\\|taskset\\|tclsh\\|tee\\|telnet\\|tftp\\|time\\|timeout\\|ul\\|unexpand\\|uniq\\|unshare\\|vi\\|vim\\|watch\\|wget\\|wish\\|xargs\\|xxd\\|zip\\|zsh'\n\nsystem_info()\n{\necho -e \"\\e[00;33m### SYSTEM ##############################################\\e[00m\" \n\n#basic kernel info\nunameinfo=`uname -a 2>/dev/null`\nif [ \"$unameinfo\" ]; then\n echo -e \"\\e[00;31m[-] Kernel information:\\e[00m\\n$unameinfo\" \n echo -e \"\\n\" \nfi\n\nprocver=`cat /proc/version 2>/dev/null`\nif [ \"$procver\" ]; then\n echo -e \"\\e[00;31m[-] Kernel information (continued):\\e[00m\\n$procver\" \n echo -e \"\\n\" \nfi\n\n#search all *-release files for version info\nrelease=`cat /etc/*-release 2>/dev/null`\nif [ \"$release\" ]; then\n echo -e \"\\e[00;31m[-] Specific release information:\\e[00m\\n$release\" \n echo -e \"\\n\" \nfi\n\n#target hostname info\nhostnamed=`hostname 2>/dev/null`\nif [ \"$hostnamed\" ]; then\n echo -e \"\\e[00;31m[-] Hostname:\\e[00m\\n$hostnamed\" \n echo -e \"\\n\" \nfi\n}\n\nuser_info()\n{\necho -e \"\\e[00;33m### USER/GROUP ##########################################\\e[00m\" \n\n#current user details\ncurrusr=`id 2>/dev/null`\nif [ \"$currusr\" ]; then\n echo -e \"\\e[00;31m[-] Current user/group info:\\e[00m\\n$currusr\" \n echo -e \"\\n\"\nfi\n\n#last logged on user information\nlastlogedonusrs=`lastlog 2>/dev/null |grep -v \"Never\" 2>/dev/null`\nif [ \"$lastlogedonusrs\" ]; then\n echo -e \"\\e[00;31m[-] Users that have previously logged onto the system:\\e[00m\\n$lastlogedonusrs\" \n echo -e \"\\n\" \nfi\n\n#who else is logged on\nloggedonusrs=`w 2>/dev/null`\nif [ \"$loggedonusrs\" ]; then\n echo -e \"\\e[00;31m[-] Who else is logged on:\\e[00m\\n$loggedonusrs\" \n echo -e \"\\n\"\nfi\n\n#lists all id's and respective group(s)\ngrpinfo=`for i in $(cut -d\":\" -f1 /etc/passwd 2>/dev/null);do id $i;done 2>/dev/null`\nif [ \"$grpinfo\" ]; then\n echo -e \"\\e[00;31m[-] Group memberships:\\e[00m\\n$grpinfo\"\n echo -e \"\\n\"\nfi\n\n#added by phackt - look for adm group (thanks patrick)\nadm_users=$(echo -e \"$grpinfo\" | grep \"(adm)\")\nif [[ ! -z $adm_users ]];\n then\n echo -e \"\\e[00;31m[-] It looks like we have some admin users:\\e[00m\\n$adm_users\"\n echo -e \"\\n\"\nfi\n\n#checks to see if any hashes are stored in /etc/passwd (depreciated *nix storage method)\nhashesinpasswd=`grep -v '^[^:]*:[x]' /etc/passwd 2>/dev/null`\nif [ \"$hashesinpasswd\" ]; then\n echo -e \"\\e[00;33m[+] It looks like we have password hashes in /etc/passwd!\\e[00m\\n$hashesinpasswd\" \n echo -e \"\\n\"\nfi\n\n#contents of /etc/passwd\nreadpasswd=`cat /etc/passwd 2>/dev/null`\nif [ \"$readpasswd\" ]; then\n echo -e \"\\e[00;31m[-] Contents of /etc/passwd:\\e[00m\\n$readpasswd\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$readpasswd\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/passwd $format/etc-export/passwd 2>/dev/null\nfi\n\n#checks to see if the shadow file can be read\nreadshadow=`cat /etc/shadow 2>/dev/null`\nif [ \"$readshadow\" ]; then\n echo -e \"\\e[00;33m[+] We can read the shadow file!\\e[00m\\n$readshadow\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$readshadow\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/shadow $format/etc-export/shadow 2>/dev/null\nfi\n\n#checks to see if /etc/master.passwd can be read - BSD 'shadow' variant\nreadmasterpasswd=`cat /etc/master.passwd 2>/dev/null`\nif [ \"$readmasterpasswd\" ]; then\n echo -e \"\\e[00;33m[+] We can read the master.passwd file!\\e[00m\\n$readmasterpasswd\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$readmasterpasswd\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/master.passwd $format/etc-export/master.passwd 2>/dev/null\nfi\n\n#all root accounts (uid 0)\nsuperman=`grep -v -E \"^#\" /etc/passwd 2>/dev/null| awk -F: '$3 == 0 { print $1}' 2>/dev/null`\nif [ \"$superman\" ]; then\n echo -e \"\\e[00;31m[-] Super user account(s):\\e[00m\\n$superman\"\n echo -e \"\\n\"\nfi\n\n#pull out vital sudoers info\nsudoers=`grep -v -e '^$' /etc/sudoers 2>/dev/null |grep -v \"#\" 2>/dev/null`\nif [ \"$sudoers\" ]; then\n echo -e \"\\e[00;31m[-] Sudoers configuration (condensed):\\e[00m$sudoers\"\n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$sudoers\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/sudoers $format/etc-export/sudoers 2>/dev/null\nfi\n\n#can we sudo without supplying a password\nsudoperms=`echo '' | sudo -S -l -k 2>/dev/null`\nif [ \"$sudoperms\" ]; then\n echo -e \"\\e[00;33m[+] We can sudo without supplying a password!\\e[00m\\n$sudoperms\" \n echo -e \"\\n\"\nfi\n\n#check sudo perms - authenticated\nif [ \"$sudopass\" ]; then\n if [ \"$sudoperms\" ]; then\n :\n else\n sudoauth=`echo $userpassword | sudo -S -l -k 2>/dev/null`\n if [ \"$sudoauth\" ]; then\n echo -e \"\\e[00;33m[+] We can sudo when supplying a password!\\e[00m\\n$sudoauth\" \n echo -e \"\\n\"\n fi\n fi\nfi\n\n##known 'good' breakout binaries (cleaned to parse /etc/sudoers for comma separated values) - authenticated\nif [ \"$sudopass\" ]; then\n if [ \"$sudoperms\" ]; then\n :\n else\n sudopermscheck=`echo $userpassword | sudo -S -l -k 2>/dev/null | xargs -n 1 2>/dev/null|sed 's/,*$//g' 2>/dev/null | grep -w $binarylist 2>/dev/null`\n if [ \"$sudopermscheck\" ]; then\n echo -e \"\\e[00;33m[-] Possible sudo pwnage!\\e[00m\\n$sudopermscheck\" \n echo -e \"\\n\"\n fi\n fi\nfi\n\n#known 'good' breakout binaries (cleaned to parse /etc/sudoers for comma separated values)\nsudopwnage=`echo '' | sudo -S -l -k 2>/dev/null | xargs -n 1 2>/dev/null | sed 's/,*$//g' 2>/dev/null | grep -w $binarylist 2>/dev/null`\nif [ \"$sudopwnage\" ]; then\n echo -e \"\\e[00;33m[+] Possible sudo pwnage!\\e[00m\\n$sudopwnage\" \n echo -e \"\\n\"\nfi\n\n#who has sudoed in the past\nwhohasbeensudo=`find /home -name .sudo_as_admin_successful 2>/dev/null`\nif [ \"$whohasbeensudo\" ]; then\n echo -e \"\\e[00;31m[-] Accounts that have recently used sudo:\\e[00m\\n$whohasbeensudo\" \n echo -e \"\\n\"\nfi\n\n#checks to see if roots home directory is accessible\nrthmdir=`ls -ahl /root/ 2>/dev/null`\nif [ \"$rthmdir\" ]; then\n echo -e \"\\e[00;33m[+] We can read root's home directory!\\e[00m\\n$rthmdir\" \n echo -e \"\\n\"\nfi\n\n#displays /home directory permissions - check if any are lax\nhomedirperms=`ls -ahl /home/ 2>/dev/null`\nif [ \"$homedirperms\" ]; then\n echo -e \"\\e[00;31m[-] Are permissions on /home directories lax:\\e[00m\\n$homedirperms\" \n echo -e \"\\n\"\nfi\n\n#looks for files we can write to that don't belong to us\nif [ \"$thorough\" = \"1\" ]; then\n grfilesall=`find / -writable ! -user \\`whoami\\` -type f ! -path \"/proc/*\" ! -path \"/sys/*\" -exec ls -al {} \\; 2>/dev/null`\n if [ \"$grfilesall\" ]; then\n echo -e \"\\e[00;31m[-] Files not owned by user but writable by group:\\e[00m\\n$grfilesall\" \n echo -e \"\\n\"\n fi\nfi\n\n#looks for files that belong to us\nif [ \"$thorough\" = \"1\" ]; then\n ourfilesall=`find / -user \\`whoami\\` -type f ! -path \"/proc/*\" ! -path \"/sys/*\" -exec ls -al {} \\; 2>/dev/null`\n if [ \"$ourfilesall\" ]; then\n echo -e \"\\e[00;31m[-] Files owned by our user:\\e[00m\\n$ourfilesall\"\n echo -e \"\\n\"\n fi\nfi\n\n#looks for hidden files\nif [ \"$thorough\" = \"1\" ]; then\n hiddenfiles=`find / -name \".*\" -type f ! -path \"/proc/*\" ! -path \"/sys/*\" -exec ls -al {} \\; 2>/dev/null`\n if [ \"$hiddenfiles\" ]; then\n echo -e \"\\e[00;31m[-] Hidden files:\\e[00m\\n$hiddenfiles\"\n echo -e \"\\n\"\n fi\nfi\n\n#looks for world-reabable files within /home - depending on number of /home dirs & files, this can take some time so is only 'activated' with thorough scanning switch\nif [ \"$thorough\" = \"1\" ]; then\nwrfileshm=`find /home/ -perm -4 -type f -exec ls -al {} \\; 2>/dev/null`\n\tif [ \"$wrfileshm\" ]; then\n\t\techo -e \"\\e[00;31m[-] World-readable files within /home:\\e[00m\\n$wrfileshm\" \n\t\techo -e \"\\n\"\n\tfi\nfi\n\nif [ \"$thorough\" = \"1\" ]; then\n\tif [ \"$export\" ] && [ \"$wrfileshm\" ]; then\n\t\tmkdir $format/wr-files/ 2>/dev/null\n\t\tfor i in $wrfileshm; do cp --parents $i $format/wr-files/ ; done 2>/dev/null\n\tfi\nfi\n\n#lists current user's home directory contents\nif [ \"$thorough\" = \"1\" ]; then\nhomedircontents=`ls -ahl ~ 2>/dev/null`\n\tif [ \"$homedircontents\" ] ; then\n\t\techo -e \"\\e[00;31m[-] Home directory contents:\\e[00m\\n$homedircontents\" \n\t\techo -e \"\\n\" \n\tfi\nfi\n\n#checks for if various ssh files are accessible - this can take some time so is only 'activated' with thorough scanning switch\nif [ \"$thorough\" = \"1\" ]; then\nsshfiles=`find / \\( -name \"id_dsa*\" -o -name \"id_rsa*\" -o -name \"known_hosts\" -o -name \"authorized_hosts\" -o -name \"authorized_keys\" \\) -exec ls -la {} 2>/dev/null \\;`\n\tif [ \"$sshfiles\" ]; then\n\t\techo -e \"\\e[00;31m[-] SSH keys/host information found in the following locations:\\e[00m\\n$sshfiles\" \n\t\techo -e \"\\n\"\n\tfi\nfi\n\nif [ \"$thorough\" = \"1\" ]; then\n\tif [ \"$export\" ] && [ \"$sshfiles\" ]; then\n\t\tmkdir $format/ssh-files/ 2>/dev/null\n\t\tfor i in $sshfiles; do cp --parents $i $format/ssh-files/; done 2>/dev/null\n\tfi\nfi\n\n#is root permitted to login via ssh\nsshrootlogin=`grep \"PermitRootLogin \" /etc/ssh/sshd_config 2>/dev/null | grep -v \"#\" | awk '{print $2}'`\nif [ \"$sshrootlogin\" = \"yes\" ]; then\n echo -e \"\\e[00;31m[-] Root is allowed to login via SSH:\\e[00m\" ; grep \"PermitRootLogin \" /etc/ssh/sshd_config 2>/dev/null | grep -v \"#\" \n echo -e \"\\n\"\nfi\n}\n\nenvironmental_info()\n{\necho -e \"\\e[00;33m### ENVIRONMENTAL #######################################\\e[00m\" \n\n#env information\nenvinfo=`env 2>/dev/null | grep -v 'LS_COLORS' 2>/dev/null`\nif [ \"$envinfo\" ]; then\n echo -e \"\\e[00;31m[-] Environment information:\\e[00m\\n$envinfo\" \n echo -e \"\\n\"\nfi\n\n#check if selinux is enabled\nsestatus=`sestatus 2>/dev/null`\nif [ \"$sestatus\" ]; then\n echo -e \"\\e[00;31m[-] SELinux seems to be present:\\e[00m\\n$sestatus\"\n echo -e \"\\n\"\nfi\n\n#phackt\n\n#current path configuration\npathinfo=`echo $PATH 2>/dev/null`\nif [ \"$pathinfo\" ]; then\n pathswriteable=`ls -ld $(echo $PATH | tr \":\" \" \")`\n echo -e \"\\e[00;31m[-] Path information:\\e[00m\\n$pathinfo\" \n echo -e \"$pathswriteable\"\n echo -e \"\\n\"\nfi\n\n#lists available shells\nshellinfo=`cat /etc/shells 2>/dev/null`\nif [ \"$shellinfo\" ]; then\n echo -e \"\\e[00;31m[-] Available shells:\\e[00m\\n$shellinfo\" \n echo -e \"\\n\"\nfi\n\n#current umask value with both octal and symbolic output\numaskvalue=`umask -S 2>/dev/null & umask 2>/dev/null`\nif [ \"$umaskvalue\" ]; then\n echo -e \"\\e[00;31m[-] Current umask value:\\e[00m\\n$umaskvalue\" \n echo -e \"\\n\"\nfi\n\n#umask value as in /etc/login.defs\numaskdef=`grep -i \"^UMASK\" /etc/login.defs 2>/dev/null`\nif [ \"$umaskdef\" ]; then\n echo -e \"\\e[00;31m[-] umask value as specified in /etc/login.defs:\\e[00m\\n$umaskdef\" \n echo -e \"\\n\"\nfi\n\n#password policy information as stored in /etc/login.defs\nlogindefs=`grep \"^PASS_MAX_DAYS\\|^PASS_MIN_DAYS\\|^PASS_WARN_AGE\\|^ENCRYPT_METHOD\" /etc/login.defs 2>/dev/null`\nif [ \"$logindefs\" ]; then\n echo -e \"\\e[00;31m[-] Password and storage information:\\e[00m\\n$logindefs\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$logindefs\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/login.defs $format/etc-export/login.defs 2>/dev/null\nfi\n}\n\njob_info()\n{\necho -e \"\\e[00;33m### JOBS/TASKS ##########################################\\e[00m\" \n\n#are there any cron jobs configured\ncronjobs=`ls -la /etc/cron* 2>/dev/null`\nif [ \"$cronjobs\" ]; then\n echo -e \"\\e[00;31m[-] Cron jobs:\\e[00m\\n$cronjobs\" \n echo -e \"\\n\"\nfi\n\n#can we manipulate these jobs in any way\ncronjobwwperms=`find /etc/cron* -perm -0002 -type f -exec ls -la {} \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$cronjobwwperms\" ]; then\n echo -e \"\\e[00;33m[+] World-writable cron jobs and file contents:\\e[00m\\n$cronjobwwperms\" \n echo -e \"\\n\"\nfi\n\n#contab contents\ncrontabvalue=`cat /etc/crontab 2>/dev/null`\nif [ \"$crontabvalue\" ]; then\n echo -e \"\\e[00;31m[-] Crontab contents:\\e[00m\\n$crontabvalue\" \n echo -e \"\\n\"\nfi\n\ncrontabvar=`ls -la /var/spool/cron/crontabs 2>/dev/null`\nif [ \"$crontabvar\" ]; then\n echo -e \"\\e[00;31m[-] Anything interesting in /var/spool/cron/crontabs:\\e[00m\\n$crontabvar\" \n echo -e \"\\n\"\nfi\n\nanacronjobs=`ls -la /etc/anacrontab 2>/dev/null; cat /etc/anacrontab 2>/dev/null`\nif [ \"$anacronjobs\" ]; then\n echo -e \"\\e[00;31m[-] Anacron jobs and associated file permissions:\\e[00m\\n$anacronjobs\" \n echo -e \"\\n\"\nfi\n\nanacrontab=`ls -la /var/spool/anacron 2>/dev/null`\nif [ \"$anacrontab\" ]; then\n echo -e \"\\e[00;31m[-] When were jobs last executed (/var/spool/anacron contents):\\e[00m\\n$anacrontab\" \n echo -e \"\\n\"\nfi\n\n#pull out account names from /etc/passwd and see if any users have associated cronjobs (priv command)\ncronother=`cut -d \":\" -f 1 /etc/passwd | xargs -n1 crontab -l -u 2>/dev/null`\nif [ \"$cronother\" ]; then\n echo -e \"\\e[00;31m[-] Jobs held by all users:\\e[00m\\n$cronother\" \n echo -e \"\\n\"\nfi\n\n# list systemd timers\nif [ \"$thorough\" = \"1\" ]; then\n # include inactive timers in thorough mode\n systemdtimers=\"$(systemctl list-timers --all 2>/dev/null)\"\n info=\"\"\nelse\n systemdtimers=\"$(systemctl list-timers 2>/dev/null |head -n -1 2>/dev/null)\"\n # replace the info in the output with a hint towards thorough mode\n info=\"\\e[2mEnable thorough tests to see inactive timers\\e[00m\"\nfi\nif [ \"$systemdtimers\" ]; then\n echo -e \"\\e[00;31m[-] Systemd timers:\\e[00m\\n$systemdtimers\\n$info\"\n echo -e \"\\n\"\nfi\n\n}\n\nnetworking_info()\n{\necho -e \"\\e[00;33m### NETWORKING ##########################################\\e[00m\" \n\n#nic information\nnicinfo=`/sbin/ifconfig -a 2>/dev/null`\nif [ \"$nicinfo\" ]; then\n echo -e \"\\e[00;31m[-] Network and IP info:\\e[00m\\n$nicinfo\" \n echo -e \"\\n\"\nfi\n\n#nic information (using ip)\nnicinfoip=`/sbin/ip a 2>/dev/null`\nif [ ! \"$nicinfo\" ] && [ \"$nicinfoip\" ]; then\n echo -e \"\\e[00;31m[-] Network and IP info:\\e[00m\\n$nicinfoip\" \n echo -e \"\\n\"\nfi\n\narpinfo=`arp -a 2>/dev/null`\nif [ \"$arpinfo\" ]; then\n echo -e \"\\e[00;31m[-] ARP history:\\e[00m\\n$arpinfo\" \n echo -e \"\\n\"\nfi\n\narpinfoip=`ip n 2>/dev/null`\nif [ ! \"$arpinfo\" ] && [ \"$arpinfoip\" ]; then\n echo -e \"\\e[00;31m[-] ARP history:\\e[00m\\n$arpinfoip\" \n echo -e \"\\n\"\nfi\n\n#dns settings\nnsinfo=`grep \"nameserver\" /etc/resolv.conf 2>/dev/null`\nif [ \"$nsinfo\" ]; then\n echo -e \"\\e[00;31m[-] Nameserver(s):\\e[00m\\n$nsinfo\" \n echo -e \"\\n\"\nfi\n\nnsinfosysd=`systemd-resolve --status 2>/dev/null`\nif [ \"$nsinfosysd\" ]; then\n echo -e \"\\e[00;31m[-] Nameserver(s):\\e[00m\\n$nsinfosysd\" \n echo -e \"\\n\"\nfi\n\n#default route configuration\ndefroute=`route 2>/dev/null | grep default`\nif [ \"$defroute\" ]; then\n echo -e \"\\e[00;31m[-] Default route:\\e[00m\\n$defroute\" \n echo -e \"\\n\"\nfi\n\n#default route configuration\ndefrouteip=`ip r 2>/dev/null | grep default`\nif [ ! \"$defroute\" ] && [ \"$defrouteip\" ]; then\n echo -e \"\\e[00;31m[-] Default route:\\e[00m\\n$defrouteip\" \n echo -e \"\\n\"\nfi\n\n#listening TCP\ntcpservs=`netstat -ntpl 2>/dev/null`\nif [ \"$tcpservs\" ]; then\n echo -e \"\\e[00;31m[-] Listening TCP:\\e[00m\\n$tcpservs\" \n echo -e \"\\n\"\nfi\n\ntcpservsip=`ss -t -l -n 2>/dev/null`\nif [ ! \"$tcpservs\" ] && [ \"$tcpservsip\" ]; then\n echo -e \"\\e[00;31m[-] Listening TCP:\\e[00m\\n$tcpservsip\" \n echo -e \"\\n\"\nfi\n\n#listening UDP\nudpservs=`netstat -nupl 2>/dev/null`\nif [ \"$udpservs\" ]; then\n echo -e \"\\e[00;31m[-] Listening UDP:\\e[00m\\n$udpservs\" \n echo -e \"\\n\"\nfi\n\nudpservsip=`ss -u -l -n 2>/dev/null`\nif [ ! \"$udpservs\" ] && [ \"$udpservsip\" ]; then\n echo -e \"\\e[00;31m[-] Listening UDP:\\e[00m\\n$udpservsip\" \n echo -e \"\\n\"\nfi\n}\n\nservices_info()\n{\necho -e \"\\e[00;33m### SERVICES #############################################\\e[00m\" \n\n#running processes\npsaux=`ps aux 2>/dev/null`\nif [ \"$psaux\" ]; then\n echo -e \"\\e[00;31m[-] Running processes:\\e[00m\\n$psaux\" \n echo -e \"\\n\"\nfi\n\n#lookup process binary path and permissisons\nprocperm=`ps aux 2>/dev/null | awk '{print $11}'|xargs -r ls -la 2>/dev/null |awk '!x[$0]++' 2>/dev/null`\nif [ \"$procperm\" ]; then\n echo -e \"\\e[00;31m[-] Process binaries and associated permissions (from above list):\\e[00m\\n$procperm\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$procperm\" ]; then\nprocpermbase=`ps aux 2>/dev/null | awk '{print $11}' | xargs -r ls 2>/dev/null | awk '!x[$0]++' 2>/dev/null`\n mkdir $format/ps-export/ 2>/dev/null\n for i in $procpermbase; do cp --parents $i $format/ps-export/; done 2>/dev/null\nfi\n\n#anything 'useful' in inetd.conf\ninetdread=`cat /etc/inetd.conf 2>/dev/null`\nif [ \"$inetdread\" ]; then\n echo -e \"\\e[00;31m[-] Contents of /etc/inetd.conf:\\e[00m\\n$inetdread\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$inetdread\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/inetd.conf $format/etc-export/inetd.conf 2>/dev/null\nfi\n\n#very 'rough' command to extract associated binaries from inetd.conf & show permisisons of each\ninetdbinperms=`awk '{print $7}' /etc/inetd.conf 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$inetdbinperms\" ]; then\n echo -e \"\\e[00;31m[-] The related inetd binary permissions:\\e[00m\\n$inetdbinperms\" \n echo -e \"\\n\"\nfi\n\nxinetdread=`cat /etc/xinetd.conf 2>/dev/null`\nif [ \"$xinetdread\" ]; then\n echo -e \"\\e[00;31m[-] Contents of /etc/xinetd.conf:\\e[00m\\n$xinetdread\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$xinetdread\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/xinetd.conf $format/etc-export/xinetd.conf 2>/dev/null\nfi\n\nxinetdincd=`grep \"/etc/xinetd.d\" /etc/xinetd.conf 2>/dev/null`\nif [ \"$xinetdincd\" ]; then\n echo -e \"\\e[00;31m[-] /etc/xinetd.d is included in /etc/xinetd.conf - associated binary permissions are listed below:\\e[00m\"; ls -la /etc/xinetd.d 2>/dev/null \n echo -e \"\\n\"\nfi\n\n#very 'rough' command to extract associated binaries from xinetd.conf & show permisisons of each\nxinetdbinperms=`awk '{print $7}' /etc/xinetd.conf 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$xinetdbinperms\" ]; then\n echo -e \"\\e[00;31m[-] The related xinetd binary permissions:\\e[00m\\n$xinetdbinperms\" \n echo -e \"\\n\"\nfi\n\ninitdread=`ls -la /etc/init.d 2>/dev/null`\nif [ \"$initdread\" ]; then\n echo -e \"\\e[00;31m[-] /etc/init.d/ binary permissions:\\e[00m\\n$initdread\" \n echo -e \"\\n\"\nfi\n\n#init.d files NOT belonging to root!\ninitdperms=`find /etc/init.d/ \\! -uid 0 -type f 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$initdperms\" ]; then\n echo -e \"\\e[00;31m[-] /etc/init.d/ files not belonging to root:\\e[00m\\n$initdperms\" \n echo -e \"\\n\"\nfi\n\nrcdread=`ls -la /etc/rc.d/init.d 2>/dev/null`\nif [ \"$rcdread\" ]; then\n echo -e \"\\e[00;31m[-] /etc/rc.d/init.d binary permissions:\\e[00m\\n$rcdread\" \n echo -e \"\\n\"\nfi\n\n#init.d files NOT belonging to root!\nrcdperms=`find /etc/rc.d/init.d \\! -uid 0 -type f 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$rcdperms\" ]; then\n echo -e \"\\e[00;31m[-] /etc/rc.d/init.d files not belonging to root:\\e[00m\\n$rcdperms\" \n echo -e \"\\n\"\nfi\n\nusrrcdread=`ls -la /usr/local/etc/rc.d 2>/dev/null`\nif [ \"$usrrcdread\" ]; then\n echo -e \"\\e[00;31m[-] /usr/local/etc/rc.d binary permissions:\\e[00m\\n$usrrcdread\" \n echo -e \"\\n\"\nfi\n\n#rc.d files NOT belonging to root!\nusrrcdperms=`find /usr/local/etc/rc.d \\! -uid 0 -type f 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$usrrcdperms\" ]; then\n echo -e \"\\e[00;31m[-] /usr/local/etc/rc.d files not belonging to root:\\e[00m\\n$usrrcdperms\" \n echo -e \"\\n\"\nfi\n\ninitread=`ls -la /etc/init/ 2>/dev/null`\nif [ \"$initread\" ]; then\n echo -e \"\\e[00;31m[-] /etc/init/ config file permissions:\\e[00m\\n$initread\"\n echo -e \"\\n\"\nfi\n\n# upstart scripts not belonging to root\ninitperms=`find /etc/init \\! -uid 0 -type f 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$initperms\" ]; then\n echo -e \"\\e[00;31m[-] /etc/init/ config files not belonging to root:\\e[00m\\n$initperms\"\n echo -e \"\\n\"\nfi\n\nsystemdread=`ls -lthR /lib/systemd/ 2>/dev/null`\nif [ \"$systemdread\" ]; then\n echo -e \"\\e[00;31m[-] /lib/systemd/* config file permissions:\\e[00m\\n$systemdread\"\n echo -e \"\\n\"\nfi\n\n# systemd files not belonging to root\nsystemdperms=`find /lib/systemd/ \\! -uid 0 -type f 2>/dev/null |xargs -r ls -la 2>/dev/null`\nif [ \"$systemdperms\" ]; then\n echo -e \"\\e[00;33m[+] /lib/systemd/* config files not belonging to root:\\e[00m\\n$systemdperms\"\n echo -e \"\\n\"\nfi\n}\n\nsoftware_configs()\n{\necho -e \"\\e[00;33m### SOFTWARE #############################################\\e[00m\" \n\n#sudo version - check to see if there are any known vulnerabilities with this\nsudover=`sudo -V 2>/dev/null| grep \"Sudo version\" 2>/dev/null`\nif [ \"$sudover\" ]; then\n echo -e \"\\e[00;31m[-] Sudo version:\\e[00m\\n$sudover\" \n echo -e \"\\n\"\nfi\n\n#mysql details - if installed\nmysqlver=`mysql --version 2>/dev/null`\nif [ \"$mysqlver\" ]; then\n echo -e \"\\e[00;31m[-] MYSQL version:\\e[00m\\n$mysqlver\" \n echo -e \"\\n\"\nfi\n\n#checks to see if root/root will get us a connection\nmysqlconnect=`mysqladmin -uroot -proot version 2>/dev/null`\nif [ \"$mysqlconnect\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to the local MYSQL service with default root/root credentials!\\e[00m\\n$mysqlconnect\" \n echo -e \"\\n\"\nfi\n\n#mysql version details\nmysqlconnectnopass=`mysqladmin -uroot version 2>/dev/null`\nif [ \"$mysqlconnectnopass\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to the local MYSQL service as 'root' and without a password!\\e[00m\\n$mysqlconnectnopass\" \n echo -e \"\\n\"\nfi\n\n#postgres details - if installed\npostgver=`psql -V 2>/dev/null`\nif [ \"$postgver\" ]; then\n echo -e \"\\e[00;31m[-] Postgres version:\\e[00m\\n$postgver\" \n echo -e \"\\n\"\nfi\n\n#checks to see if any postgres password exists and connects to DB 'template0' - following commands are a variant on this\npostcon1=`psql -U postgres -w template0 -c 'select version()' 2>/dev/null | grep version`\nif [ \"$postcon1\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to Postgres DB 'template0' as user 'postgres' with no password!:\\e[00m\\n$postcon1\" \n echo -e \"\\n\"\nfi\n\npostcon11=`psql -U postgres -w template1 -c 'select version()' 2>/dev/null | grep version`\nif [ \"$postcon11\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to Postgres DB 'template1' as user 'postgres' with no password!:\\e[00m\\n$postcon11\" \n echo -e \"\\n\"\nfi\n\npostcon2=`psql -U pgsql -w template0 -c 'select version()' 2>/dev/null | grep version`\nif [ \"$postcon2\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to Postgres DB 'template0' as user 'psql' with no password!:\\e[00m\\n$postcon2\" \n echo -e \"\\n\"\nfi\n\npostcon22=`psql -U pgsql -w template1 -c 'select version()' 2>/dev/null | grep version`\nif [ \"$postcon22\" ]; then\n echo -e \"\\e[00;33m[+] We can connect to Postgres DB 'template1' as user 'psql' with no password!:\\e[00m\\n$postcon22\" \n echo -e \"\\n\"\nfi\n\n#apache details - if installed\napachever=`apache2 -v 2>/dev/null; httpd -v 2>/dev/null`\nif [ \"$apachever\" ]; then\n echo -e \"\\e[00;31m[-] Apache version:\\e[00m\\n$apachever\" \n echo -e \"\\n\"\nfi\n\n#what account is apache running under\napacheusr=`grep -i 'user\\|group' /etc/apache2/envvars 2>/dev/null |awk '{sub(/.*\\export /,\"\")}1' 2>/dev/null`\nif [ \"$apacheusr\" ]; then\n echo -e \"\\e[00;31m[-] Apache user configuration:\\e[00m\\n$apacheusr\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$apacheusr\" ]; then\n mkdir --parents $format/etc-export/apache2/ 2>/dev/null\n cp /etc/apache2/envvars $format/etc-export/apache2/envvars 2>/dev/null\nfi\n\n#installed apache modules\napachemodules=`apache2ctl -M 2>/dev/null; httpd -M 2>/dev/null`\nif [ \"$apachemodules\" ]; then\n echo -e \"\\e[00;31m[-] Installed Apache modules:\\e[00m\\n$apachemodules\" \n echo -e \"\\n\"\nfi\n\n#htpasswd check\nhtpasswd=`find / -name .htpasswd -print -exec cat {} \\; 2>/dev/null`\nif [ \"$htpasswd\" ]; then\n echo -e \"\\e[00;33m[-] htpasswd found - could contain passwords:\\e[00m\\n$htpasswd\"\n echo -e \"\\n\"\nfi\n\n#anything in the default http home dirs (a thorough only check as output can be large)\nif [ \"$thorough\" = \"1\" ]; then\n apachehomedirs=`ls -alhR /var/www/ 2>/dev/null; ls -alhR /srv/www/htdocs/ 2>/dev/null; ls -alhR /usr/local/www/apache2/data/ 2>/dev/null; ls -alhR /opt/lampp/htdocs/ 2>/dev/null`\n if [ \"$apachehomedirs\" ]; then\n echo -e \"\\e[00;31m[-] www home dir contents:\\e[00m\\n$apachehomedirs\" \n echo -e \"\\n\"\n fi\nfi\n\n}\n\ninteresting_files()\n{\necho -e \"\\e[00;33m### INTERESTING FILES ####################################\\e[00m\" \n\n#checks to see if various files are installed\necho -e \"\\e[00;31m[-] Useful file locations:\\e[00m\" ; which nc 2>/dev/null ; which netcat 2>/dev/null ; which wget 2>/dev/null ; which nmap 2>/dev/null ; which gcc 2>/dev/null; which curl 2>/dev/null \necho -e \"\\n\" \n\n#limited search for installed compilers\ncompiler=`dpkg --list 2>/dev/null| grep compiler |grep -v decompiler 2>/dev/null && yum list installed 'gcc*' 2>/dev/null| grep gcc 2>/dev/null`\nif [ \"$compiler\" ]; then\n echo -e \"\\e[00;31m[-] Installed compilers:\\e[00m\\n$compiler\" \n echo -e \"\\n\"\nfi\n\n#manual check - lists out sensitive files, can we read/modify etc.\necho -e \"\\e[00;31m[-] Can we read/write sensitive files:\\e[00m\" ; ls -la /etc/passwd 2>/dev/null ; ls -la /etc/group 2>/dev/null ; ls -la /etc/profile 2>/dev/null; ls -la /etc/shadow 2>/dev/null ; ls -la /etc/master.passwd 2>/dev/null \necho -e \"\\n\" \n\n#search for suid files\nallsuid=`find / -perm -4000 -type f 2>/dev/null`\nfindsuid=`find $allsuid -perm -4000 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$findsuid\" ]; then\n echo -e \"\\e[00;31m[-] SUID files:\\e[00m\\n$findsuid\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$findsuid\" ]; then\n mkdir $format/suid-files/ 2>/dev/null\n for i in $findsuid; do cp $i $format/suid-files/; done 2>/dev/null\nfi\n\n#list of 'interesting' suid files - feel free to make additions\nintsuid=`find $allsuid -perm -4000 -type f -exec ls -la {} \\; 2>/dev/null | grep -w $binarylist 2>/dev/null`\nif [ \"$intsuid\" ]; then\n echo -e \"\\e[00;33m[+] Possibly interesting SUID files:\\e[00m\\n$intsuid\" \n echo -e \"\\n\"\nfi\n\n#lists world-writable suid files\nwwsuid=`find $allsuid -perm -4002 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$wwsuid\" ]; then\n echo -e \"\\e[00;33m[+] World-writable SUID files:\\e[00m\\n$wwsuid\" \n echo -e \"\\n\"\nfi\n\n#lists world-writable suid files owned by root\nwwsuidrt=`find $allsuid -uid 0 -perm -4002 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$wwsuidrt\" ]; then\n echo -e \"\\e[00;33m[+] World-writable SUID files owned by root:\\e[00m\\n$wwsuidrt\" \n echo -e \"\\n\"\nfi\n\n#search for sgid files\nallsgid=`find / -perm -2000 -type f 2>/dev/null`\nfindsgid=`find $allsgid -perm -2000 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$findsgid\" ]; then\n echo -e \"\\e[00;31m[-] SGID files:\\e[00m\\n$findsgid\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$findsgid\" ]; then\n mkdir $format/sgid-files/ 2>/dev/null\n for i in $findsgid; do cp $i $format/sgid-files/; done 2>/dev/null\nfi\n\n#list of 'interesting' sgid files\nintsgid=`find $allsgid -perm -2000 -type f -exec ls -la {} \\; 2>/dev/null | grep -w $binarylist 2>/dev/null`\nif [ \"$intsgid\" ]; then\n echo -e \"\\e[00;33m[+] Possibly interesting SGID files:\\e[00m\\n$intsgid\" \n echo -e \"\\n\"\nfi\n\n#lists world-writable sgid files\nwwsgid=`find $allsgid -perm -2002 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$wwsgid\" ]; then\n echo -e \"\\e[00;33m[+] World-writable SGID files:\\e[00m\\n$wwsgid\" \n echo -e \"\\n\"\nfi\n\n#lists world-writable sgid files owned by root\nwwsgidrt=`find $allsgid -uid 0 -perm -2002 -type f -exec ls -la {} 2>/dev/null \\;`\nif [ \"$wwsgidrt\" ]; then\n echo -e \"\\e[00;33m[+] World-writable SGID files owned by root:\\e[00m\\n$wwsgidrt\" \n echo -e \"\\n\"\nfi\n\n#list all files with POSIX capabilities set along with there capabilities\nfileswithcaps=`getcap -r / 2>/dev/null || /sbin/getcap -r / 2>/dev/null`\nif [ \"$fileswithcaps\" ]; then\n echo -e \"\\e[00;31m[+] Files with POSIX capabilities set:\\e[00m\\n$fileswithcaps\"\n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$fileswithcaps\" ]; then\n mkdir $format/files_with_capabilities/ 2>/dev/null\n for i in $fileswithcaps; do cp $i $format/files_with_capabilities/; done 2>/dev/null\nfi\n\n#searches /etc/security/capability.conf for users associated capapilies\nuserswithcaps=`grep -v '^#\\|none\\|^$' /etc/security/capability.conf 2>/dev/null`\nif [ \"$userswithcaps\" ]; then\n echo -e \"\\e[00;33m[+] Users with specific POSIX capabilities:\\e[00m\\n$userswithcaps\"\n echo -e \"\\n\"\nfi\n\nif [ \"$userswithcaps\" ] ; then\n#matches the capabilities found associated with users with the current user\nmatchedcaps=`echo -e \"$userswithcaps\" | grep \\`whoami\\` | awk '{print $1}' 2>/dev/null`\n\tif [ \"$matchedcaps\" ]; then\n\t\techo -e \"\\e[00;33m[+] Capabilities associated with the current user:\\e[00m\\n$matchedcaps\"\n\t\techo -e \"\\n\"\n\t\t#matches the files with capapbilities with capabilities associated with the current user\n\t\tmatchedfiles=`echo -e \"$matchedcaps\" | while read -r cap ; do echo -e \"$fileswithcaps\" | grep \"$cap\" ; done 2>/dev/null`\n\t\tif [ \"$matchedfiles\" ]; then\n\t\t\techo -e \"\\e[00;33m[+] Files with the same capabilities associated with the current user (You may want to try abusing those capabilties):\\e[00m\\n$matchedfiles\"\n\t\t\techo -e \"\\n\"\n\t\t\t#lists the permissions of the files having the same capabilies associated with the current user\n\t\t\tmatchedfilesperms=`echo -e \"$matchedfiles\" | awk '{print $1}' | while read -r f; do ls -la $f ;done 2>/dev/null`\n\t\t\techo -e \"\\e[00;33m[+] Permissions of files with the same capabilities associated with the current user:\\e[00m\\n$matchedfilesperms\"\n\t\t\techo -e \"\\n\"\n\t\t\tif [ \"$matchedfilesperms\" ]; then\n\t\t\t\t#checks if any of the files with same capabilities associated with the current user is writable\n\t\t\t\twritablematchedfiles=`echo -e \"$matchedfiles\" | awk '{print $1}' | while read -r f; do find $f -writable -exec ls -la {} + ;done 2>/dev/null`\n\t\t\t\tif [ \"$writablematchedfiles\" ]; then\n\t\t\t\t\techo -e \"\\e[00;33m[+] User/Group writable files with the same capabilities associated with the current user:\\e[00m\\n$writablematchedfiles\"\n\t\t\t\t\techo -e \"\\n\"\n\t\t\t\tfi\n\t\t\tfi\n\t\tfi\n\tfi\nfi\n\n#look for private keys - thanks djhohnstein\nif [ \"$thorough\" = \"1\" ]; then\nprivatekeyfiles=`grep -rl \"PRIVATE KEY-----\" /home 2>/dev/null`\n\tif [ \"$privatekeyfiles\" ]; then\n \t\techo -e \"\\e[00;33m[+] Private SSH keys found!:\\e[00m\\n$privatekeyfiles\"\n \t\techo -e \"\\n\"\n\tfi\nfi\n\n#look for AWS keys - thanks djhohnstein\nif [ \"$thorough\" = \"1\" ]; then\nawskeyfiles=`grep -rli \"aws_secret_access_key\" /home 2>/dev/null`\n\tif [ \"$awskeyfiles\" ]; then\n \t\techo -e \"\\e[00;33m[+] AWS secret keys found!:\\e[00m\\n$awskeyfiles\"\n \t\techo -e \"\\n\"\n\tfi\nfi\n\n#look for git credential files - thanks djhohnstein\nif [ \"$thorough\" = \"1\" ]; then\ngitcredfiles=`find / -name \".git-credentials\" 2>/dev/null`\n\tif [ \"$gitcredfiles\" ]; then\n \t\techo -e \"\\e[00;33m[+] Git credentials saved on the machine!:\\e[00m\\n$gitcredfiles\"\n \t\techo -e \"\\n\"\n\tfi\nfi\n\n#list all world-writable files excluding /proc and /sys\nif [ \"$thorough\" = \"1\" ]; then\nwwfiles=`find / ! -path \"*/proc/*\" ! -path \"/sys/*\" -perm -2 -type f -exec ls -la {} 2>/dev/null \\;`\n\tif [ \"$wwfiles\" ]; then\n\t\techo -e \"\\e[00;31m[-] World-writable files (excluding /proc and /sys):\\e[00m\\n$wwfiles\" \n\t\techo -e \"\\n\"\n\tfi\nfi\n\nif [ \"$thorough\" = \"1\" ]; then\n\tif [ \"$export\" ] && [ \"$wwfiles\" ]; then\n\t\tmkdir $format/ww-files/ 2>/dev/null\n\t\tfor i in $wwfiles; do cp --parents $i $format/ww-files/; done 2>/dev/null\n\tfi\nfi\n\n#are any .plan files accessible in /home (could contain useful information)\nusrplan=`find /home -iname *.plan -exec ls -la {} \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$usrplan\" ]; then\n echo -e \"\\e[00;31m[-] Plan file permissions and contents:\\e[00m\\n$usrplan\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$usrplan\" ]; then\n mkdir $format/plan_files/ 2>/dev/null\n for i in $usrplan; do cp --parents $i $format/plan_files/; done 2>/dev/null\nfi\n\nbsdusrplan=`find /usr/home -iname *.plan -exec ls -la {} \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$bsdusrplan\" ]; then\n echo -e \"\\e[00;31m[-] Plan file permissions and contents:\\e[00m\\n$bsdusrplan\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$bsdusrplan\" ]; then\n mkdir $format/plan_files/ 2>/dev/null\n for i in $bsdusrplan; do cp --parents $i $format/plan_files/; done 2>/dev/null\nfi\n\n#are there any .rhosts files accessible - these may allow us to login as another user etc.\nrhostsusr=`find /home -iname *.rhosts -exec ls -la {} 2>/dev/null \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$rhostsusr\" ]; then\n echo -e \"\\e[00;33m[+] rhost config file(s) and file contents:\\e[00m\\n$rhostsusr\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$rhostsusr\" ]; then\n mkdir $format/rhosts/ 2>/dev/null\n for i in $rhostsusr; do cp --parents $i $format/rhosts/; done 2>/dev/null\nfi\n\nbsdrhostsusr=`find /usr/home -iname *.rhosts -exec ls -la {} 2>/dev/null \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$bsdrhostsusr\" ]; then\n echo -e \"\\e[00;33m[+] rhost config file(s) and file contents:\\e[00m\\n$bsdrhostsusr\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$bsdrhostsusr\" ]; then\n mkdir $format/rhosts 2>/dev/null\n for i in $bsdrhostsusr; do cp --parents $i $format/rhosts/; done 2>/dev/null\nfi\n\nrhostssys=`find /etc -iname hosts.equiv -exec ls -la {} 2>/dev/null \\; -exec cat {} 2>/dev/null \\;`\nif [ \"$rhostssys\" ]; then\n echo -e \"\\e[00;33m[+] Hosts.equiv file and contents: \\e[00m\\n$rhostssys\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$rhostssys\" ]; then\n mkdir $format/rhosts/ 2>/dev/null\n for i in $rhostssys; do cp --parents $i $format/rhosts/; done 2>/dev/null\nfi\n\n#list nfs shares/permisisons etc.\nnfsexports=`ls -la /etc/exports 2>/dev/null; cat /etc/exports 2>/dev/null`\nif [ \"$nfsexports\" ]; then\n echo -e \"\\e[00;31m[-] NFS config details: \\e[00m\\n$nfsexports\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$nfsexports\" ]; then\n mkdir $format/etc-export/ 2>/dev/null\n cp /etc/exports $format/etc-export/exports 2>/dev/null\nfi\n\nif [ \"$thorough\" = \"1\" ]; then\n #phackt\n #displaying /etc/fstab\n fstab=`cat /etc/fstab 2>/dev/null`\n if [ \"$fstab\" ]; then\n echo -e \"\\e[00;31m[-] NFS displaying partitions and filesystems - you need to check if exotic filesystems\\e[00m\"\n echo -e \"$fstab\"\n echo -e \"\\n\"\n fi\nfi\n\n#looking for credentials in /etc/fstab\nfstab=`grep username /etc/fstab 2>/dev/null |awk '{sub(/.*\\username=/,\"\");sub(/\\,.*/,\"\")}1' 2>/dev/null| xargs -r echo username: 2>/dev/null; grep password /etc/fstab 2>/dev/null |awk '{sub(/.*\\password=/,\"\");sub(/\\,.*/,\"\")}1' 2>/dev/null| xargs -r echo password: 2>/dev/null; grep domain /etc/fstab 2>/dev/null |awk '{sub(/.*\\domain=/,\"\");sub(/\\,.*/,\"\")}1' 2>/dev/null| xargs -r echo domain: 2>/dev/null`\nif [ \"$fstab\" ]; then\n echo -e \"\\e[00;33m[+] Looks like there are credentials in /etc/fstab!\\e[00m\\n$fstab\"\n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$fstab\" ]; then\n mkdir $format/etc-exports/ 2>/dev/null\n cp /etc/fstab $format/etc-exports/fstab done 2>/dev/null\nfi\n\nfstabcred=`grep cred /etc/fstab 2>/dev/null |awk '{sub(/.*\\credentials=/,\"\");sub(/\\,.*/,\"\")}1' 2>/dev/null | xargs -I{} sh -c 'ls -la {}; cat {}' 2>/dev/null`\nif [ \"$fstabcred\" ]; then\n echo -e \"\\e[00;33m[+] /etc/fstab contains a credentials file!\\e[00m\\n$fstabcred\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$fstabcred\" ]; then\n mkdir $format/etc-exports/ 2>/dev/null\n cp /etc/fstab $format/etc-exports/fstab done 2>/dev/null\nfi\n\n#use supplied keyword and cat *.conf files for potential matches - output will show line number within relevant file path where a match has been located\nif [ \"$keyword\" = \"\" ]; then\n echo -e \"[-] Can't search *.conf files as no keyword was entered\\n\" \n else\n confkey=`find / -maxdepth 4 -name *.conf -type f -exec grep -Hn $keyword {} \\; 2>/dev/null`\n if [ \"$confkey\" ]; then\n echo -e \"\\e[00;31m[-] Find keyword ($keyword) in .conf files (recursive 4 levels - output format filepath:identified line number where keyword appears):\\e[00m\\n$confkey\" \n echo -e \"\\n\" \n else \n\techo -e \"\\e[00;31m[-] Find keyword ($keyword) in .conf files (recursive 4 levels):\\e[00m\" \n\techo -e \"'$keyword' not found in any .conf files\" \n\techo -e \"\\n\" \n fi\nfi\n\nif [ \"$keyword\" = \"\" ]; then\n :\n else\n if [ \"$export\" ] && [ \"$confkey\" ]; then\n\t confkeyfile=`find / -maxdepth 4 -name *.conf -type f -exec grep -lHn $keyword {} \\; 2>/dev/null`\n mkdir --parents $format/keyword_file_matches/config_files/ 2>/dev/null\n for i in $confkeyfile; do cp --parents $i $format/keyword_file_matches/config_files/ ; done 2>/dev/null\n fi\nfi\n\n#use supplied keyword and cat *.php files for potential matches - output will show line number within relevant file path where a match has been located\nif [ \"$keyword\" = \"\" ]; then\n echo -e \"[-] Can't search *.php files as no keyword was entered\\n\" \n else\n phpkey=`find / -maxdepth 10 -name *.php -type f -exec grep -Hn $keyword {} \\; 2>/dev/null`\n if [ \"$phpkey\" ]; then\n echo -e \"\\e[00;31m[-] Find keyword ($keyword) in .php files (recursive 10 levels - output format filepath:identified line number where keyword appears):\\e[00m\\n$phpkey\" \n echo -e \"\\n\" \n else \n echo -e \"\\e[00;31m[-] Find keyword ($keyword) in .php files (recursive 10 levels):\\e[00m\" \n echo -e \"'$keyword' not found in any .php files\" \n echo -e \"\\n\" \n fi\nfi\n\nif [ \"$keyword\" = \"\" ]; then\n :\n else\n if [ \"$export\" ] && [ \"$phpkey\" ]; then\n phpkeyfile=`find / -maxdepth 10 -name *.php -type f -exec grep -lHn $keyword {} \\; 2>/dev/null`\n mkdir --parents $format/keyword_file_matches/php_files/ 2>/dev/null\n for i in $phpkeyfile; do cp --parents $i $format/keyword_file_matches/php_files/ ; done 2>/dev/null\n fi\nfi\n\n#use supplied keyword and cat *.log files for potential matches - output will show line number within relevant file path where a match has been located\nif [ \"$keyword\" = \"\" ];then\n echo -e \"[-] Can't search *.log files as no keyword was entered\\n\" \n else\n logkey=`find / -maxdepth 4 -name *.log -type f -exec grep -Hn $keyword {} \\; 2>/dev/null`\n if [ \"$logkey\" ]; then\n echo -e \"\\e[00;31m[-] Find keyword ($keyword) in .log files (recursive 4 levels - output format filepath:identified line number where keyword appears):\\e[00m\\n$logkey\" \n echo -e \"\\n\" \n else \n\techo -e \"\\e[00;31m[-] Find keyword ($keyword) in .log files (recursive 4 levels):\\e[00m\" \n\techo -e \"'$keyword' not found in any .log files\"\n\techo -e \"\\n\" \n fi\nfi\n\nif [ \"$keyword\" = \"\" ];then\n :\n else\n if [ \"$export\" ] && [ \"$logkey\" ]; then\n logkeyfile=`find / -maxdepth 4 -name *.log -type f -exec grep -lHn $keyword {} \\; 2>/dev/null`\n\t mkdir --parents $format/keyword_file_matches/log_files/ 2>/dev/null\n for i in $logkeyfile; do cp --parents $i $format/keyword_file_matches/log_files/ ; done 2>/dev/null\n fi\nfi\n\n#use supplied keyword and cat *.ini files for potential matches - output will show line number within relevant file path where a match has been located\nif [ \"$keyword\" = \"\" ];then\n echo -e \"[-] Can't search *.ini files as no keyword was entered\\n\" \n else\n inikey=`find / -maxdepth 4 -name *.ini -type f -exec grep -Hn $keyword {} \\; 2>/dev/null`\n if [ \"$inikey\" ]; then\n echo -e \"\\e[00;31m[-] Find keyword ($keyword) in .ini files (recursive 4 levels - output format filepath:identified line number where keyword appears):\\e[00m\\n$inikey\" \n echo -e \"\\n\" \n else \n\techo -e \"\\e[00;31m[-] Find keyword ($keyword) in .ini files (recursive 4 levels):\\e[00m\" \n\techo -e \"'$keyword' not found in any .ini files\" \n\techo -e \"\\n\"\n fi\nfi\n\nif [ \"$keyword\" = \"\" ];then\n :\n else\n if [ \"$export\" ] && [ \"$inikey\" ]; then\n\t inikey=`find / -maxdepth 4 -name *.ini -type f -exec grep -lHn $keyword {} \\; 2>/dev/null`\n mkdir --parents $format/keyword_file_matches/ini_files/ 2>/dev/null\n for i in $inikey; do cp --parents $i $format/keyword_file_matches/ini_files/ ; done 2>/dev/null\n fi\nfi\n\n#quick extract of .conf files from /etc - only 1 level\nallconf=`find /etc/ -maxdepth 1 -name *.conf -type f -exec ls -la {} \\; 2>/dev/null`\nif [ \"$allconf\" ]; then\n echo -e \"\\e[00;31m[-] All *.conf files in /etc (recursive 1 level):\\e[00m\\n$allconf\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$allconf\" ]; then\n mkdir $format/conf-files/ 2>/dev/null\n for i in $allconf; do cp --parents $i $format/conf-files/; done 2>/dev/null\nfi\n\n#extract any user history files that are accessible\nusrhist=`ls -la ~/.*_history 2>/dev/null`\nif [ \"$usrhist\" ]; then\n echo -e \"\\e[00;31m[-] Current user's history files:\\e[00m\\n$usrhist\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$usrhist\" ]; then\n mkdir $format/history_files/ 2>/dev/null\n for i in $usrhist; do cp --parents $i $format/history_files/; done 2>/dev/null\nfi\n\n#can we read roots *_history files - could be passwords stored etc.\nroothist=`ls -la /root/.*_history 2>/dev/null`\nif [ \"$roothist\" ]; then\n echo -e \"\\e[00;33m[+] Root's history files are accessible!\\e[00m\\n$roothist\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$roothist\" ]; then\n mkdir $format/history_files/ 2>/dev/null\n cp $roothist $format/history_files/ 2>/dev/null\nfi\n\n#all accessible .bash_history files in /home\ncheckbashhist=`find /home -name .bash_history -print -exec cat {} 2>/dev/null \\;`\nif [ \"$checkbashhist\" ]; then\n echo -e \"\\e[00;31m[-] Location and contents (if accessible) of .bash_history file(s):\\e[00m\\n$checkbashhist\"\n echo -e \"\\n\"\nfi\n\n#any .bak files that may be of interest\nbakfiles=`find / -name *.bak -type f 2</dev/null`\nif [ \"$bakfiles\" ]; then\n echo -e \"\\e[00;31m[-] Location and Permissions (if accessible) of .bak file(s):\\e[00m\"\n for bak in `echo $bakfiles`; do ls -la $bak;done\n echo -e \"\\n\"\nfi\n\n#is there any mail accessible\nreadmail=`ls -la /var/mail 2>/dev/null`\nif [ \"$readmail\" ]; then\n echo -e \"\\e[00;31m[-] Any interesting mail in /var/mail:\\e[00m\\n$readmail\" \n echo -e \"\\n\"\nfi\n\n#can we read roots mail\nreadmailroot=`head /var/mail/root 2>/dev/null`\nif [ \"$readmailroot\" ]; then\n echo -e \"\\e[00;33m[+] We can read /var/mail/root! (snippet below)\\e[00m\\n$readmailroot\" \n echo -e \"\\n\"\nfi\n\nif [ \"$export\" ] && [ \"$readmailroot\" ]; then\n mkdir $format/mail-from-root/ 2>/dev/null\n cp $readmailroot $format/mail-from-root/ 2>/dev/null\nfi\n}\n\ndocker_checks()\n{\n\n#specific checks - check to see if we're in a docker container\ndockercontainer=` grep -i docker /proc/self/cgroup 2>/dev/null; find / -name \"*dockerenv*\" -exec ls -la {} \\; 2>/dev/null`\nif [ \"$dockercontainer\" ]; then\n echo -e \"\\e[00;33m[+] Looks like we're in a Docker container:\\e[00m\\n$dockercontainer\" \n echo -e \"\\n\"\nfi\n\n#specific checks - check to see if we're a docker host\ndockerhost=`docker --version 2>/dev/null; docker ps -a 2>/dev/null`\nif [ \"$dockerhost\" ]; then\n echo -e \"\\e[00;33m[+] Looks like we're hosting Docker:\\e[00m\\n$dockerhost\" \n echo -e \"\\n\"\nfi\n\n#specific checks - are we a member of the docker group\ndockergrp=`id | grep -i docker 2>/dev/null`\nif [ \"$dockergrp\" ]; then\n echo -e \"\\e[00;33m[+] We're a member of the (docker) group - could possibly misuse these rights!\\e[00m\\n$dockergrp\" \n echo -e \"\\n\"\nfi\n\n#specific checks - are there any docker files present\ndockerfiles=`find / -name Dockerfile -exec ls -l {} 2>/dev/null \\;`\nif [ \"$dockerfiles\" ]; then\n echo -e \"\\e[00;31m[-] Anything juicy in the Dockerfile:\\e[00m\\n$dockerfiles\" \n echo -e \"\\n\"\nfi\n\n#specific checks - are there any docker files present\ndockeryml=`find / -name docker-compose.yml -exec ls -l {} 2>/dev/null \\;`\nif [ \"$dockeryml\" ]; then\n echo -e \"\\e[00;31m[-] Anything juicy in docker-compose.yml:\\e[00m\\n$dockeryml\" \n echo -e \"\\n\"\nfi\n}\n\nlxc_container_checks()\n{\n\n#specific checks - are we in an lxd/lxc container\nlxccontainer=`grep -qa container=lxc /proc/1/environ 2>/dev/null`\nif [ \"$lxccontainer\" ]; then\n echo -e \"\\e[00;33m[+] Looks like we're in a lxc container:\\e[00m\\n$lxccontainer\"\n echo -e \"\\n\"\nfi\n\n#specific checks - are we a member of the lxd group\nlxdgroup=`id | grep -i lxd 2>/dev/null`\nif [ \"$lxdgroup\" ]; then\n echo -e \"\\e[00;33m[+] We're a member of the (lxd) group - could possibly misuse these rights!\\e[00m\\n$lxdgroup\"\n echo -e \"\\n\"\nfi\n}\n\nfooter()\n{\necho -e \"\\e[00;33m### SCAN COMPLETE ####################################\\e[00m\" \n}\n\ncall_each()\n{\n header\n debug_info\n system_info\n user_info\n environmental_info\n job_info\n networking_info\n services_info\n software_configs\n interesting_files\n docker_checks\n lxc_container_checks\n footer\n}\n\nwhile getopts \"h:k:r:e:st\" option; do\n case \"${option}\" in\n k) keyword=${OPTARG};;\n r) report=${OPTARG}\"-\"`date +\"%d-%m-%y\"`;;\n e) export=${OPTARG};;\n s) sudopass=1;;\n t) thorough=1;;\n h) usage; exit;;\n *) usage; exit;;\n esac\ndone\n\ncall_each | tee -a $report 2> /dev/null\n#EndOfScript\n\n<|im_end|>"}
4
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'LINENUM' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: README.md\n<|im_end|>\n<|im_start|>assistant\nREPO: LINENUM\nCODE:\n# LinEnum\nFor more information visit www.rebootuser.com\n\nNote: Export functionality is currently in the experimental stage.\n\nGeneral usage:\n\nversion 0.982\n\n* Example: ./LinEnum.sh -s -k keyword -r report -e /tmp/ -t \n\nOPTIONS:\n* -k\tEnter keyword\n* -e\tEnter export location\n* -t\tInclude thorough (lengthy) tests\n* -s\tSupply current user password to check sudo perms (INSECURE)\n* -r\tEnter report name\n* -h\tDisplays this help text\n\n\nRunning with no options = limited scans/no output file\n\n* -e Requires the user enters an output location i.e. /tmp/export. If this location does not exist, it will be created.\n* -r Requires the user to enter a report name. The report (.txt file) will be saved to the current working directory.\n* -t Performs thorough (slow) tests. Without this switch default 'quick' scans are performed.\n* -s Use the current user with supplied password to check for sudo permissions - note this is insecure and only really for CTF use!\n* -k An optional switch for which the user can search for a single keyword within many files (documented below).\n\nSee CHANGELOG.md for further details\n\nHigh-level summary of the checks/tasks performed by LinEnum:\n\n* Kernel and distribution release details\n* System Information:\n * Hostname\n * Networking details:\n * Current IP\n * Default route details\n * DNS server information\n* User Information:\n * Current user details\n * Last logged on users\n * Shows users logged onto the host\n * List all users including uid/gid information\n * List root accounts\n * Extracts password policies and hash storage method information\n * Checks umask value\n * Checks if password hashes are stored in /etc/passwd\n * Extract full details for \u2018default\u2019 uid\u2019s such as 0, 1000, 1001 etc\n * Attempt to read restricted files i.e. /etc/shadow\n * List current users history files (i.e .bash_history, .nano_history etc.)\n * Basic SSH checks\n* Privileged access:\n * Which users have recently used sudo\n * Determine if /etc/sudoers is accessible\n * Determine if the current user has Sudo access without a password\n * Are known \u2018good\u2019 breakout binaries available via Sudo (i.e. nmap, vim etc.)\n * Is root\u2019s home directory accessible\n * List permissions for /home/\n* Environmental:\n * Display current $PATH\n * Displays env information\n* Jobs/Tasks:\n * List all cron jobs\n * Locate all world-writable cron jobs\n * Locate cron jobs owned by other users of the system\n * List the active and inactive systemd timers\n* Services:\n * List network connections (TCP & UDP)\n * List running processes\n * Lookup and list process binaries and associated permissions\n * List inetd.conf/xined.conf contents and associated binary file permissions\n * List init.d binary permissions\n* Version Information (of the following):\n * Sudo\n * MYSQL\n * Postgres\n * Apache\n * Checks user config\n * Shows enabled modules\n * Checks for htpasswd files\n * View www directories\n* Default/Weak Credentials:\n * Checks for default/weak Postgres accounts\n * Checks for default/weak MYSQL accounts\n* Searches:\n * Locate all SUID/GUID files\n * Locate all world-writable SUID/GUID files\n * Locate all SUID/GUID files owned by root\n * Locate \u2018interesting\u2019 SUID/GUID files (i.e. nmap, vim etc)\n * Locate files with POSIX capabilities\n * List all world-writable files\n * Find/list all accessible *.plan files and display contents\n * Find/list all accessible *.rhosts files and display contents\n * Show NFS server details\n * Locate *.conf and *.log files containing keyword supplied at script runtime\n * List all *.conf files located in /etc\n * .bak file search\n * Locate mail\n* Platform/software specific tests:\n * Checks to determine if we're in a Docker container\n * Checks to see if the host has Docker installed\n * Checks to determine if we're in an LXC container\n\n<|im_end|>"}
data/LINUX_EXPLOIT_SUGGESTER.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/LLM_GUARD.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/MBEDTLS.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/OPENSSL.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ef30925725da70d5e651789ea203fd58ba9272f3d665af8ec7c65595f3fc955
3
+ size 33413923
data/PEASS_NG.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/PRIVACY_RAVEN.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/PROMPT_INJECTION_BENCH.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/PYCRYPTODOME.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:662f9e526de546b8400e3b44009a3d22ecd619db81feaeafd96065ba7b4e3d8f
3
+ size 36848445
data/RSA_CTF_TOOL.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/SUDO_KILLER.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/TENSOR_TRUST.jsonl CHANGED
@@ -1 +1 @@
1
- {"text": "<|im_start|>user\nAnalyze the file 'README.md' from repository 'TENSOR_TRUST'.\n<|im_end|>\n<|im_start|>assistant\nFILE: README.md\nSOURCE: TENSOR_TRUST\nCONTENT:\n# The Tensor Trust dataset (benchmarks v1, raw data dump v2)\n\n**Other Tensor Trust links:** [[Game]](https://tensortrust.ai/) [[Code]](https://github.com/HumanCompatibleAI/tensor-trust) [[Paper]](https://tensortrust.ai/paper)\n\nThis repository contains the raw data and derived benchmarks for the [Tensor Trust](https://tensortrust.ai/paper) project. An interactive explanation of how to load and use the data (including the meaning of the columns) is in a Jupyter notebook in this directory. You can [click here to run the notebook right now in Google Colab](https://colab.research.google.com/github/HumanCompatibleAI/tensor-trust-data/blob/main/Using%20the%20Tensor%20Trust%20dataset.ipynb).\n\n<|im_end|>"}
 
1
+ {"text": "<|im_start|>user\nYou are a Singularity-Level AI. Analyze this file from the 'TENSOR_TRUST' repository. Explain the technical logic, security implications (offensive/defensive), or financial algorithm involved.\nFile: README.md\n<|im_end|>\n<|im_start|>assistant\nREPO: TENSOR_TRUST\nCODE:\n# The Tensor Trust dataset (benchmarks v1, raw data dump v2)\n\n**Other Tensor Trust links:** [[Game]](https://tensortrust.ai/) [[Code]](https://github.com/HumanCompatibleAI/tensor-trust) [[Paper]](https://tensortrust.ai/paper)\n\nThis repository contains the raw data and derived benchmarks for the [Tensor Trust](https://tensortrust.ai/paper) project. An interactive explanation of how to load and use the data (including the meaning of the columns) is in a Jupyter notebook in this directory. You can [click here to run the notebook right now in Google Colab](https://colab.research.google.com/github/HumanCompatibleAI/tensor-trust-data/blob/main/Using%20the%20Tensor%20Trust%20dataset.ipynb).\n\n<|im_end|>"}
data/TRAITOR.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/WINDOWS_EXPLOIT_SUGGESTER.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/WOLFSSL.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fb7bdbec3452c0d7d7cb06da8db726b16f492d10e3a67eda74f0aff931c7541
3
+ size 85255274