Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #229938 > unrolled thread
| Started by | zhang yang <shuyang9708@gmail.com> |
|---|---|
| First post | 2020-12-23 15:40 +0100 |
| Last post | 2020-12-24 15:40 +0100 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.debian.user
Debian 8 system is not fully functional zhang yang <shuyang9708@gmail.com> - 2020-12-23 15:40 +0100
Re: Debian 8 system is not fully functional Dan Ritter <dsr@randomstring.org> - 2020-12-23 16:00 +0100
Re: Debian 8 system is not fully functional zhang yang <shuyang9708@gmail.com> - 2020-12-24 06:10 +0100
Re: Debian 8 system is not fully functional Greg Wooledge <wooledg@eeg.ccf.org> - 2020-12-24 14:10 +0100
Re: Debian 8 system is not fully functional Kenneth Parker <sea7kenp@gmail.com> - 2020-12-24 15:40 +0100
| From | zhang yang <shuyang9708@gmail.com> |
|---|---|
| Date | 2020-12-23 15:40 +0100 |
| Subject | Debian 8 system is not fully functional |
| Message-ID | <BpdsZ-3A2-3@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
When I write a raw socket to send packets in Linux C, it shows: WARNNING:The current server does not support IP spoofing. How to set up debian8 system to use this function
[toc] | [next] | [standalone]
| From | Dan Ritter <dsr@randomstring.org> |
|---|---|
| Date | 2020-12-23 16:00 +0100 |
| Message-ID | <BpdMm-3J6-11@gated-at.bofh.it> |
| In reply to | #229938 |
zhang yang wrote: > When I write a raw socket to send packets in Linux C, it shows: > WARNNING:The current server does not support IP spoofing. > How to set up debian8 system to use this function 1. Read https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html 2. Install a Debian 10 (stable) system. Debian supports upgrading in place to 9, then 10. If you're doing spoofing, you are security-conscious; if you are security-conscious, you should be running stable, not old-old-stable. 3. Alternatively, you don't mean to be spoofing and your problem is in your code. -dsr-
[toc] | [prev] | [next] | [standalone]
| From | zhang yang <shuyang9708@gmail.com> |
|---|---|
| Date | 2020-12-24 06:10 +0100 |
| Message-ID | <Bpr2V-408-1@gated-at.bofh.it> |
| In reply to | #229940 |
[Multipart message — attachments visible in raw view] — view raw
When I turn it on https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html I guess it's IP_ Dynaddr - Boolean. If set non-zero, enables support for dynamic addresses. If set to a non-zero value larger than 1, a kernel log message will be printed when dynamic address rewriting occurs.Default : 0. Should it be set to 1 to send packets disguised as IP? But when I use vi IP_ dynaddr To modify and save the prompt: "IP"_ dynaddr" E212: Can't open file for writing“. So I used Chmod 777 ip_ dynaddr authority, display error: Chmod: changing permissions of 'IP_ dynaddr': Operation not permitted. I use chaddr - i ip_dynaddr command to removes attributes and displays an error: chattr: Inappropriate ioctl for device while reading flags on ip_dynaddr. How to set dynaddr? On Wed, Dec 23, 2020 at 10:51 PM Dan Ritter <dsr@randomstring.org> wrote: > zhang yang wrote: > > When I write a raw socket to send packets in Linux C, it shows: > > WARNNING:The current server does not support IP spoofing. > > How to set up debian8 system to use this function > > 1. Read > https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html > > 2. Install a Debian 10 (stable) system. Debian supports > upgrading in place to 9, then 10. If you're doing spoofing, you > are security-conscious; if you are security-conscious, you > should be running stable, not old-old-stable. > > 3. Alternatively, you don't mean to be spoofing and your problem > is in your code. > > -dsr- >
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <wooledg@eeg.ccf.org> |
|---|---|
| Date | 2020-12-24 14:10 +0100 |
| Message-ID | <Bpyxs-hz-7@gated-at.bofh.it> |
| In reply to | #229960 |
On Thu, Dec 24, 2020 at 12:49:30PM +0800, zhang yang wrote: > IP_ dynaddr > To modify and save the prompt: "IP"_ dynaddr" E212: Can't open file for > writing“. > So I used Chmod 777 ip_ dynaddr authority, display error: Chmod: changing > permissions of 'IP_ dynaddr': Operation not permitted. > I use chaddr - i ip_dynaddr command to removes attributes and displays an > error: chattr: Inappropriate ioctl for device while reading flags on > ip_dynaddr. How to set dynaddr? For the benefit of others, the file in question is /proc/sys/net/ipv4/ip_dynaddr /proc is not a regular file system. It's an interface to pieces of the kernel. Some of these pieces can be read by everyone. Almost none of them can be *written* by everyone -- you usually have to be root to write to them. chmod 777 is almost always a *huge* mistake. If the permissions on a file are stopping you from doing someting, there's usually a reason for that. Destroying the permissions on the file is not the right answer. Elevating yourself to a higher power level is. Now, the next thing you'll want to know is that while root can probably write to this file, it can't necessary *edit* the file with a text editor. You're expected to use a much lower level of access to open the file, write to it, and close it. Typically that's done with echo something > /proc/whatever Of course this redirection means that it's your shell who needs privileges to open the file for writing. If you try it as your regular user, you'll encounter the "permission denied" error that you already saw. The expected course of action is for you to do it from a root shell, which you obtain by using su or sudo. $ su Password: # echo something > /proc/whatever # exit $ If you're not a fan of su, or if you're one of those people who has decided not to have a root password (a bad idea!), then you can get a root shell with sudo -s: $ sudo -s # echo something >/proc/whatever # exit $ (sudo may prompt you for your password if you haven't used sudo in that terminal in the last few minutes.) Some people will try to be clever and do this: sudo echo something > /proc/whatever That will not work, for the reasons explained at <https://mywiki.wooledge.org/BashPitfalls#pf53>. You may use one of the quoted forms on that page if you prefer. But the original design of the files in /proc was for users with a root shell to perform shell redirections. Not for sudo. Also, while I'm here talking about su, bear in mind that Debian decided to become more like Red Hat and replaced their version of su with the one used by Red Hat, and didn't bother configuring it to maintain backward compatibility with the previous version. See <https://wiki.debian.org/NewInBuster#Changes> for workarounds, including how to configure su to behave sanely.
[toc] | [prev] | [next] | [standalone]
| From | Kenneth Parker <sea7kenp@gmail.com> |
|---|---|
| Date | 2020-12-24 15:40 +0100 |
| Message-ID | <BpzWy-15H-3@gated-at.bofh.it> |
| In reply to | #229965 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Dec 24, 2020, 8:08 AM Greg Wooledge <wooledg@eeg.ccf.org> wrote: > On Thu, Dec 24, 2020 at 12:49:30PM +0800, zhang yang wrote: > > IP_ dynaddr > > To modify and save the prompt: "IP"_ dynaddr" E212: Can't open file for > > writing“. > > So I used Chmod 777 ip_ dynaddr authority, display error: Chmod: changing > > permissions of 'IP_ dynaddr': Operation not permitted. > > I use chaddr - i ip_dynaddr command to removes attributes and displays an > > error: chattr: Inappropriate ioctl for device while reading flags on > > ip_dynaddr. How to set dynaddr? > > For the benefit of others, the file in question is > > /proc/sys/net/ipv4/ip_dynaddr > > /proc is not a regular file system. It's an interface to pieces of the > kernel. Some of these pieces can be read by everyone. Almost none of > them can be *written* by everyone -- you usually have to be root to > write to them. > > chmod 777 is almost always a *huge* mistake. If the permissions on a > file are stopping you from doing someting, there's usually a reason > for that. Destroying the permissions on the file is not the right answer. > Elevating yourself to a higher power level is. > > Now, the next thing you'll want to know is that while root can probably > write to this file, it can't necessary *edit* the file with a text > editor. You're expected to use a much lower level of access to open > the file, write to it, and close it. Typically that's done with > > echo something > /proc/whatever > > Of course this redirection means that it's your shell who needs > privileges to open the file for writing. If you try it as your > regular user, you'll encounter the "permission denied" error that > you already saw. > > The expected course of action is for you to do it from a root shell, > which you obtain by using su or sudo. > > $ su > Password: > # echo something > /proc/whatever > # exit > $ > > If you're not a fan of su, or if you're one of those people who has > decided not to have a root password (a bad idea!), then you can get > a root shell with sudo -s: > > $ sudo -s > # echo something >/proc/whatever > # exit > $ > > (sudo may prompt you for your password if you haven't used sudo in that > terminal in the last few minutes.) > > Some people will try to be clever and do this: > > sudo echo something > /proc/whatever > > That will not work, for the reasons explained at > <https://mywiki.wooledge.org/BashPitfalls#pf53>. +10 That is an Awesome page you have there, Greg! I have Bookmarked it. > You may use one of > the quoted forms on that page if you prefer. But the original design > of the files in /proc was for users with a root shell to perform shell > redirections. Not for sudo. > > Also, while I'm here talking about su, bear in mind that Debian decided > to become more like Red Hat and replaced their version of su with the > one used by Red Hat, and didn't bother configuring it to maintain backward > compatibility with the previous version. See > <https://wiki.debian.org/NewInBuster#Changes> for workarounds... > Also good. I was never affected by the change, because I always use "su -". Kenneth Parker >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web