Skip to content

Commit

Permalink
BUG FIXES
Browse files Browse the repository at this point in the history
  - Correct all known bugs
  - Fix all warnings reported by cppcheck
  - Fix all warnings reported by gcc 8.4 -Wall

ENHANCEMENTS
  - Add option -u to do unbuffered output.
  - Flush outputs in order to not block pipe if stdout is redirected.
  - Add a slightly human friendlier output triggered by -H option
  - Print start time and end time in log (and console if -H is given)
  - Add time to log file name

GUI
  - Add a simple, quick and dirty python/Tkinter tools to generate and/or run unhide-linux and unhide-tcp command.

MISCELLANOUS
  - Adapt checkoneport() to bogus/broken text output of "recent" version of ss tool (modified end of line).
  • Loading branch information
patrick-g2 committed Jan 23, 2021
1 parent ef9f993 commit bca2c74
Show file tree
Hide file tree
Showing 22 changed files with 1,038 additions and 751 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
unhide-linux
unhide-posix
unhide-tcp
unhide_rb
22 changes: 22 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
Changes since 20130526 :
**********************

BUG FIXES
- Correct all known bugs
- Fix all warnings reported by cppcheck
- Fix all warnings reported by gcc 8.4 -Wall

ENHANCEMENTS
- Add option -u to do unbuffered output.
- Flush outputs in order to not block pipe if stdout is redirected.
- Add a slightly human friendlier output triggered by -H option
- Print start time and end time in log (and console if -H is given)
- Add time to log file name

GUI
- Add a simple, quick and dirty python/Tkinter tools to generate and/or run unhide-linux and unhide-tcp command.

MISCELLANOUS
- Adapt checkoneport() to bogus/broken text output of "recent" version of ss tool (modified end of line).


Changes since 20121229 :
**********************

Expand Down
5 changes: 5 additions & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/sh
gcc -Wall -O2 --static -pthread unhide-linux*.c unhide-output.c -o unhide-linux
gcc -Wall -O2 --static unhide_rb.c -o unhide_rb
gcc -Wall -O2 --static unhide-tcp.c unhide-tcp-fast.c unhide-output.c -o unhide-tcp
gcc -Wall -O2 --static unhide-posix.c -o unhide-posix
79 changes: 79 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
2021-01
unhide-linux-procfs.c
- Suppress -Wformat-overflow warning by GCC >= 8.0 in function checkreaddir().

unhide-posix.c
- Correct warning about strcpy and strcat in main().

unhide_rb.c
- Add missing braces in get_suspicious_pids()
- Correct warning about strcpy and strcat in main().
- increase size of scratch string to avoid warning.

unhide-linux.c, unhide-linux.h
- Add option to get a slightly human friendlier output.
- Use it !

unhide-linux-compound.c, unhide-linux-output.c, unhide-tcp.c
- Use option for human friendlier output.

unhide-tcp.h
- Add definition of boolean values.

2020-01
unhide-output.c
- Protect msgln() from buffer overflow.

unhide-tcp.c
- adapt checkoneport() to broken text output of "recent" version of ss tool (modified end of line).


2019-11
UnhideGui.py:
- Add a simple, quick and dirty python/Tkinter tools to generate and run unhide-linux and unhide-tcp command.

