Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update script architecture to make it more modular and readable #61

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
includes/includes.iml
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTORS.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
116 changes: 116 additions & 0 deletions LinEnum
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash

#
# linenum
#
# AUTHOR: @rebootuser et al.
#
# DESCRIPTION:
# Linenum is a script designed to enumerate a linux box. It should work to varying
# degrees on OSX/MacOS and various flavors of BSD.
#
# OUTPUT:
# plain-text
#
# PLATFORMS:
# Linux, OSX/MacOS, BSD
#
# DEPENDENCIES:
# Bash
#
# USAGE:
# See the help text for additional details
# ./lineum
#
# NOTES:
#
# LICENSE:
# MIT
#

VERSION="version 0.982"
#@rebootuser

# Set the path to include the libraries. These are searched for in the same directory or within the path. We capture
# the original path statement and then prepend the library directory. Once we have sourced all the functions we drop
# back to the original path to minimize possible detections and avoid mangling.
library_import() {

local ORIG_PATH="$PATH"
export PATH="includes:$PATH"

source applications
source binaries
source docker
source environment
source jobs
source k8s
source lxc
source networking
source services
source system
source users.sh
source util

export PATH="$ORIG_PATH"

return 0
}

library_import

call_each() {
header

if [ "$debug" ]; then
debug_info ## 1st pass complete
fi
system_info ## 1st pass complete
user_info
# environmental_info
# job_info
# networking_info
# services_info
# software_configs
# interesting_files
# docker_checks
# lxc_container_checks
footer
}

while getopts "h:k:r:e:std" option; do
case "${option}" in
k) keyword=${OPTARG} ;;
d) debug=1 ;;
r) report=${OPTARG}"-"$(date +"%d-%m-%y") ;;
e) export=${OPTARG} ;;
s) sudopass=1 ;;
t) thorough=1 ;;
h)
usage
exit
;;
*)
usage
exit
;;
esac
done

call_each | tee -a "$report" 2>/dev/null
#EndOfScript

## linuxprivchecker.py
## htb enum
## suid3num
## linux-smart-enumeration
## uptux

## hidden processes?
## jails?
## random pids
## kernel msg buffer
## process debugging

## can/should we use posix
## we should also provide a document for exploiting this
Loading