<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LVillari</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LVillari"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/LVillari"/>
	<updated>2026-09-10T16:34:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11344</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11344"/>
		<updated>2023-01-30T11:19:23Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
The advantages of this static analysis tool, is the fact that the code does not need to be either compiled nor runnable, but it is possible to start an analysis at any time during the development to look for possible vulnerabilities within the program. The disadvantage is that now all errors and vulnerabilities can be found, therefore multiple tools should be used to run an analysis.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Flawfinder.png|600px|center|alt Report generated from Flawfinder]]&lt;br /&gt;
&lt;br /&gt;
==== Results ====&lt;br /&gt;
&lt;br /&gt;
From the results, it can be seen at which line of code a potential vulnerability is present and how high the risk level is. In the example above, the first hit has the risk level 4, which is almost the highest level. It provides a brief description of the vulnerability with the related CWE-ID. In addition, Flawfinder propose the usage of alternatives methods. The [MS-banned]-Tag means, the used method, which in this case is &amp;quot;strcpy&amp;quot; was added from Microsoft into its official list of banned methods and should therefore not be used anymore.&lt;br /&gt;
&lt;br /&gt;
Flawfinder is CWE-Compatible, which means, among other things, that every hit will have a related CWE-ID which can be used to search for it withing the CWE database: this makes it easy to filter and found information.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://dwheeler.com/flawfinder/&lt;br /&gt;
* https://cwe.mitre.org/compatible/index.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11343</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11343"/>
		<updated>2023-01-30T11:18:33Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
The advantages of this static analysis tool, is the fact that the code does not need to be either compiled nor runnable, but it is possible to start an analysis at any time during the development to look for possible vulnerabilities within the program. The disadvantage is that now all errors and vulnerabilities can be found, therefore multiple tools should be used to run an analysis.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Flawfinder.png|600px|center|alt Report generated from Flawfinder]]&lt;br /&gt;
&lt;br /&gt;
==== Results ====&lt;br /&gt;
&lt;br /&gt;
From the results, it can be seen at which line of code a potential vulnerability is present and how high the risk level is. In the example above, the first hit has the risk level 4, which is almost the highest level. It provides a brief description of the vulnerability with the related CWE-ID. In addition, Flawfinder propose the usage of alternatives methods. The [MS-banned]-Tag means, the used method, which in this case is &amp;quot;strcpy&amp;quot; was added from Microsoft into its official list of banned methods and should therefore not be used anymore.&lt;br /&gt;
&lt;br /&gt;
Flawfinder is CWE-Compatible, which means, among other things, that every hit will have a related CWE-ID which can be used to search for it withing the CWE database: this makes it easy to filter and found information.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://dwheeler.com/flawfinder/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11342</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11342"/>
		<updated>2023-01-30T11:14:29Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Flawfinder.png|600px|center|alt Report generated from Flawfinder]]&lt;br /&gt;
&lt;br /&gt;
==== Results ====&lt;br /&gt;
&lt;br /&gt;
From the results, it can be seen at which line of code a potential vulnerability is present and how high the risk level is. In the example above, the first hit has the risk level 4, which is almost the highest level. It provides a brief description of the vulnerability with the related CWE-ID. In addition, Flawfinder propose the usage of alternatives methods. The [MS-banned]-Tag means, the used method, which in this case is &amp;quot;strcpy&amp;quot; was added from Microsoft into its official list of banned methods and should therefore not be used anymore.&lt;br /&gt;
&lt;br /&gt;
Flawfinder is CWE-Compatible, which means, among other things, that every hit will have a related CWE-ID which can be used to search for it withing the CWE database: this makes it easy to filter and found information.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://dwheeler.com/flawfinder/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11104</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11104"/>
		<updated>2023-01-13T18:36:18Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Flawfinder.png|600px|center|alt Report generated from Flawfinder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Device to be used with this documentation]]&lt;br /&gt;
[[Maybe another device to be used with this documentation]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11103</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11103"/>
		<updated>2023-01-13T17:12:29Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Flawfinder.png|600px|left|alt Report generated from Flawfinder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Device to be used with this documentation]]&lt;br /&gt;
