Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .vscode/tasks.json

This file was deleted.

Binary file added HostsLoader-1.0.0.jar
Binary file not shown.
Binary file removed HostsLoader-all.jar
Binary file not shown.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# Hosts Loader

Burp plugin to automatically load hosts from /etc/hosts (or the Windows equivalent) into Burp's project hostname resolution override.
Supports adding custom dns hosts from dnsmasq on Linux.(`address=/custom1.tld/custom2.tld/custom3.tld/.../10.10.10.10`)

## Why?

When I'm doing HackTheBox, changing my /etc/hosts doesn't seem to work for resolving things in Burp Suite. I assume they're cached in some way, but honestly it was quicker to write this then debug why this happens.
When I'm doing HackTheBox or Vulnlab, changing my /etc/hosts (or the Windows equivalent or dnsmasq) doesn't seem to work (or I forget to reload dnsmasq) for resolving things in Burp Suite. I assume they're cached in some way, but honestly it was quicker to write this than try to debug why this happens.

## How to use

Install the jar as you would any other extension. A new tab will appear, click reload, and hosts will be loaded.
Install the jar as you would any other extension. A new tab will appear, click reload, and hosts will be loaded.

![Hosts Loader tab](img/example.png)
![Hosts Loader tab](img/example.png)

![Updated BurpSuite Setting](img/example2.png)

## How to build from source

### On Linux:

Run `gradlew build --project-cache-dir=/tmp/cache/.gradle/`

### On Windows:

Run `gradlew.bat build --project-cache-dir=%localappdata%\Temp\cache\.gradle\`
63 changes: 34 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.6/samples
*/
plugins {
id 'java'
}

// Apply the Java plugin
apply plugin: 'java'
version = '1.0.0'

// Use Maven (because Burp Extender is on Maven)
repositories {
mavenCentral()
mavenCentral()
}

dependencies {
// Add the Burp Extender interface
implementation 'net.portswigger.burp.extender:burp-extender-api:2.3'
compile 'com.google.guava:guava:31.1-jre'
compile 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
implementation 'net.portswigger.burp.extensions:montoya-api:+'
implementation 'com.google.guava:guava:33.3.0-jre'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

sourceSets {
main {
java {
// Set the source directory to "src"
srcDir 'src'
}
jar {
manifest {
attributes(
'Manifest-Version': '1.0',
'Created-By': 'Gradle 8.1.0',
'Main-Class': 'burp.HostsLoader'
)
}

from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

// Create a task for bundling all dependencies into a jar file.
task bigJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
task copyJar(type: Copy) {
dependsOn jar
from jar.archiveFile
into "${projectDir}"
}

task copyJar(type: Copy, dependsOn: bigJar) {
from(bigJar.archiveFile)
into project.rootProject.projectDir
}
build.finalizedBy(copyJar)
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
guava = "33.2.1-jre"
junit-jupiter = "5.10.3"

[libraries]
guava = { module = "com.google.guava:guava", version.ref = "guava" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 21 additions & 13 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading