LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2015, 07:33 PM   #16
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled

Wide open Guest account.
Stolen Laptop.
Open relay mail server.

It's like a Spy Novel.
 
Old 10-30-2015, 08:00 PM   #17
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Code:
[schneidz@hyper ~]$ sudo journalctl -f
...
Oct 30 20:59:47 hyper sshd[28738]: Invalid user stolenlaptop from 192.168.1.25
 
Old 10-30-2015, 08:53 PM   #18
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
without requiring a known SMTP server
I guess my premise was you could setup that server yourself and use it as the relay. Which I suppose would be non-trivial and still requires a relay. My understanding of email servers is not great which I suppose has been demonstrated lol.
My wish to maintain a email-based notification would be the non-synchronous state and easy alertness it would provide.

In any case, a disposable email/password relay would be a option..

What would be nice is a method of channelling increased amounts of information rather then just the ip address. Nearby SSIDS, ssh access, even uptime would be useful. As I wrote earlier, having ssh access would be phenomenal since it would give access to a camera if the laptop has one, even recording motion (thief using the laptop) and sending it somewhere.

Here's a possibility:
setup sudo to permit guest user to run this single command: /usr/sbin/sshd -p 9998 (gets around difficulty with forwarding privileged ports)
locally forward 9998 to 9998 on server X with ssh ensuring the key used is for a account with shell set to /bin/false and only permitted to forward ports.
 
Old 10-31-2015, 04:46 AM   #19
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by Sefyir View Post
Here's a possibility:
setup sudo to permit guest user to run this single command: /usr/sbin/sshd -p 9998 (gets around difficulty with forwarding privileged ports)
locally forward 9998 to 9998 on server X with ssh ensuring the key used is for a account with shell set to /bin/false and only permitted to forward ports.
Nice idea but the issue would be that most internet connections nowadays are behind some form of NAT with a stateful firewall built in -- meaning that to get to internal IP addresses a port needs to be opened in the firewall.
Yes, I've been thinking a fair bit about this myself.
 
Old 10-31-2015, 08:09 PM   #20
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by 273 View Post
Nice idea but the issue would be that most internet connections nowadays are behind some form of NAT with a stateful firewall built in -- meaning that to get to internal IP addresses a port needs to be opened in the firewall.
Yes, I've been thinking a fair bit about this myself.
I had it backwards, it's a reverse port forward. Essentially, make a outbound connection to VPS and forward all remote traffic on port 9987 to local port 22.
This actually circumvents firewalls as long as the computer is permitted by the network to make a outbound connection. It would be very difficult to view a webpage if outbound connections were denied.

Edit:
All traffic over those ports is forwarded through the ssh session

Last edited by Sefyir; 10-31-2015 at 08:14 PM.
 
Old 10-31-2015, 08:13 PM   #21
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by Sefyir View Post
I had it backwards, it's a reverse port forward. Essentially, make a outbound connection to VPS and forward all remote traffic on port 9987 to local port 22.
This actually circumvents firewalls as long as the computer is permitted by the network to make a outbound connection. It would be very difficult to view a webpage if outbound connections were denied.
Right, OK, so how do you put the hole in the firewall to let it in?
I know NATs aren't all that good at stopping attacks but I can't recall an attack to open a port then forward to an IP beyond that.
 
Old 10-31-2015, 08:18 PM   #22
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
There's no hole put in the firewall, it's still doing its job. If I understand it correctly, upon doing the ssh remote bind, ssh binds port n on server to client port x. Then if traffic is sent over those ports, it is sent over the already existing ssh connection. I guess the way to test would be to have a VPS. Then bind a publicly accessible port to your client port that is guarded by the firewall. Then try to connect to the VPS accessible port. You should suddenly have access. I haven't tested it much but it's supposed to be a very effective way of getting around firewalls.
It's also supposed to be a reason why ssh is often blocked on corporate firewalls..

A demo might explain better:
I run this ssh -R 9998:127.0.0.1:9997 hostname
Then I did nc -l 9997 on client
Then I did echo foo | nc 127.0.0.1 9998 on VPS

Success! My firewall on client does not allow connections to 9997 but traffic went through!


Quote:
I can't recall an attack
It's not really a attack though. You've been granted access through ssh and have been authenticated. programs are permitted to bind ports when run, it's really just a extension of ssh functionality, rather then any real "crack". Nothing to fix since there was never really a exploit.

_______


In relating to the script, whent he guest user logs in, it will attempt to make a network connection, then attempt to do the above ssh connection (key based so no password) on a limited account that binds some port on the VPS to port 9998 (which has a sshd server running on that port) on the stolen computer. Then in the same manner, no matter what firewall, OP can then login to their computer.

Last edited by Sefyir; 10-31-2015 at 08:34 PM.
 
1 members found this post helpful.
Old 11-01-2015, 05:04 AM   #23
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Ah, yes, clever.
 
Old 11-03-2015, 05:07 PM   #24
Flexico
Member
 
Registered: Aug 2015
Distribution: Mint MATE
Posts: 153

Original Poster
Rep: Reputation: Disabled
I'll have to come back to this when I have more time; most of this tech talk is beyond my current knowledge. Thanks for all the info though guys!

Also, LOL at the spy movie joke. =P
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run a shell script/cronjob when any email arrive to specific email address ikillu Linux - General 3 05-30-2009 08:18 AM
Using a script to send a file to email address kopite Programming 3 06-17-2008 03:21 AM
Script to check IP address and send to an email kbrajesh Linux - Networking 4 02-08-2007 03:13 AM
script to relay the data in the fields to my email address generalachoo Programming 4 08-25-2006 07:54 AM
bash script to detect scsi address at boot ewto Programming 2 10-20-2003 02:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration