Projects STRLCPY linuxprivchecker Commits 5132a24b
🤬
  • Update linuxprivchecker.sh

    Updated [-] and [+].
    Fixed Line 215 (now line 211 to 233).  The code is more readable.
    Updated the line to be the same  ####.
    
    If this looks good, I can work on the Python one to look about (if not) the same like this one.  This would be an opportunity for me to get better at Python.
  • Loading...
  • Ali Kaba committed with GitHub 7 years ago
    5132a24b
    1 parent 854fe9bb
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    linuxprivchecker.sh
    skipped 35 lines
    36 36  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
    37 37   
    38 38  # line formatting
    39  -titleLINE=$(printf "%*s\n" "80" | tr ' ' "=");
    40  -sectionLINE=$(printf "%*s\n" "40" | tr ' ' "-");
     39 +LINE=$(printf "%*s\n" "80" | tr ' ' "#");
    41 40   
    42 41  # title
    43 42  scriptTITLE(){
    44  -echo ${titleLINE};
    45  -echo " LINUX PRIVILEGE ESCALATION CHECKER"
    46  -echo " https://github.com/linted/linuxprivchecker for more info..."
    47  -echo ${titleLINE};
     43 +echo ${LINE};
     44 +echo " LINUX PRIVILEGE ESCALATION CHECKER"
     45 +echo " https://github.com/linted/linuxprivchecker for more info..."
     46 +echo ${LINE};
     47 +echo
    48 48  }
    49 49   
    50 50  systemAREAtitle(){
    51  - echo ${sectionLINE};
    52  - echo -e " $systemAREA";
    53  - echo ${sectionLINE};
     51 + echo ${LINE};
     52 + echo -e " $systemAREA";
     53 + echo ${LINE};
    54 54   echo
    55  - sleep .5s;
    56 55  }
    57 56   
    58 57  cmdRESPONSE(){
    59 58   # run and format cmd
    60  - cmdRESULT=$(eval $1 2>/dev/null | sed 's|^| |'; echo "${PIPESTATUS[0]}");
     59 + cmdRESULT=$(eval $1 2>/dev/null | sed 's|^| |'; echo "${PIPESTATUS[0]}");
    61 60   
    62 61   # check cmd status
    63 62   if [ ${cmdRESULT:(-1)} -eq 0 ]; then
    64  - echo "[OK] $systemNAME";
     63 + echo "[+] $systemNAME";
    65 64   echo "${cmdRESULT%?}";
    66  - echo
    67 65   else
    68  - echo "[FAILED] $systemNAME";
     66 + echo "[-] $systemNAME";
    69 67   echo "${cmdRESULT%?}";
    70  - echo
    71 68   fi
    72  - sleep .5s;
    73 69  }
    74 70   
    75 71  operatingSYSTEM(){
    skipped 136 lines
    212 208   cmdRESPONSE "which awk perl python ruby gcc cc vi vim nmap find netcat nc wget tftp ftp";
    213 209   
    214 210   systemNAME="Related Shell Escape Sequences";
    215  - cmdRESPONSE "if [ -x "$(command -v vi)" ]; then echo -ne \"vi-->\t:!bash\n\"; echo -ne \"vi-->\t:set shell=/bin/bash:shell\n\"; fi; if [ -x "$(command -v vim)" ]; then echo -ne \"vim-->\t:!bash\n\" | sed 's|^| |'; echo -ne \"vim-->\t:set shell=/bin/bash:shell\n\" | sed 's|^| |'; fi; if [ -x "$(command -v awk)" ]; then echo -ne \"awk-->\tawk 'BEGIN {system(\"/bin/bash\")}'\n\" | sed 's|^| |'; fi; if [ -x "$(command -v perl)" ]; then echo -ne \"perl-->\tperl -e 'exec \"/bin/bash\";'\n\" | sed 's|^| |'; fi; if [ -x "$(command -v python)" ]; then echo -ne \"python-->\tpython -c '__import__(\"os\").system(\"/bin/bash\")'\n\" | sed 's|^| |'; fi; if [ -x "$(command -v find)" ]; then echo -ne \"find->\tfind / -exec /usr/bin/awk 'BEGIN {system(\"/bin/bash\")}' \\;\n\" | sed 's|^| |'; fi; if [ -x "$(command -v nmap)" ]; then echo -ne \"nmap-->\t--interactive\n\" | sed 's|^| |'; fi";
     211 + cmdRESPONSE "if [ -x "$(command -v vi)" ]; then \
     212 + echo -ne \"vi-->\t:!bash\n\"; \
     213 + echo -ne \"vi-->\t:set shell=/bin/bash:shell\n\"; \
     214 + fi; \
     215 + if [ -x "$(command -v vim)" ]; then \
     216 + echo -ne \"vim-->\t:!bash\n\" | sed 's|^| |'; \
     217 + echo -ne \"vim-->\t:set shell=/bin/bash:shell\n\" | sed 's|^| |'; \
     218 + fi; \
     219 + if [ -x "$(command -v awk)" ]; then \
     220 + echo -ne \"awk-->\tawk 'BEGIN {system(\"/bin/bash\")}'\n\" | sed 's|^| |'; \
     221 + fi; \
     222 + if [ -x "$(command -v perl)" ]; then \
     223 + echo -ne \"perl-->\tperl -e 'exec \"/bin/bash\";'\n\" | sed 's|^| |'; \
     224 + fi; \
     225 + if [ -x "$(command -v python)" ]; then \
     226 + echo -ne \"python-->\tpython -c '__import__(\"os\").system(\"/bin/bash\")'\n\" | sed 's|^| |'; \
     227 + fi; \
     228 + if [ -x "$(command -v find)" ]; then \
     229 + echo -ne \"find->\tfind / -exec /usr/bin/awk 'BEGIN {system(\"/bin/bash\")}' \\;\n\" | sed 's|^| |'; \
     230 + fi; \
     231 + if [ -x "$(command -v nmap)" ]; then \
     232 + echo -ne \"nmap-->\t--interactive\n\" | sed 's|^| |'; \
     233 + fi";
     234 + 
    216 235  }
    217 236   
    218 237  searchEXPLOITS(){
    skipped 23 lines
    242 261   filePERMISSIONS;
    243 262   applicationSERVICES;
    244 263   searchEXPLOITS;
    245  - echo ${titleLINE};
    246  - echo " FINISHED"
    247  - echo -e ${titleLINE};
    248  - echo -e $RESET;
     264 + echo ${LINE};
     265 + echo " FINISHED"
     266 + echo ${LINE};
     267 + echo
    249 268  }
    250 269   
    251 270  start;
    skipped 1 lines
Please wait...
Page is in error, reload to recover