dnsspoof: Fix lingering case sensitivity issues

pull/72/head
Mike Kershaw / Dragorn 2023-03-20 13:28:11 -04:00
parent dc22ec3e5c
commit 1b020708b5
4 changed files with 12 additions and 12 deletions

View File

@ -24,4 +24,4 @@ const routes: Routes = [
], ],
exports: [dnsspoofComponent] exports: [dnsspoofComponent]
}) })
export class dnsspoofModule { } export class DNSspoofModule { }

View File

@ -21,7 +21,7 @@ export class dnsspoofComponent implements OnInit {
handleBackup(): void { handleBackup(): void {
this.API.request({ this.API.request({
module: 'dnsspoof', module: 'DNSspoof',
action: "backup" action: "backup"
}, (response) => { }, (response) => {
if (response == "ok") { if (response == "ok") {
@ -35,7 +35,7 @@ export class dnsspoofComponent implements OnInit {
add(): void { add(): void {
this.isAdding = true; this.isAdding = true;
this.API.request({ this.API.request({
module: 'dnsspoof', module: 'DNSspoof',
action: "add", action: "add",
user_ip: this.userIP, user_ip: this.userIP,
user_domain: this.userDomain user_domain: this.userDomain
@ -53,7 +53,7 @@ export class dnsspoofComponent implements OnInit {
get(): void { get(): void {
this.API.request({ this.API.request({
module: 'dnsspoof', module: 'DNSspoof',
action: "get" action: "get"
}, (response) => { }, (response) => {
this.allocation = response; this.allocation = response;
@ -63,7 +63,7 @@ export class dnsspoofComponent implements OnInit {
update(): void { update(): void {
this.isUpdating = true; this.isUpdating = true;
this.API.request({ this.API.request({
module: 'dnsspoof', module: 'DNSspoof',
action: "update" action: "update"
}, (response) => { }, (response) => {
if (response != "ok") { if (response != "ok") {
@ -76,7 +76,7 @@ export class dnsspoofComponent implements OnInit {
reset(): void { reset(): void {
this.isResetting = true; this.isResetting = true;
this.API.request({ this.API.request({
module: 'dnsspoof', module: 'DNSspoof',
action: "reset" action: "reset"
}, (response) => { }, (response) => {
if (response != "ok") { if (response != "ok") {

View File

@ -5,15 +5,15 @@ import os
import subprocess import subprocess
from pineapple.modules import Module, Request from pineapple.modules import Module, Request
module = Module('dnsspoof', logging.DEBUG) module = Module('DNSspoof', logging.DEBUG)
@module.handles_action("backup") @module.handles_action("backup")
def backup(request): def backup(request):
try: try:
if not os.path.exists('modules/dnsspoof/host-backup.txt'): if not os.path.exists('modules/DNSspoof/host-backup.txt'):
with open("/etc/hosts", "r") as file: with open("/etc/hosts", "r") as file:
hosts = file.read() hosts = file.read()
with open("modules/dnsspoof/host-backup.txt", "w+") as backup: with open("modules/DNSspoof/host-backup.txt", "w+") as backup:
backup.write(hosts) backup.write(hosts)
return "ok" return "ok"
except Exception as e: except Exception as e:
@ -51,7 +51,7 @@ def update_dns(request):
@module.handles_action("reset") @module.handles_action("reset")
def reset_hosts(request): def reset_hosts(request):
try: try:
with open("modules/dnsspoof/host-backup.txt", "r") as backup: with open("modules/DNSspoof/host-backup.txt", "r") as backup:
old = backup.read() old = backup.read()
with open("/etc/hosts", "w+") as file: with open("/etc/hosts", "w+") as file:
file.write(old) file.write(old)
@ -60,4 +60,4 @@ def reset_hosts(request):
return "Error: " + str(e) return "Error: " + str(e)
if __name__ == '__main__': if __name__ == '__main__':
module.start() module.start()

View File

@ -4,4 +4,4 @@
export * from './lib/services/dnsspoof.service'; export * from './lib/services/dnsspoof.service';
export * from './lib/components/dnsspoof.component'; export * from './lib/components/dnsspoof.component';
export * from './lib/dnsspoof.module'; export * from './lib/DNSspoof.module';