unhide-linux.c
- Correct a fd leak in get_max_pid() [SF ticket #7].
- flush stdout after usage message, in order to not block pipe if stdout is redirected.
- flush stdout after header display, for the same reason.
- add option to disable buffering of stdout for subprocesses pipe-opened by unhide.

unhide-linux.h
- add option and macro to disable buffering of stdout for subprocesses pipe-opened by unhide.
- Translate (historical) spanish function names in english.

unhide-output.c
- Flush stdout after display of string, in order to not block pipe if stdout is redirected.
- Add time to log name (as RKHunter run each test separately and overwrite previous log file).
- Print start and end times to stdout if log is enabled

unhide-posix.c
- Test the return values of the two fopen() and correct a fd leak in checkps()

unhide-linux-compound.c
- Add "Not found" message in case no hiden process is found in checkallquick() and checkallreverse().
- Add a missing line feed in the first message of checkallquick().
- Add a missing line feed in the first message of checkallreverse().

unhide-linux-syscall.c
- Manage unbuffering stdout option in checksysinfoX() routines.
- Translate (historical) spanish variable names in english.

unhide-linux-bruteforce.c
- Translate (historical) spanish function names in english.

unhide-tcp.c
- flush stdout after usage message, in order to not block pipe if stdout is redirected.
- flush stdout after header display, for the same reason.
- Correct message for used options for netstat option

unhide-rb.c
- flush stdout after fprintf() and fputs().
- don't call fclose() if fopen() failed in get_suspicious_pids().

tar_list.txt
- remove unhide-tcp-simple-check.c which was include by mistake.

unhide-linux-compound.c, unhide-linux-procfs.c, unhide-linux-syscall.c, unhide-linux.c
- Correct ccpcheck warning

2013-05-26
unhide-posix.c
- Transform 'ret' in global variable to avoid warnings
Expand Down
4 changes: 4 additions & 0 deletions ps
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/bash

/bin/ps "$@"
echo 65535 my_false_proc
21 changes: 21 additions & 0 deletions ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

# echo "Le 1er paramètre est : $1" >&2
# echo "Le 2ème paramètre est : $2" >&2
# echo "Le 3ème paramètre est : $3" >&2
# echo "Le 4ème paramètre est : $4" >&2

if [ 0 -eq 1 ]
then
/usr/bin/netstat $@ | grep -v 631
exit
elif [ "$4" != ":631" ]
then
# appelle le véritable ss
/sbin/ss $@
else
echo "Le 4ème paramètre est : $4" >&2
fi

34 changes: 34 additions & 0 deletions ss-ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/bash

# sanity.sh -- a growing testsuite for unhide.
#
# Copyright (C) 2010 Patrick Gouin.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Original Author: Patrick Gouin



# Sequence d'aqppel par unhide : ss -tan sport = :%d
# affiche les paramètres

echo "Le 1er paramètre est : $1" >&2
echo "Le 2ème paramètre est : $2" >&2
echo "Le 3ème paramètre est : $3" >&2
echo "Le 4ème paramètre est : $4" >&2

# appelle le véritable ss

/sbin/ss $@
8 changes: 6 additions & 2 deletions tar_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ unhide-output.h
unhide-posix.c
unhide_rb.c
unhide-tcp.c
unhide-tcp-simple-check.c
unhide-tcp-fast.c
unhide-tcp.h

unhideGui.py
LICENSE
build_all.sh
ps
ss
ss-ref
6 changes: 3 additions & 3 deletions unhide-linux-bruteforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* Minimalist thread function for brute test.
* Set tid with the pid of the created thread.
*/
void *funcionThread (void *parametro)
void *functionThread (void *parametro)
{

tid = (pid_t) syscall (SYS_gettid);
Expand Down Expand Up @@ -163,7 +163,7 @@ void brute(void)
pthread_t idHilo;
int error;

error = pthread_create (&idHilo, NULL, funcionThread, NULL);
error = pthread_create (&idHilo, NULL, functionThread, NULL);
if (error != 0)
{
die(unlog, "Error: Cannot create thread ! Exiting.");
Expand All @@ -187,7 +187,7 @@ void brute(void)
pthread_t idHilo;
int error;

error = pthread_create (&idHilo, NULL, funcionThread, NULL);
error = pthread_create (&idHilo, NULL, functionThread, NULL);
if (error != 0)
{
die(unlog, "Error: Cannot create thread ! Exiting.");
Expand Down
Loading

0 comments on commit bca2c74

Please sign in to comment.