Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-04-2006, 03:57 AM
|
#1
|
Member
Registered: Mar 2006
Posts: 60
Rep:
|
banner grabing
Is it possible to change for example ssh banner
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 3.8.1p1 Debian-8.sarge.4 (protocol 2.0)
-output from nmap.
Can i tweak ssh to show some my string.
Can i do that for apache also?
|
|
|
05-04-2006, 04:50 AM
|
#2
|
Member
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451
Rep:
|
I don't get you, sorry  Please give a better example cause i think then i can help you.
|
|
|
05-04-2006, 04:54 AM
|
#3
|
Member
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567
Rep:
|
The sshd banner is /etc/issue.net file as in the /etc/sshd/sshd.conf comment out the Banner /etc/issue.net.
|
|
|
05-04-2006, 05:52 AM
|
#4
|
Registered User
Registered: Apr 2006
Location: India
Distribution: RedHat
Posts: 6
Rep:
|
did you mean welcome note ?
|
|
|
05-05-2006, 03:23 AM
|
#5
|
Member
Registered: Mar 2006
Posts: 60
Original Poster
Rep:
|
no no i know for sshd banner.
I dont want to some kiddi with nmap get my ssh server version.
with nmap i get this
22/tcp open ssh OpenSSH 3.8.1p1 Debian-8.sarge.4 (protocol 2.0)
can i tweak something to be:
22/tcp open ssh OpenSSH KIDDI get out of here!
|
|
|
05-05-2006, 03:35 AM
|
#6
|
Member
Registered: Jan 2005
Location: UK
Posts: 55
Rep:
|
Usually this kind of tweak you need to make in the source code for the application itself.
It is a server identification string, some servers (e.g. apache) have config options that allow you to modify the amount of information you show is this string.
|
|
|
05-05-2006, 06:49 AM
|
#7
|
Member
Registered: Mar 2006
Posts: 60
Original Poster
Rep:
|
i see that  soooo i must compile sshd by hand no apt
where is in apache that config?
|
|
|
05-05-2006, 06:54 AM
|
#8
|
Member
Registered: Mar 2006
Posts: 60
Original Poster
Rep:
|
i see that  soooo i must compile sshd by hand no apt
where is in apache that config?
|
|
|
05-05-2006, 07:27 AM
|
#9
|
Member
Registered: Jan 2005
Location: UK
Posts: 55
Rep:
|
For apache you want to look at the ServerTokens directive http://httpd.apache.org/docs/2.2/mod...l#servertokens
for more control over the server string again you would have to edit the source code
|
|
|
05-05-2006, 09:31 AM
|
#10
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Quote:
Originally Posted by unkn0wn
i see that  soooo i must compile sshd by hand no apt 
|
Or modify directly the binary:
Code:
sed -i 's/OpenSSH_4.2p1 Debian/AwayAwayAwayAwayAway/' /usr/sbin/sshd
|
|
|
05-07-2006, 08:47 AM
|
#11
|
Member
Registered: Mar 2006
Posts: 60
Original Poster
Rep:
|
i modiy and get segmentation fault 
what now 
|
|
|
05-09-2006, 02:32 AM
|
#12
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Quote:
Originally Posted by unkn0wn
i modiy and get segmentation fault 
what now 
|

Did you make a copy of the old sshd?
And you have put your version?
There is a mistake in the above line, should be:
Code:
sed -i 's/OpenSSH_4\.2p1 Debian/AwayAwayAwayAwayAway/' /usr/sbin/sshd
Take a new binary, launch strings on sshd
strings `which sshd` | grep -i debian
and do the operation as above, replacing . by \.
Worked on my sshd, the cleanest would be to recompile.
I don't think its really usefull to hide your version. Better tighten your security than hiding.
Last edited by nx5000; 05-09-2006 at 02:35 AM.
|
|
|
05-12-2006, 01:10 AM
|
#13
|
Member
Registered: Mar 2006
Posts: 60
Original Poster
Rep:
|
i menage it
recompile and edit version.h
tnx
|
|
|
05-12-2006, 01:42 AM
|
#14
|
Member
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567
Rep:
|
i have done sed -i 's/OpenSSH_4\.2p1 Debian/AwayAwayAwayAwayAway/' /usr/sbin/sshd but ....
root@argo:~# nmap -sV 192.168.0.2 -p 666
Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-05-12 08:41 CEST
Interesting ports on argo.ath.cx (192.168.0.2):
PORT STATE SERVICE VERSION
666/tcp open ssh OpenSSH 3.8.1p1 Debian-8.sarge.4 (protocol 1.99)
Nmap finished: 1 IP address (1 host up) scanned in 0.149 seconds
|
|
|
05-15-2006, 04:07 AM
|
#15
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
What I gave was an example. I'm not sure you really understand the command sed
sed replaces something with something else
I was running OpenSSH_4.2p1 so I replaced OpenSSH_4.2p1 by some junk. For you its something else!
To get the correct string, type this:
(1)
Code:
strings `which sshd` | grep -i debian
then to get the number of chars to replace do this
(2)
Code:
strings `which sshd` | grep -i debian | wc -c
Then issue:
sed -i 's/ your version/ Junk/'
WHERE - "your version" is the result of (1) after having replaced . by \.
- "Junk" has to be a text of your choice of length [result of (2) - 1 ] So if (2) gave 21, then you have to put a text of length 20: AwayAwayAwayAwayAway in my case.
then restart sshd and check
If you are wrong, you've corrupted your ssh, so keep a backup
Last edited by nx5000; 05-15-2006 at 04:08 AM.
|
|
|
All times are GMT -5. The time now is 08:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|