Skip to content

Commit

Permalink
Merge pull request #38 from jfish7/burp_2_1_plus
Browse files Browse the repository at this point in the history
Making NoPE Proxy work with Burp 2.1+
  • Loading branch information
summitt authored Aug 14, 2020
2 parents d9c7d51 + 1aa5265 commit 21b2098
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
21 changes: 17 additions & 4 deletions NonHTTPProxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>NonHTTPProxy</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand All @@ -37,19 +50,19 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.6.0.Beta2</version>
<artifactId>hibernate-core</artifactId>
<version>5.4.4.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.1.0.Final</version>
<version>5.4.4.Final</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11.2</version>
<version>3.28.0</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
Expand Down
23 changes: 20 additions & 3 deletions NonHTTPProxy/src/josh/dao/HibHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package josh.dao;


import java.util.Properties;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

Expand All @@ -19,9 +21,24 @@ private static SessionFactory buildSessionFactory() {
String path = System.getProperty("user.home");
String resultFile = path + "/.NoPEProxy/requests.sqlite";
String SQLString = "jdbc:sqlite:" + resultFile;
Configuration cfg = new Configuration();
cfg.configure();
cfg.getProperties().setProperty("hibernate.connection.url",SQLString);
Configuration cfg = new Configuration();
Properties prop= new Properties();

prop.setProperty("hibernate.dialect", "josh.dao.SQLiteDialect");
prop.setProperty("hibernate.connection.driver_class", "org.sqlite.JDBC");
prop.setProperty("hibernate.show_sql", "false");
prop.setProperty("hibernate.hbm2ddl.auto", "update");
prop.setProperty("hibernate.c3p0.min_size", "20");
prop.setProperty("hibernate.c3p0.max_size", "50");
prop.setProperty("hibernate.c3p0.timeout", "1800");
prop.setProperty("hibernate.c3p0.max_statements", "300");
prop.setProperty("hibernate.c3p0.idle_test_period", "300");
prop.setProperty("hibernate.connection.url",SQLString);
cfg.addProperties(prop);

cfg.addAnnotatedClass(Requests.class);
cfg.addAnnotatedClass(ListenerSetting.class);

return cfg.buildSessionFactory();
}
catch (Throwable ex) {
Expand Down
4 changes: 3 additions & 1 deletion NonHTTPProxy/src/josh/utils/Lister.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.pcap4j.core.PcapHandle;
import org.pcap4j.core.PcapNativeException;
import org.pcap4j.core.PcapNetworkInterface;
import org.pcap4j.core.PcapPacket;
import org.pcap4j.core.PcapNetworkInterface.PromiscuousMode;
import org.pcap4j.core.Pcaps;
import org.pcap4j.core.BpfProgram.BpfCompileMode;
Expand Down Expand Up @@ -62,7 +63,8 @@ public void run() {

PacketListener listener
= new PacketListener() {
public void gotPacket(Packet packet) {
@Override
public void gotPacket(PcapPacket packet) {
TcpPacket tcp = packet.get(TcpPacket.class);
IpV4Packet ip = packet.get(IpV4Packet.class);
if(tcp.getHeader().getSyn() && !tcp.getHeader().getAck() && !ip.getHeader().getSrcAddr().toString().equals("/"+IP)){
Expand Down

0 comments on commit 21b2098

Please sign in to comment.