This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> raw_assessments = [('sslyze', ('ssl', 'infra')), ('nmap common', ('infra', ))] | |
| >>> from collections import defaultdict | |
| >>> types = defaultdict(set) | |
| >>> for (name, _types) in raw_assessments: | |
| ... for t in _types: | |
| ... types[t].add(name) | |
| ... | |
| >>> types | |
| defaultdict(<class 'set'>, {'ssl': {'sslyze'}, 'infra': {'sslyze', 'nmap common'}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from operator import or_ | |
| from functools import reduce | |
| import inquirer | |
| types = {'web': {'directory brute force', 'httrack', 'drupal scans', 'web app'}, | |
| 'ssl': {'ssl audit', 'web app', 'drupal scans'}, | |
| 'infra': {'nmap common', 'nmap all tcp', 'udp', 'windows audit'}} | |
| def assessments(answers): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Hello where | |
| data JodaYears = native org.joda.time.Years where | |
| pure native years org.joda.time.Years.years :: Int -> JodaYears | |
| pure native getYears :: JodaYears -> Int | |
| main _ = println $ JodaYears.getYears $ JodaYears.years 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| import os | |
| from sys import exit | |
| from subprocess import call | |
| from shlex import split | |
| allowed_commands = 'ls echo cp mv rm ln whoami sort pwd cd gzip zcat zless ps free df du kill cat mkdir passwd uname whereis locate tail date'.split() | |
| cmd = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE OverloadedStrings #-} | |
| import Prelude hiding (putStrLn, writeFile) | |
| import System.Environment (getArgs) | |
| import Data.Word (Word16) | |
| import Data.Maybe (fromMaybe) | |
| import Data.Monoid ((<>), mempty) | |
| import Data.ByteString (ByteString, writeFile) | |
| import Data.ByteString.Char8 (putStrLn) | |
| import Text.Regex.TDFA (match, makeRegexOpts, blankCompOpt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dario@curie ~/nixpkgs (pcapbug)> | |
| /nix/store/s29l8m50xv0qxwvchvzf4znqs2z2dzcz-nmap-6.47/bin/nmap --version | |
| Nmap version 6.47 ( http://nmap.org ) | |
| Platform: x86_64-unknown-linux-gnu | |
| Compiled with: nmap-liblua-5.2.3 openssl-1.0.1l nmap-libpcre-7.6 libpcap-1.4.0 nmap-libdnet-1.12 ipv6 | |
| Compiled without: | |
| Available nsock engines: epoll poll select | |
| dario@curie ~/nixpkgs (pcapbug)> | |
| sudo /nix/store/s29l8m50xv0qxwvchvzf4znqs2z2dzcz-nmap-6.47/bin/nmap -sS -vv 10.129.121.20 -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar | |
| Exception in thread "main" java.lang.reflect.InvocationTargetException | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
| at java.lang.reflect.Method.invoke(Method.java:497) | |
| at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) | |
| at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) | |
| Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jayatana/libjayatanaag.so: libX11.so.6: cannot open shared object file: No such file or directory | |
| at java.lang.ClassLoader$NativeLibrary.load(Native Method) |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| execve("/home/dario/.nix-profile/bin/java", ["java", "-jar", "/home/dario/Downloads/burpsuite_"...], [/* 75 vars */]) = 0 | |
| brk(0) = 0x10b8000 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f19e5550000 | |
| readlink("/proc/self/exe", "/nix/store/nmd034pr2aa1brz015gix"..., 4096) = 80 | |
| access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/x86_64", 0x7ffe5c7c7390) = -1 ENOENT (No such file or directory) | |
| open("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| execve("/home/dario/.nix-profile/bin/java", ["java", "-jar", "/home/dario/Downloads/burpsuite_"...], [/* 74 vars */]) = 0 | |
| brk(0) = 0x1c09000 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f53fc6f9000 | |
| readlink("/proc/self/exe", "/nix/store/nmd034pr2aa1brz015gix"..., 4096) = 80 | |
| access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/x86_64", 0x7ffece51e4f0) = -1 ENOENT (No such file or directory) | |
| open("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/lib/openjdk/bin/../lib/amd64/jli/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/nix/store/nmd034pr2aa1brz015gixp0zni9r2w7f-openjdk-8u40b25/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I use this both inside configuration.nix with | |
| ## environment.systemPackages = (import ((builtins.getEnv "PWD") + "/packages.nix" )); | |
| # and on the command line with | |
| ## nix-env -I ~ -f packages.nix -iA | |
| #with (import (builtins.getEnv "HOME" + "/.nix-defexpr/channels_root/nixos/default.nix") {}).pkgs; | |
| with (import "/home/dario/.nix-defexpr/channels_root/nixos/default.nix" {}).pkgs; | |
| [ | |
| # software available in the nixos nix-channel | |
| ] ++ |