#define _X_OPEN_SOURCE 500 #include #include #include #include "arc_plugin_interface.h" #include static void cleanup_str_list(struct list *l) { while(l->len > 0) { struct list_node *l_n = list_rem(l); free(l_n->elem); free(l_n); } } bool oracle_ftp_guard(struct arc_model *a_m, char *args) { char *target = args; int nbytes = snprintf(NULL,0,"%s:IP",target); char ip_buff[nbytes+1]; snprintf(ip_buff,nbytes+1,"%s:IP",target); struct arc_value target_ip = arc_model_get_property(a_m,ip_buff); if(target_ip.type != V_STRING) { fprintf(stderr,"[OracleFtp] Property: %s:IP is required to peform FTPCrack\n", target); return false; } struct arc_value v = {.type = V_STRING, .v_str = strdup("ftp")}; struct list ftp_ifaces = arc_model_find_interfaces(a_m, target, "Service", v); if(ftp_ifaces.len == 0) { return false; } free(v.v_str); cleanup_str_list(&ftp_ifaces); return true; } bool oracle_ftp(struct arc_model *a_m, char *args) { printf("[OracleFtp] Done\n"); return false; }