Telehack/nremps.bas

32 lines
801 B
QBasic
Raw Normal View History

2024-11-12 17:24:44 +00:00
REM Run remps.exe and check for root kits
REM If no arguments given, runs on all connected hosts
REM If arguments are provided, run on hosts provided on CLI
PATTERN$="[^\s]+"
IF LEN(ARG$) = 0 THEN HOSTS$ = TH_NETSTAT$
IF LEN(ARG$) > 0 THEN HOSTS$ = ARG$
FOR I = 1 TO TH_RE(HOSTS$, PATTERN$, 1)
UNKNOWN=0
RHOST$ = TH_RE$(HOSTS$, PATTERN$, I)
TH_EXEC "remps "+RHOST$, OUT$
IF INSTR(OUT$, "Unknown",0) > 0 GOSUB 3000
IF INSTR(OUT$, "Hop limit",0) > 0 GOSUB 4000
IF INSTR(OUT$,"kit",0) = -1 GOSUB 1000
IF INSTR(OUT$,"kit",0) > 0 GOSUB 2000
NEXT I
END
1000 IF UNKNOWN = 0 THEN print RHOST$+" is NOT rooted"
RETURN
2000 IF UNKNOWN = 0 THEN print RHOST$+" is rooted"
RETURN
3000 print "Unknown host: "+ RHOST$
UNKNOWN=1
RETURN
4000 print "Hop Limit Exceeded for "+ RHOST$
UNKNOWN=1
RETURN