-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwindows.go
84 lines (84 loc) · 5.14 KB
/
windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Made by SirSAC for Network.
package main
//
import (
. "context"
"log"
. "net"
"os/exec"
"runtime"
)
//
func handle_internet(local_connection Conn, target_address string, processor_thread int, pipe_size int, try_count int, keep_alive bool, serial_order bool) {
if serial_order == true {
sync_group.Add(processor_thread)
}
load_balancer := get_load_balancer(serial_order)
local_address, _ := ResolveTCPAddr("tcp", load_balancer.interface_address)
network_dialer.LocalAddr = local_address
remote_connection, err := network_dialer.DialContext(Background(), "tcp", target_address)
if err != nil {
try_again := 0
for try_again < try_count {
load_balancer := get_load_balancer(serial_order)
local_address, _ := ResolveTCPAddr("tcp", load_balancer.interface_address)
network_dialer.LocalAddr = local_address
remote_connection, err := network_dialer.DialContext(Background(), "tcp", target_address)
if err == nil {
go handle_proxy(local_connection, remote_connection, local_address, target_address, pipe_size, keep_alive)
if serial_order == true {
defer sync_group.Wait()
}
return
}
try_again++
}
log.Println(string(COLOR_YELLOW), "[!]", local_address, "<=>", target_address, string(COLOR_RESET))
local_connection.Write([]byte {5, NETWORK_UNREACHABLE, 0, 1, 0, 0, 0, 0, 0, 0})
local_connection.Close()
if serial_order == true {
defer sync_group.Wait()
defer sync_group.Done()
}
runtime.Goexit()
}
go handle_proxy(local_connection, remote_connection, local_address, target_address, pipe_size, keep_alive)
if serial_order == true {
defer sync_group.Wait()
}
}
//
func execute_command(mtu_size string, option_setting bool) {
exec.Command("cmd.exe", "/c", "wmic.exe process where 'name='DisPro.exe'' call setpriority realtime").Run()
exec.Command("cmd.exe", "/c", "net.exe stop /y RemoteAccess").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv6 set interface 1 forwarding=enabled advertise=disabled metric=1 ignoredefaultroutes=disabled advertisedefaultroute=disabled store=active ecncapability=application").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv6 set subinterface interface=1 mtu=", mtu_size, "store=active").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv6 set address interface=1 type=anycast store=active").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv6 set address interface=1 address=::1 type=unicast validlifetime=infinite preferredlifetime=infinite store=active").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv4 set interface 1 forwarding=enabled advertise=disabled metric=1 ignoredefaultroutes=disabled advertisedefaultroute=disabled store=active ecncapability=application").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv4 set subinterface interface=1 mtu=", mtu_size, "store=active").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv4 set address name=1 source=dhcp type=anycast store=active").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv4 set address name=1 source=static address=127.0.0.1 mask=255.255.255.255 gwmetric=1 type=unicast store=active").Run()
if option_setting == true {
exec.Command("cmd.exe", "/c", "sc.exe config RemoteAccess start=disabled").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv6 set dnsservers name=1 source=dhcp register=both validate=yes").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface ipv4 set dnsservers name=1 source=dhcp register=both validate=yes").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface tcp set global ecncapability=enabled").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface tcp set global fastopen=enabled").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface tcp set global timestamps=enabled").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface portproxy set v4tov6 listenport=8118 connectaddress=::1 connectport=8118 listenaddress=127.0.0.1").Run()
exec.Command("cmd.exe", "/c", "netsh.exe interface portproxy set v4tov6 listenport=1080 connectaddress=::1 connectport=1080 listenaddress=127.0.0.1").Run()
exec.Command("cmd.exe", "/c", "netsh.exe lan set autoconfig enabled=yes interface=*").Run()
exec.Command("cmd.exe", "/c", "netsh.exe lan set allowexplicitcreds allow=yes").Run()
exec.Command("cmd.exe", "/c", "netsh.exe wlan set randomization enabled=yes interface=*").Run()
exec.Command("cmd.exe", "/c", "netsh.exe wlan set autoconfig enabled=yes interface=*").Run()
exec.Command("cmd.exe", "/c", "netsh.exe wlan set hostednetwork mode=allow").Run()
exec.Command("cmd.exe", "/c", "netsh.exe wlan set blockednetworks display=show").Run()
exec.Command("cmd.exe", "/c", "netsh.exe wlan set allowexplicitcreds allow=yes").Run()
exec.Command("cmd.exe", "/c", "netsh.exe winhttp set proxy proxy-server=[::1]:8118").Run()
exec.Command("cmd.exe", "/c", "netsh.exe http add iplisten ipaddress=::1").Run()
exec.Command("cmd.exe", "/c", "netsh.exe http add iplisten ipaddress=127.0.0.1").Run()
}
exec.Command("cmd.exe", "/c", "ipconfig.exe /registerdns").Run()
exec.Command("cmd.exe", "/c", "ipconfig.exe /flushdns").Run()
}