Skip to content

Commit

Permalink
fixed TACACS plus
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Dec 21, 2024
1 parent b034a86 commit fade3e0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
38 changes: 27 additions & 11 deletions hcxpcapngtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ static long int protochaprespcount;
static long int protochapsuccesscount;
static long int protopapcount;
static long int tacacspcount;
static long int tacacsp2count;
static long int tacacsp3count;
static long int tacacspauthencount;
static long int tacacspauthorcount;
static long int tacacspacctcount;
static long int tacacsunknowncount;
static long int tacacspwrittencount;
static long int wepenccount;
static long int wpaenccount;
Expand Down Expand Up @@ -545,8 +547,10 @@ protochaprespcount = 0;
protochapsuccesscount = 0;
protopapcount = 0;
tacacspcount = 0;
tacacsp2count = 0;
tacacsp3count = 0;
tacacspauthencount = 0;
tacacspauthorcount = 0;
tacacspacctcount = 0;
tacacsunknowncount = 0;
tacacspwrittencount = 0;
wepenccount = 0;
wpaenccount = 0;
Expand Down Expand Up @@ -756,8 +760,10 @@ if(protochaprespcount > 0) fprintf(stdout, "PPP-CHAP response..................
if(protochapsuccesscount > 0) fprintf(stdout, "PPP-CHAP success.........................: %ld\n", protochapsuccesscount);
if(protopapcount > 0) fprintf(stdout, "PPP-PAP..................................: %ld\n", protopapcount);
if(tacacspcount > 0) fprintf(stdout, "TACACS+ v1...............................: %ld\n", tacacspcount);
if(tacacsp2count > 0) fprintf(stdout, "TACACS+ v2...............................: %ld (unsupported)\n", tacacsp2count);
if(tacacsp3count > 0) fprintf(stdout, "TACACS+ v3...............................: %ld (unsupported)\n", tacacsp3count);
if(tacacspauthencount > 0) fprintf(stdout, "TACACS+ AUTHEN...........................: %ld\n", tacacspauthencount);
if(tacacspauthorcount > 0) fprintf(stdout, "TACACS+ AUTHOR...........................: %ld (unsupported)\n", tacacspauthorcount);
if(tacacspacctcount > 0) fprintf(stdout, "TACACS+ ACCT.............................: %ld (unsupported)\n", tacacspacctcount);
if(tacacsunknowncount > 0) fprintf(stdout, "TACACS+ unknown version..................: %ld (unsupported)\n", tacacsunknowncount);
if(tacacspwrittencount > 0) fprintf(stdout, "TACACS+ written..........................: %ld\n", tacacspwrittencount);
if(identitycount > 0) fprintf(stdout, "IDENTITIES...............................: %ld\n", identitycount);
if(usernamecount > 0) fprintf(stdout, "USERNAMES................................: %ld\n", usernamecount);
Expand Down Expand Up @@ -1327,17 +1333,27 @@ static tacacsplist_t *tacacsplistnew;

if(restlen < (uint32_t)TACACSP_SIZE) return;
tacacsp = (tacacsp_t*)tacacspptr;
if(tacacsp->type == TACACS2_AUTHENTICATION)
if(tacacsp->version != TACACSP_VERSION)
{
tacacsp2count++;
tacacsunknowncount++;
return;
}
if(tacacsp->type == TACACS3_AUTHENTICATION)
if(tacacsp->type == TACACSP_AUTHOR)
{
tacacsp3count++;
tacacspauthorcount++;
return;
}
if(tacacsp->type != TACACS_AUTHENTICATION) return;
if(tacacsp->type == TACACSP_ACCT)
{
tacacspacctcount++;
return;
}
if(tacacsp->type != TACACSP_AUTHEN)
{
tacacsunknowncount++;
return;
}
tacacspauthencount++;
authlen = ntohl(tacacsp->len);
if((authlen > restlen -TACACSP_SIZE) || (authlen > TACACSPMAX_LEN)) return;
if(tacacsplistptr >= tacacsplist +tacacsplistmax)
Expand Down
8 changes: 4 additions & 4 deletions include/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -936,11 +936,11 @@ typedef struct chap_frame chap_t;
struct tacacsp_frame
{
uint8_t version;
#define TACACSP_VERSION 0xc0
#define TACACSP_VERSION 0xc0
uint8_t type;
#define TACACS_AUTHENTICATION 1
#define TACACS2_AUTHENTICATION 2
#define TACACS3_AUTHENTICATION 3
#define TACACSP_AUTHEN 1
#define TACACSP_AUTHOR 2
#define TACACSP_ACCT 3
uint8_t sequencenr;
uint8_t flags;
uint32_t sessionid;
Expand Down

0 comments on commit fade3e0

Please sign in to comment.