Skip to content

Commit 4fbedcd

Browse files
committed
Removing FindBugs sub module dependency + README
1 parent 750908c commit 4fbedcd

File tree

5 files changed

+38
-40
lines changed

5 files changed

+38
-40
lines changed

.gitignore

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
*.class
2-
findbugs/annotationJavaDoc/
3-
findbugs/apiJavaDoc/
4-
findbugs/bin/
5-
findbugs/build/
6-
findbugs/classesEclipse/
7-
findbugs/doc/
8-
findbugs/jnlp/appengine.jnlp
9-
findbugs/lib/annotations.jar
10-
findbugs/lib/findbugs-ant.jar
11-
findbugs/lib/findbugs.jar
12-
findbugs/local.properties
13-
findbugs/optionalPlugin/
14-
findbugs/plugin/findbugsCommunalCloud.jar
15-
findbugs/plugin/webCloudClient.jar
16-
findbugs/src/doc/allBugDescriptions.html
17-
findbugs/src/doc/bugDescriptions.html
18-
findbugs/web/
19-
findbugsTestCases/build/
20-
findbugsTestCases/classesEclipse/
21-
findbugsTestCases/history/
2+
findbugs/
223
findbugs-injection-detector/bin
234
findbugs-injection-detector/injection-detector.jar
24-
out/
25-
26-
# if you remove the above rule, at least ignore user-specific stuff:
27-
.idea/workspace.xml
28-
.idea/tasks.xml
29-
# and these sensitive or high-churn files:
30-
.idea/dataSources.ids
31-
.idea/dataSources.xml
32-
.idea/sqlDataSources.xml
33-
.idea/dynamic.xml
5+
out/

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#Injection Detector Plug-In for FindBugs
2+
3+
Input Injections are considered as the most common and effective vulnerabilities to exploit in many software systems (esp. web apps). Input injection is caused by executing user inputs which have not been validated or sanitized, so that the purpose of execution is changed by malicious agents into their advantages.
4+
5+
The input injection detector is done by extending an existing static analysis tool, namely **FindBugs** (currently we only support **FindBugs 2.0.3**). The detection uses dataflow analysis to monitor user-contaminated variables. To improve accuracy, reducing false positives and false negatives, dataflow analysis is used to monitor variables that have been validated or sanitized by developers.
6+
7+
## Vulnerabilities
8+
This plug-in can detect following vulnerabilities:
9+
10+
1. SQL injection
11+
2. Shell/command injection
12+
3. XPath injection
13+
4. LDAP injection
14+
5. Cross-site scripting (XSS) type-1
15+
6. Cross-site scripting (XSS) type-2
16+
7. Unvalidated redirects
17+
8. Unvalidated forwards
18+
9. HTTP response splitting
19+
10. Path traversal
20+
11. Remote file inclusion
21+
22+
## Build
23+
24+
1. Clone this repository.
25+
2. Download **FindBugs 2.0.3** source code (You can download it from [SourceForge](http://sourceforge.net/projects/findbugs/files/findbugs/2.0.3/findbugs-2.0.3-source.zip/download)).
26+
3. Extract `findbugs-2.0.3-source.zip` to root directory of this repositories. In the root directory, you should have 3 (three) directories: `findbugs-2.0.3`, `findbugs-injection-detector`, and `vulnerable-sites`.
27+
4. Rename `findbugs-2.0.3` to `findbugs`.
28+
5. In terminal, change current directory to `findbugs`, and then run `ant build` to compile and build **FindBugs**.
29+
6. In terminal, change current directory to `findbugs-injection-detector`, and then run `ant install` to compile, build, and install the detector to **FindBugs** in `findbugs` directory.
30+
31+
You should have `injection-detector.jar` in `findbugs-injection-detector` after building the plug-in. This file is plug-in for **FindBugs**. To install to another copy of **FindBugs**, you could copy `injection-detector.jar` to `plugin` directory in **FindBugs**.

findbugs

Lines changed: 0 additions & 1 deletion
This file was deleted.

vulnerable-sites/src/main/java/id/ac/itb/cs/vuln/ExampleServlet.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ public class ExampleServlet extends HttpServlet {
1616
private final static MySQLCodec MY_SQL_CODEC = new MySQLCodec(MySQLCodec.Mode.STANDARD);
1717

1818
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
19-
String uname = request.getParameter("uname");
20-
2119
PrintWriter out = response.getWriter();
22-
Employee employee = getEmployee(uname);
20+
21+
String uname = request.getParameter("uname");
22+
Employee employee = getEmployee(uname);
2323
out.write("Hello, " + employee.getName() + "!");
2424
}
2525

2626
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
27-
String uname = ESAPI.encoder().encodeForSQL(MY_SQL_CODEC, request.getParameter("uname"));
28-
2927
PrintWriter out = response.getWriter();
28+
29+
String uname = ESAPI.encoder().encodeForSQL(MY_SQL_CODEC, request.getParameter("uname"));
3030
Employee employee = getEmployee(uname);
3131
out.write("Hello, " + employee.getName() + "!");
3232
}

0 commit comments

Comments
 (0)