Sunday, October 20, 2019

TP-LINK TL-WR802N OpenWrt

I started using these instructions:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e6f047fa368ca9c90691b93aa5e03068fe1f4178
However for the V4 I have they are wrong, the ip is actually 192.168.0.66 for the tftpd.
Also the filename tested that works is wr802nv1_tp_recovery.bin not tp_recovery.bin

Thanks to this person for the mentioning ip and filename changes:
http://wr802n.blogspot.com/2018/04/dd-wrt-install-on-tp-link-tl-wr802n.html

Tested with Ubuntu18.04 atftp server.

apt-get install atftpd
cp wr802nv1_tp_recovery.bin to /srv/tftpd
chown -R nobody /srv/tftpd
sudo atftpd -v --user nobody /srv/tftp --daemon --listen-local
tftp to 192.168.0.66 and issue a get wr802nv1_tp_recovery.bin to confirm tftp is operational
reset router with ethernet jack plugged into tftpd server, wait for it to download the firmware

wait for device to reboot, get dhcp from newly running openwrt
ssh root@192.168.1.1
Gets you OpenWrt 4.14.149 2019

opkg update doesn't work because I am connected over the thernet port and the wifi port isn't configured with internet

try to config wifi client to get inet
https://openwrt.org/docs/guide-user/network/wifi/connect_client_wifi
uci set wireless.@wifi-device[0].disabled="0"
uci commit wireless
wifi

confirm iw dev wlan0 scan returns list of aps and wifi is enabled

uci get network.wwan returns blank so set it

uci set network.wwan=wlan0
lets try this
http://h-wrt.com/en/mini-how-to/wifi_openwrt

editing the /etc/config/wireless and /etc/init.d/network got us wlan0 internet access!
now opkg update worked

opkg install luci works now!



Wednesday, October 9, 2019

rc.local on kali19.3

Based on https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd A ton of apps don't have systemd scripts.
cat makerc-local.sh
 #!/bin/bash  
 #create a service that runs /etc/rc.local at boot based on  
 #https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd  
 cat > /etc/systemd/system/rc-local.service <<EOL  
 [Unit]  
  Description=/etc/rc.local Compatibility  
  ConditionPathExists=/etc/rc.local  
 [Service]  
  Type=forking  
  ExecStart=/etc/rc.local start  
  TimeoutSec=0  
  StandardOutput=tty  
  RemainAfterExit=yes  
  SysVStartPriority=99  
 [Install]  
  WantedBy=multi-user.target  
 EOL  
 printf '%s\n' '#!/bin/bash' 'exit 0' | tee -a /etc/rc.local  
 systemctl enable rc-local  
 systemctl start rc-local.service  
 systemctl status rc-local.service