View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000357 | Kali Linux | Tool Upgrade Request | public | 2013-05-18 17:45 | 2013-06-03 17:28 |
| Reporter | Mangix | Assigned To | crossbower | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Summary | 0000357: reaver patch to display remaining time | ||||
| Description | This was originally posted here: https://code.google.com/p/reaver-wps/issues/detail?id=420&start=200 The patch as posted there segfaults. The author uploaded an updated version but it is no longer available. I managed to snag it before it disappeared. It should be uploaded below. | ||||
| Attached Files | time.patch (2,485 bytes)
diff --git a/src/cracker.c b/src/cracker.c
index a07caa6..541036f 100644
--- a/src/cracker.c
+++ b/src/cracker.c
@@ -285,18 +285,65 @@ void advance_pin_count()
}
}
+char *get_max_time_remaining(int average, int attempts_remaining)
+{
+ char *max_time, hours[8], minutes[3], seconds[3];
+ int max_hours = 0, max_minutes = 0, max_seconds = 0;
+
+ max_time = malloc(16);
+
+ if(!max_time)
+ exit(-1);
+
+ if(average)
+ {
+ max_seconds = attempts_remaining * average;
+ if(max_seconds > 60)
+ {
+ max_minutes = max_seconds / 60;
+ max_seconds -= max_minutes * 60;
+ }
+ if(max_minutes > 60)
+ {
+ max_hours = max_minutes / 60;
+ max_minutes -= max_hours * 60;
+ }
+
+ if(max_seconds < 0 || max_minutes < 0 || max_hours < 0)
+ {
+ free(max_time);
+ return NULL;
+ }
+
+ sprintf(hours, "%d", max_hours);
+ sprintf(minutes, "%s%d", max_minutes > 9 ? "" : "0", max_minutes);
+ sprintf(seconds, "%s%d", max_seconds > 9 ? "" : "0", max_seconds);
+
+ sprintf(max_time, "%s:%s:%s", hours, minutes, seconds);
+ }
+ else
+ {
+ free(max_time);
+ return NULL;
+ }
+
+ return max_time;
+}
+
/* Displays the status and rate of cracking */
void display_status(float pin_count, time_t start_time)
{
float percentage = 0;
int attempts = 0, average = 0;
+ int attempts_remaining = 0;
time_t now = 0, diff = 0;
struct tm *tm_p = NULL;
- char time_s[256] = { 0 };
+ char time_s[256] = { 0 }, *max_time;
if(get_key_status() == KEY1_WIP)
{
attempts = get_p1_index() + get_p2_index();
+ attempts_remaining = 11000 - attempts;
}
/*
* If we've found the first half of the key, then the entire key1 keyspace
@@ -305,10 +352,12 @@ void display_status(float pin_count, time_t start_time)
else if(get_key_status() == KEY2_WIP)
{
attempts = P1_SIZE + get_p2_index();
+ attempts_remaining = 11000 - attempts;
}
else if(get_key_status() == KEY_DONE)
{
attempts = P1_SIZE + P2_SIZE;
+ attempts_remaining = 0;
}
percentage = (float) (((float) attempts / (P1_SIZE + P2_SIZE)) * 100);
@@ -335,7 +384,12 @@ void display_status(float pin_count, time_t start_time)
average = 0;
}
+ max_time = get_max_time_remaining(average, attempts_remaining);
+
cprintf(INFO, "[+] %.2f%% complete @ %s (%d seconds/pin)\n", percentage, time_s, average);
+ cprintf(INFO, "[+] Max time remaining at this rate: %s (%d pins left to try)\n", max_time ? max_time : "(undetermined)", attempts_remaining);
+
+ free(max_time);
return;
}
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-05-18 17:45 | Mangix | New Issue | |
| 2013-05-18 17:45 | Mangix | File Added: time.patch | |
| 2013-05-25 20:44 | crossbower | Note Added: 0000467 | |
| 2013-05-25 20:44 | crossbower | Status | new => resolved |
| 2013-05-25 20:44 | crossbower | Resolution | open => fixed |
| 2013-05-25 20:44 | crossbower | Assigned To | => crossbower |
| 2013-06-03 17:28 | dookie | Status | resolved => closed |
| 2021-05-31 13:37 | rhertzog | Category | Tool Upgrade => Tool Upgrade Request |