--- /dev/null
+#!/usr/bin/make
+
+CC = gcc
+CFLAGS = -O2
+CPPFLAGS = -Wall
+LDFLAGS = -s -lcrypt
+
+PREFIX = /usr
+
+TARGETS = cac
+
+all: $(TARGETS)
+
+install: $(TARGETS)
+ install -m 755 $(TARGETS) $(PREFIX)/bin
+
+uninstall:
+ cd $(PREFIX)/bin && rm -f $(TARGETS)
+
+clean:
+ rm -f $(TARGETS) *.o *~
+
--- /dev/null
+/* cac.c - crypt and compare
+ *
+ * author: hackbard
+ *
+ */
+
+#include <stdio.h>
+#include <crypt.h>
+#include <string.h>
+
+int main(int argc, char *argv[]) {
+
+ FILE *file_h;
+ char temp[256];
+
+ if(argc!=3) {
+ printf("usage: %s <shadow-file> <password>\n",argv[0]);
+ return 0;
+ }
+
+ file_h=fopen(argv[1],"r");
+ if(file_h==NULL) {
+ printf("error: cant open %s for reading\n",argv[1]);
+ return 0;
+ } else {
+ printf("reading %s\n",argv[1]);
+ }
+
+ while(fgets(temp,256,file_h)) {
+ if(strstr(temp,"root")) {
+ /* none md5 way ... */
+ if(temp[4]==':') {
+ if(strncmp(crypt(argv[2],(temp+5)),(temp+5),13)==0)
+ printf("succes: %s\n",argv[2]);
+ else printf("wrong\n");
+ }
+ }
+ }
+ return 0;
+}