🔏
roguebook
  • group
    • Web
      • Concepts
      • OAuth 2.0
      • File upload
      • API testing
      • Web Cache Decpetion
      • CORS
      • CSRF
      • Cross site web socket hijacking
      • XS-Leaks
    • Bug Bounty
      • Recon
        • Dorking
          • SSL Checker
        • Wordlists
          • Twitter wordlist suggestions
      • Tips & Tricks
        • Combined
        • CSP Bypasses & open redirect
        • 403 Bypass
        • Arrays in JSON
        • Open Redirect
        • Next.js Application
        • Locla File Read
        • External Link
        • xss bypass
        • CSRF cors bypass
        • ssrf
      • Talks/Interviews/Podcasts
        • Bug Bounty Talks
        • Podcasts
          • Critical Thinking - Bug Bounty Podcast
            • Learning
      • Tools
    • Android
      • Getting Started
      • Intent Attack Surface
      • Broadcast Receivers
      • Android Permissions
      • Android Services
      • Content and FileProvider
      • WebView & CustomTabs
      • Insecure Storage
      • Tips & Tricks
    • Thick Client
      • Lab Setup
      • Information Gathering
      • Traffic analysis
      • Insecure Data storage
      • Input validation
      • DLL hijacking
      • Forensics
      • Extra resources
    • OSINT
      • OpSec
    • Malware Analysis
      • Lab Setup
      • Networking
      • Tools
      • Malware source
      • Basic Static Analysis
      • Basic Dynamic Analysis
      • Advanced Analysis
      • Advanced Static Analysis
      • Advanced Dynamic Analysis
      • Malicious Document Analysis
      • Shellcode Analysis
    • Malware Development
    • Blue Team
      • Tools
      • Malware Analysis
        • Basic Static Analysis
    • Assembly
      • Instructions
    • Binary Exploitation
    • Infographics
    • Malware Analysis
    • Threat Modeling
Powered by GitBook
On this page
  1. group
  2. Malware Analysis

Networking

Automate network setup as we have switch between Nat and internal network multiple times or bring a new machine into this network

You might need to put your vm back on internet for some time. THis is how you can do it.

scripts to setup NAT network and internal network on remnux.

  1. First set your network adapter to internal then use netplan.

Filename: 01-netcfg_internal.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: no
      addresses: [10.0.0.3/24]
      gateway4: 10.0.0.1
      dhcp6: yes

Scripts: netplan_internal.sh

cp /home/remnux/scripts/01-netcfg_internal.yaml /etc/netplan/01-netcfg.yaml
netplan apply

or

#!/bin/bash

# Create Netplan configuration file
echo "Creating Netplan configuration file..."
cat <<EOL > /etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: no
      addresses: [10.0.0.3/24]
      gateway4: 10.0.0.1
      dhcp6: yes
EOL

# Apply Netplan configuration
echo "Applying Netplan configuration..."
netplan apply

echo "Network settings updated successfully."
  1. Set your network adapter in NAT network then

Filename: 01-netcfg_nat.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: yes
      dhcp6: yes

Scripts: netplan_nat.sh

cp /home/remnux/scripts/01-netcfg_nat.yaml /etc/netplan/01-netcfg.yaml
netplan apply
alias netplannat='sudo /home/remnux/scripts/netplan_nat.sh'
alias netplaninternal='sudo /home/remnux/scripts/netplan_internal.sh'

or

#!/bin/bash

# Create Netplan configuration file (Default settings)
echo "Creating Netplan configuration file with default settings..."
cat <<EOL > /etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: yes
      dhcp6: yes
EOL

# Apply Netplan configuration
echo "Applying Netplan configuration..."
netplan apply

echo "Network settings updated successfully."

Putting FLareVM back to internet

  1. put vm in NAT state

  2. change DNS setting from:

view network connections > Ethernet > properties > tcp/ip4 
  1. set to automatically both things.

reverting to internal

  1. put vm in internal network as done previosuly.

  2. change DNS setting back

Let's automate it

  1. set your machien in internal network and then run this bat script and run as administrator

@echo off
netsh interface ip set address name="Ethernet" static 10.0.0.4 255.255.255.0 10.0.0.3
netsh interface ip set dns name="Ethernet" static 10.0.0.3
  1. set your machine in nat mode and run this script as administrator

@echo off
netsh interface ip set address name="Ethernet" dhcp 
netsh interface ip set dns name="Ethernet" dhcp

where is "Ethernet" is your network interface name, use this command to find your interface

netsh interface show interface

PreviousLab SetupNextTools

Last updated 27 days ago