/srv/irclogs.ubuntu.com/2017/09/18/#ubuntu-server.txt

Bryzn007what hot server backup do you use that is effective for server runing Zimbra? which can be easy to restore in case of catastophic hardware failure?01:42
=== G_ is now known as G
{bosco}so i have setup my apache2 server and now when i go to boscosworld.com it says i do not have permission to view this page on the server ? any help  ubuntu 17.0403:46
{bosco}thank u03:47
Bryzn007adjust permissions, this may help you https://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver04:17
{bosco}Bryzn007 i went through that entire page and nothing04:30
{bosco}no change04:30
cpaelzergood morning05:40
lordievaderGood morning06:23
=== jelly-home is now known as jelly
rbasakcpaelzer: o/07:35
rbasakcpaelzer: I fear I won't finish catching up this week :-/07:35
rbasakcpaelzer: anything I should prioritise?07:35
cpaelzerrbasak: hiho07:36
cpaelzerrbasak: I'm working on libvirt dev bugs atm, nothing from me you could unblock07:38
cpaelzermaybe some SRUs but that I'd leave to the normal SRU rotation07:38
rbasakOK, thanks07:38
dpb1hey rbasak, w/b14:13
=== JanC_ is now known as JanC
fishcookerhow to get detail of process when i have the pid ?16:21
dpb1fishcooker: ps -p 1 -f <other flags here>16:26
dpb1note, ordering is important for some of the flags.  ps is an OLD command. :)16:26
MASMHello, I have a problem whit some hacker or some scripts that hacker installed in my server, but i don't know where find it, some times appear 3 files "on.php, up.php, access.php", in "/var/www/website.com/public_html/on.php" owner by "www-data" user, but what can I do with this?, i have a script run every 5 minutes to delete it, but how can I detect the bulneravility?17:37
MASMfiles contain base64 code17:38
naccMASM: take your server offline17:39
naccMASM: you can't trust anything on it at this point, if you don't know where those files are coming from17:39
MASMyes, but i can't take it down, it need to be on all day, i need17:53
naccMASM: you definitely don't *need* a corrupt, hacked server17:53
MASMtips to solve this17:53
MASMit is only in that folder, and after get down the server what i need to do?17:54
naccMASM: you have no idea what else is running or happeninng on your server17:54
naccMASM: it seems like, which means you don't know the extent of damage done17:55
mike-zalmonitoring tools are needed to anylize what is happening, but for that you need sysadmin who knows linux enough to recognize some atypical things18:00
mike-zalif you have no way to resolve it, doing a copy of your stuff and reinstalling things, focusing on securing server and then restoring back of your content is the best solution. find some hosting where you can temporary move your site and clean your server MASM. worse, if the problem is placed somewhere in your site... but you will find out about it eventually if you clean your server..18:02
MASMI have been going crazy, looking for what they have modified the server, but the only thing that know is that they have made me an "Mass Desfase", they are a "White hat"18:12
MASMcreate files in that folder, and up that files php, and change the files of the domain18:13
RoyKMASM: pastebin those php scripts - if you want to see what's running them, check the webserver log, it should give you you an ip address18:13
RoyKMASM: also, check the timestamp on those files18:14
RoyKthat is, at least don't edit them before you have the timestamp18:14
RoyKjust ls -l /path/to/file18:15
MASMthay are in base64 and are like "forms uploading files"18:15
MASM-rw-r--r-- 1 www-data www-data  28 Sep 16 06:47 /var/www/mysite.com/public_html/on.php18:15
MASMthis is one18:15
RoyKthat's only two days old18:15
RoyKcheck  the webserver logs - apache?18:15
RoyKbut pastebin one anyway: cat /var/www/mysite.com/public_html/on.php | pastebinit18:16
RoyKwhich version of ubuntu is this?18:18
MASM14.0418:20
tomreyn14.04.0 or 14.04.1? or something else? lsb_release -sd should tell18:21
MASMbut i delete the file, well my script delete it, i have a script running every 5 minutes and if it detect that files it remove all18:21
tomreynwhat makes you think that ths is a "White hat" "Mass Desfase"?18:22
MASM Ubuntu 14.04.5 LTS18:22
MASMthe edited the index.php with their logo18:22
dpb1MASM: did you unplug the server from the network?18:23
tomreynmay one of the many intruders did that, and the others got root?18:23
MASMand i found them in facebook, and in their biography i find my website18:23
tomreynindeed unplugging it from network is the first thiing to do18:23
MASMi have jail2ban with ssh18:24
tomreynyou allowed it to get compromised, now you need to deal with the downtime18:24
MASMi think they can get access with root, and i change the password every week18:24
RoyKwell, the box has been compromised - if they have gotten root accesss, reinstall18:24
tomreynchanging the root password weekly wont prevent privilege escalation18:25
RoyKthere's a zillion ways to make a root backdoor once you're in as root18:25
RoyKMASM: btw, are the files under /var/www owned by www-data?18:25
RoyKand do you have a backup?18:26
MASMyes i have backups18:26
RoyKvery good18:26
lordcirth_workReinstall the server, salt state.apply, restore backups if needed, watch auth.log like a hawk?18:26
RoyKbut just take down the box and reinstall it18:26
MASMi installed clamv to see if there is a malicous file18:27
lordcirth_workAnd make sure you're up to date18:27
tomreynlordcirth_work: did s/he say s/he uses salt stack?18:27
lordcirth_workwhoops, wrong channel lol18:27
lordcirth_work#salt is the other tab, lol18:27
tomreyn:)18:27
MASMi don't use it e-e18:28
MASMoh!18:28
RoyKlordcirth_work: if the php files and their dir(s) are owned by www-data, it's possible to change those using a seurity hole if one exists in another php file18:28
lordcirth_workIn future, I would strongly recommend using some sort of configuration management18:28
mike-zalMASM: some articles claim that on tests, clam av showed one of the worst detection rate of both win and linux malware.18:28
* RoyK likes ansible18:28
mike-zalthere are many more efficient antivirs for linux thou18:28
lordcirth_workmike-zal, any suggestions?18:28
MASMand don't know another antivirus18:28
mike-zalansilble is awesome. have to learn it18:29
lordcirth_workI prefer Salt.  But either is much better than nothing18:29
RoyKMASM: it's probably not a virus - there aren't too many of those for linux18:29
RoyKMASM: and any file can be malicious without clamav finds out - it's not *that* smart18:30
MASMi use a php find base6418:30
mike-zallordcirth_work: here is the article, it's a bit dated thou: https://www.csoonline.com/article/2989137/linux/av-test-lab-tests-16-linux-antivirus-products-against-windows-and-linux-malware.html18:30
MASMto see if there is more files18:30
lordcirth_workYour website might now be redirecting people to viruses, though...18:30
mike-zalbut you have there some list of potential av software for linux lordcirth_work18:30
RoyKMASM: well, at least take the machine offline18:31
lordcirth_workThanks18:31
MASMRoyK ok i will18:31
MASMand i going to reinstall all,18:31
MASMi was thinking to use docker18:31
RoyKprobably a good idea, quite possibly on 16.04 to get something fresher18:32
lordcirth_workYes, if you're reinstalling you should try 16.0418:32
dpb1MASM: were you keeping packages up to date, and making sure to reboot onto new kernels regularly?18:32
tomreynMASM: good choice (about taking it offline and reinstalling). once it's offline make sure you got complete and current backups, and that the backups aren't compromised either.18:32
RoyKMASM: and before it's online, setup ufw to only allow what you need18:33
MASMdpb1: yes i do that updates18:33
lordcirth_workI prefer shorewall to ufw18:33
RoyKlordcirth_work: well, I beleive ufw is easy, and the iptables rules it writes, isn't bad18:34
lordcirth_workRoyK, I have never gotten ufw to behave the way I expect it to, I don't know why.  Maybe it's just me.  Last time I tried I gave up and wrote the iptables myself18:35
MASMi have some security, like ufw, with only ports that i use, jail2ban, apache (mod_security and mod_evasive)18:35
mike-zalMASM: interesting article: https://likegeeks.com/secure-linux-server-hardening-best-practices/18:35
RoyKlordcirth_work: depends what you need, though. ufw is quite simple, but I use it for most my stuff18:35
mike-zalthat's aside standard security measures.18:36
RoyKMASM: this php thing you're running, is it developed in-house or is it some standard package?18:37
MASMthe script that i find in internet to find files .php with base64?18:38
MASMRoyK : https://github.com/mikestowe/Malicious-Code-Scanner/blob/master/phpMalCodeScanner.php18:39
MASMexample of malocious code php https://aw-snap.info/articles/php-examples.php18:40
MASMwell thanks to all, i will reinstall all, and get more security to the users18:42
RoyKMASM: no, I meant the webapp18:42
MASMoh, it is drupal 718:43
RoyKoh, drupal18:44
* RoyK has never liked that18:44
RoyKMASM: has drupal been updated lately? it has a rather bad reputation for exploits18:45
MASMRoyK: some modules are update others no18:48
RoyKhttps://www.exploit-db.com/exploits/41564/18:49
tomreynthat's a specific third party drupal module, not in core.18:51
RoyKtomreyn: yes, but MASM said not all mods were updated, which may imply third-module stuff that you have to update manually18:51
tomreynright, but there are plenty of modules, and many of them have vulnerabilities in some versions. i'm just saying you made a wild guess there.18:52
RoyKI did, and thus I pointed to an exploit18:53
RoyKI didn't say he was using that particular module18:53
tomreynok, i just wanted to put some context around this URL.18:54
RoyKanyway - I home MASM will keep an eye on drupal for later to better avoid such things18:54
MASMi think that, because only in the folder that is drupal, they can create files, with www-data, i think it means that they don't have access to some user of linux, and maybe they are using php injection or something like that18:56
MASMor exploit like Royk says18:57
tomreynit'd be a good idea to run something other than mod_php, e.g. fpm, since thsoe other models allow more fine grained security restrictions. also disable some dangerous php functions unless you strictly need them.18:57
sdezielit's also good to restrict where the www-data use can write (typically only needed for some caches and upload dirs)18:57
naccsdeziel: fyi, i'm doing the import of tor and and adding it to our autoimport list18:59
tomreynphp_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate18:59
tomreynuse those by default, and only remove what's strictly needed, only for those sitzes that need it.19:00
sdezielnacc: thanks!19:00
naccsdeziel: np, thank you!19:01
ahasenackhm, I got a package which has a debian/patches/00list file instead of debian/patches/series19:20
ahasenackis that from an old quilt version, or before quilt even?19:20
ahasenackcurrent quilt doesn't seem to even look for 00list19:21
naccahasenack: depends on how it's built, is it 3.0 (quilt)?19:21
ahasenackno such file there (debian/source/format)19:21
ahasenackcould it be dpatch?19:22
ahasenackthere are two patches there, and they have DPATCH in their headers19:22
ahasenack@DPATCH@, even19:22
ahasenackinclude /usr/share/dpatch/dpatch.make19:22
ahasenackmeh19:22
naccahasenack: ah, then it's a 1.019:22
naccahasenack: or could be using dpatch19:23
07IAA32V7sorry my computer die19:29
MASMsorry my computer die, thanks to all19:29
MASMfor help me19:29
hehehehi21:24
heheheI am playing with xdotool21:24
hehehexdotool windowactivate 2307634121:24
heheheXGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)21:24
hehehewheyyy21:24
hehehe:)21:24
hehehei can do windows close21:25
hehehechromium21:25
ahasenackcan I use a dep3 header in an old dpatch patch?21:31
naccahasenack: from dep3 itself: "For patch-systems like dpatch that require the patch to be a standalone script, the shebang line is ignored and it is possible to put those fields in comments. The line should then follow the format "# <field>". For multi-line fields, the subsequent lines should start with "#  " (hash followed by two spaces) so that they start with a space once "# " (hash followed by a21:33
naccspace) has been stripped from the beginning."21:33
ahasenackthe lines start with "## DP:" actually21:34
ahasenackI was going to add the dep3 bits prefixed with "## DP:"21:34
naccahasenack: i think those linens are actual dpatch lines21:35
naccahasenack: whereas the above is referring to just putting unparsed comment sin21:35
naccahasenack: i really don't know and dpatch is deprecated :)21:35
ahasenackit starts with "## All lines beginning with `## DP:' are a description of the patch."21:35
ahasenacknacc: yeah, but for an sru I'm not going to change the patch system :)21:35
naccahasenack: yeah, i agree -- i'm just saying i don't think it actually parses DP:21:36
naccahasenack: easy enough to check21:36
ahasenacksaid the last person going into the woods to check that noise21:36
naccwell, that implies someone was there to hear it!21:37
naccotherwise, they're just a tree falling in the woods21:37
ahasenackfunny how that has been interpreted in the past: (not my comment, yours)21:37
ahasenack## All lines beginning with `## DP:' are a description of the patch.21:37
ahasenack## DP: This patch makes sure Makefile references -lpam21:37
ahasenack## to insure correct linking21:37
* ahasenack checks what patch-template does21:38
naccahasenack: yeah, i suppose for minimzing the cognitive noise, i'd just follow the existing template21:39
ahasenackit repeats DP:21:39
naccahasenack: oh i wonder if DP: is what `dpatch cat ... ` uses21:39
ahasenack"easy enough to check"21:39
ahasenack:)21:39
ahasenackyes21:40
ahasenackdebian/patches/02_libpam.patch ():21:40
ahasenack  This patch makes sure Makefile references -lpam21:40
ahasenackit's missing "to insure correct linking"21:40
ahasenackgood catch21:40
naccahasenack: yeah the manpage says it does length stripping automatically, etc.21:41
naccahasenack: so i think your dep3 header should not use DP:21:41
ahasenackwhy?21:41
ahasenackare you referring to the dep3 quote from before?21:42
ahasenackmaybe just use the dep3 description prefixed with ## DP:, so that dpatch cat shows it?21:42
oraqolHello all, having a little trouble 'conjure-up'-ing on fresh default ubuntu 16.04 and getting the following error: lxd not found please install with sudo snap install lxd && lxd init and wait for this message to disappear21:48
stokachuoraqol: did you run `sudo snap install lxd`?21:49
oraqolyes21:49
stokachuok i got a fix in that adds more information to the error, but you need to make sure to run `/snap/bin/lxd init && /snap/bin/lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false`21:50
oraqolgetting the following after running those commands: error: Unable to talk to LXD: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied21:50
oraqolbut I have been messing with the installation.  I'll re-image and try that from scratch21:51
stokachuoraqol: what does `ls -l /var/snap/lxd/common/lxd` show?21:51
stokachusorry `sudo ls -l /var/snap/lxd/common/lxd`21:51
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 cache21:52
oraqoldrwx--x--x. 2 root root 4096 Sep 18 17:50 containers21:52
oraqoldrwx--x--x. 2 root root 4096 Sep 18 17:50 devices21:52
oraqoldrwxr-xr-x. 2 root root 4096 Sep 18 17:50 devlxd21:52
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 disks21:52
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 images21:52
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 logs21:52
oraqollrwxrwxrwx. 1 root root   24 Sep 18 17:50 lxd.db -> ../../current/lxd/lxd.db21:52
oraqoldrwx--x--x. 2 root root 4096 Sep 18 17:50 networks21:52
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 security21:52
oraqol-rw-r--r--. 1 root root 1903 Sep 18 17:50 server.crt21:52
oraqol-rw-------. 1 root root 3243 Sep 18 17:50 server.key21:52
oraqoldrwx--x--x. 2 root root 4096 Sep 18 17:50 shmounts21:52
oraqoldrwx------. 2 root root 4096 Sep 18 17:50 snapshots21:52
stokachuthere should be a unix.socket file in there21:52
oraqolI'll reimage and try again later, then update here21:53
oraqolthanks guys21:53
stokachuok im around just ping me later21:54
RoyKstokachu: next time, tell him to !pastebin it :P22:05
stokachuRoyK: yea sorry about that i should be more careful when i ask for those things22:10
{bosco}ok so i have my apache webserver setup my ( website.com ) links to /var/www/website/public_html/index.html how do i get it to link to /home/user/website/public_html/index.html (ubuntu 17.04)22:53
oerheks{bosco}, we advise againt that, but you can: https://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server23:05
oerhekschange /etc/apache2/sites-available/000-default.conf to you /home/$USER/ etc23:05
{bosco}oerheks: yes but cant u just use symlinks23:06
oerheks{bosco}, that would be an outer solution, but why ?23:07
{bosco}basicly i want the easiest and most secure way when i login to my server as a user to be able to edit the website not as root23:07
{bosco}oerheks:23:11
Ussateasy and most secure dont always go together23:15
{bosco}yes i agree so how do i edit the file /home/user/website/public_html/index.html and have it edit mywebsite23:16
{bosco}do i need to create a symlink to point there i am kinda lost allthough i have read lots of documentation23:17
{bosco}Ussat:23:17
Ussatwht do you mean "edit my website"?23:17
Ussatwhy not edit your site directly ?23:18
naccUssat: i believe they are trying to avoid being root23:18
{bosco}u are correct23:18
Ussatahh23:18
Ussatwhy is your website only editable by root ?23:19
Ussatand just use sudo then23:19
{bosco}: Ussat i want to change that i want to be able to have my /home/user/website1/public_html/index.html point to my website.com ? isnt that possible? if so how do i do it \?23:20
UssatI know what you want to do, a sym link would do that, but why bother ?23:21
Ussatedit the site directly with sudo vi <file>23:21
{bosco}becuase i dont want to use sudo everytime and i have tried symlinks but failed in attemps i dont want to have to put in my sudo password every time i just edit index.html23:22
UssatWell, other than that, no, you cant23:22
Ussatyou said wanted secure, sudo is secure, it asks for a password every time23:23
sarnoldor you could follow the advice in https://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server as oerheks suggested23:23
oerheksadd your user to www-data > sudo adduser <username> www-data # https://askubuntu.com/questions/19898/whats-the-simplest-way-to-edit-and-add-files-to-var-www23:23
Ussatahh I did not see that, I donno if I would do that myself, but its a option23:23
{bosco}i looiked at that documentation and it didnt work right i must be doing something wrong23:24
{bosco}: sarnold23:24
oerheksbasicly the 1st thing i do23:24
Ussatsrsly, just use sudo23:24
{bosco}it is possible to store website.com/index.html in /home/user/website/pubic_html/ why cant i do that ? sorry with all the different options i am lost23:26
oerheksYou *can* store it there, sure... for backup23:26
{bosco}: oerheks how do i use that not as a backup23:26
oerheks{bosco}, change /etc/apache2/sites-available/000-default.conf to that folder23:27
oerheks* and restart apache23:28
{bosco}when i do that it says i do not have permission to view on the server from web browser23:28
{bosco}: oerheks23:29
oerheksare those files and folders in the www-data group? apache wants that.23:29
oerheks( correct me if i am wrong)23:30
{bosco}i have changed my .conf file to direct or look for my index.html file in my users folder23:30
{bosco}but when i do that i get permssion denied by the web browser23:30
UssatI need to ask, why are you making these changes ? It sounds like youre making this harder than it needs to be23:31
sarnold{bosco}: you can use namei -l /path/name/here to help find which file or directory needs its permissions or ownership changed23:31
{bosco}it may be harder than doing that i agree but i am not trying to sound rude or anything at all i am great full for any advice but what is the best way to do as a described ?23:34
{bosco}: sarnold23:34
{bosco}i not a23:35

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!