[[Maybe another device to be used with this documentation]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11102</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11102"/>
		<updated>2023-01-13T17:04:34Z</updated>

		<summary type="html">&lt;p&gt;LVillari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
=== Report of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
After running the tool against the example code from above, the generated report will be:&lt;br /&gt;
&lt;br /&gt;
[[File: Flawfinder.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Device to be used with this documentation]]&lt;br /&gt;
[[Maybe another device to be used with this documentation]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Flawfinder.png&amp;diff=11101</id>
		<title>File:Flawfinder.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Flawfinder.png&amp;diff=11101"/>
		<updated>2023-01-13T17:02:55Z</updated>

		<summary type="html">&lt;p&gt;LVillari: The report shown from the tool Flawfinder when run against a C program.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
The report shown from the tool Flawfinder when run against a C program.&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11100</id>
		<title>Flawfinder: A static analysis tool for C/C++</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Flawfinder:_A_static_analysis_tool_for_C/C%2B%2B&amp;diff=11100"/>
		<updated>2023-01-13T17:01:30Z</updated>

		<summary type="html">&lt;p&gt;LVillari: Created page with &amp;quot;== Summary ==   This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.  == Requirements ==  This tool requires: * Py...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation shows how to install and use Flawfinder, a static analysis tool for C/C++ source code. This tool aims to report possible security weaknesses (“flaws”) sorted by risk level to remove at least some potential security problems before the release of a program. It works on Unix-like systems and on Windows by using Cygwin. But in this documentation, it is explained using Ubuntu as a reference.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This tool requires:&lt;br /&gt;
* Python 2.7 or Python 3&lt;br /&gt;
The tool was tested on a self-implemented C program, which intentionally contains a Buffer Overflow, using the Ubuntu on WSL2 on Windows 11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation and usage ===&lt;br /&gt;
&lt;br /&gt;
To install pip for Python 3 run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
&lt;br /&gt;
Then, to install Flawfinder run:&lt;br /&gt;
&lt;br /&gt;
 sudo pip install flawfinder&lt;br /&gt;
&lt;br /&gt;
After installing it, run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder &amp;lt;directory_with_source_code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
=== Code Example in C ===&lt;br /&gt;
&lt;br /&gt;
This is the code example which was implemented to test the tools against a Buffer Overflow vulnerability.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;secret.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #define MIN(X, Y) (((X) &amp;lt; (Y)) ? (X) : (Y))&lt;br /&gt;
 &lt;br /&gt;
 int auth(char *usedusername, char *usedpw)&lt;br /&gt;
 {&lt;br /&gt;
 	int result = 0;&lt;br /&gt;
 	char pw_user[28];&lt;br /&gt;
 &lt;br /&gt;
 	strcpy(pw_user, usedpw);&lt;br /&gt;
 	printf(&amp;quot;\n\nUser: %s\n&amp;quot;, usedusername);&lt;br /&gt;
 	printf(&amp;quot;Password: %s\n&amp;quot;, usedpw);&lt;br /&gt;
 &lt;br /&gt;
 	&lt;br /&gt;
 	if(strlen(password) != strlen(usedpw)) {&lt;br /&gt;
 		printf(&amp;quot;Password Length is not correct\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(int i = 0; i&amp;lt;strlen(password);i++) {&lt;br /&gt;
 		if(strchr(usedpw,usedpw[i]) != strrchr(usedpw,usedpw[i])) {&lt;br /&gt;
 			printf(&amp;quot;No Double Char &#039;%c&#039; allowed\n&amp;quot;, usedpw[i]);&lt;br /&gt;
 			break;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
     if(strcmp(usedusername, username) != 0) {&lt;br /&gt;
 		printf(&amp;quot;No such Username. Pleasce contact Admin\n&amp;quot;);&lt;br /&gt;
 	} else {&lt;br /&gt;
 	    if(strcmp(password, usedpw) == 0) {&lt;br /&gt;
     		result = 1;&lt;br /&gt;
     	} else {&lt;br /&gt;
     		printf(&amp;quot;Password %s is incorrect: &amp;quot;, usedpw);	&lt;br /&gt;
     		for(int k = 0; k &amp;lt; MIN(strlen(password), strlen(usedpw));k++) {&lt;br /&gt;
     			if(usedpw[k] != password[k]) {&lt;br /&gt;
     			    printf(&amp;quot;Invalid Character &#039;%c&#039; in Password\n&amp;quot;, usedpw[k]);&lt;br /&gt;
     			    break;&lt;br /&gt;
     			}&lt;br /&gt;
     		}&lt;br /&gt;
     	}&lt;br /&gt;
 	}&lt;br /&gt;
 	return result;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void printUsage()&lt;br /&gt;
 {&lt;br /&gt;
 	printf(&amp;quot;Usage: &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;\n&amp;quot;);&lt;br /&gt;
 	exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
 	if(argc &amp;lt; 3)&lt;br /&gt;
 		printUsage();&lt;br /&gt;
 &lt;br /&gt;
 	if(auth(argv[1], argv[2]) != 0)&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                !ACCESS GRANTED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;Welcome %s!\n&amp;quot;, argv[1]);&lt;br /&gt;
 &lt;br /&gt;
 	}&lt;br /&gt;
 	else&lt;br /&gt;
 	{&lt;br /&gt;
 		printf(&amp;quot;\n\n#####################################################\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                 !ACCESS DENIED!                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#                                                   #\n&amp;quot;);&lt;br /&gt;
 		printf(&amp;quot;#####################################################\n\n\n&amp;quot;);&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Usage of Flawfinder ===&lt;br /&gt;
&lt;br /&gt;
From the same directory of the code run:&lt;br /&gt;
&lt;br /&gt;
 flawfinder .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Device to be used with this documentation]]&lt;br /&gt;
[[Maybe another device to be used with this documentation]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>LVillari</name></author>
	</entry>
</feed>